From 76c7f2c9ca9fd150286a3ddedbefce713a4296ec Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 6 Mar 2024 19:18:12 +0000 Subject: [PATCH] CodeGen from PR 28111 in Azure/azure-rest-api-specs Merge ac92d006886538b3607d5b1aa41cb1971d06de4f into 08142ac69a12e484b69b85710153ec113dd9f987 --- sdk/compute/azure-mgmt-avs/_meta.json | 4 +- .../azure/mgmt/avs/_avs_client.py | 56 +- .../azure/mgmt/avs/_configuration.py | 4 +- .../azure-mgmt-avs/azure/mgmt/avs/_version.py | 2 +- .../azure/mgmt/avs/aio/_avs_client.py | 56 +- .../azure/mgmt/avs/aio/_configuration.py | 4 +- .../azure/mgmt/avs/aio/operations/__init__.py | 34 +- .../avs/aio/operations/_addons_operations.py | 71 +- .../operations/_authorizations_operations.py | 78 +- .../aio/operations/_cloud_links_operations.py | 71 +- .../aio/operations/_clusters_operations.py | 104 +- .../aio/operations/_datastores_operations.py | 79 +- .../_global_reach_connections_operations.py | 78 +- .../_hcx_enterprise_sites_operations.py | 57 +- .../aio/operations/_iscsi_paths_operations.py | 561 +++ .../aio/operations/_locations_operations.py | 130 +- .../mgmt/avs/aio/operations/_operations.py | 6 +- .../_placement_policies_operations.py | 129 +- .../operations/_private_clouds_operations.py | 312 +- .../operations/_script_cmdlets_operations.py | 16 +- .../_script_executions_operations.py | 79 +- .../operations/_script_packages_operations.py | 10 +- .../_virtual_machines_operations.py | 57 +- .../_workload_networks_operations.py | 3843 ++++++++------- .../azure/mgmt/avs/models/__init__.py | 176 +- .../mgmt/avs/models/_avs_client_enums.py | 465 +- .../azure/mgmt/avs/models/_models_py3.py | 3161 +++++++----- .../azure/mgmt/avs/operations/__init__.py | 34 +- .../mgmt/avs/operations/_addons_operations.py | 80 +- .../operations/_authorizations_operations.py | 87 +- .../avs/operations/_cloud_links_operations.py | 80 +- .../avs/operations/_clusters_operations.py | 117 +- .../avs/operations/_datastores_operations.py | 86 +- .../_global_reach_connections_operations.py | 87 +- .../_hcx_enterprise_sites_operations.py | 67 +- .../avs/operations/_iscsi_paths_operations.py | 687 +++ .../avs/operations/_locations_operations.py | 152 +- .../azure/mgmt/avs/operations/_operations.py | 8 +- .../_placement_policies_operations.py | 138 +- .../operations/_private_clouds_operations.py | 357 +- .../operations/_script_cmdlets_operations.py | 20 +- .../_script_executions_operations.py | 90 +- .../operations/_script_packages_operations.py | 14 +- .../_virtual_machines_operations.py | 66 +- .../_workload_networks_operations.py | 4241 ++++++++--------- .../addons_create_or_update_arc_reg.py | 2 +- .../addons_create_or_update_hcx.py | 2 +- .../addons_create_or_update_srm.py | 2 +- .../addons_create_or_update_vr.py | 2 +- .../generated_samples/addons_delete.py | 2 +- .../generated_samples/addons_get_arc_reg.py | 2 +- .../generated_samples/addons_get_hcx.py | 2 +- .../generated_samples/addons_get_srm.py | 2 +- .../generated_samples/addons_get_vr.py | 2 +- .../generated_samples/addons_list.py | 2 +- .../authorizations_delete.py | 2 +- .../generated_samples/authorizations_get.py | 2 +- .../generated_samples/authorizations_list.py | 2 +- .../cloud_links_create_or_update.py | 2 +- .../generated_samples/cloud_links_delete.py | 2 +- .../generated_samples/cloud_links_get.py | 2 +- .../generated_samples/cloud_links_list.py | 2 +- .../clusters_create_or_update.py | 2 +- .../generated_samples/clusters_delete.py | 2 +- .../generated_samples/clusters_get.py | 2 +- .../generated_samples/clusters_list.py | 2 +- .../generated_samples/clusters_list_zones.py | 2 +- .../clusters_list_zones_stretched.py | 2 +- .../generated_samples/clusters_update.py | 2 +- .../datastores_create_or_update.py | 2 +- .../generated_samples/datastores_delete.py | 2 +- .../generated_samples/datastores_get.py | 2 +- .../generated_samples/datastores_list.py | 2 +- ...obal_reach_connections_create_or_update.py | 2 +- .../global_reach_connections_delete.py | 2 +- .../global_reach_connections_get.py | 2 +- .../global_reach_connections_list.py | 2 +- .../hcx_enterprise_sites_delete.py | 2 +- .../hcx_enterprise_sites_get.py | 2 +- .../hcx_enterprise_sites_list.py | 2 +- .../iscsi_paths_create_or_update.py | 42 + .../generated_samples/iscsi_paths_delete.py | 40 + .../generated_samples/iscsi_paths_get.py | 41 + .../generated_samples/iscsi_paths_list.py | 42 + .../locations_check_quota_availability.py | 2 +- .../locations_check_trial_availability.py | 2 +- ...tions_check_trial_availability_with_sku.py | 2 +- .../generated_samples/operations_list.py | 2 +- .../placement_policies_create_or_update.py | 2 +- .../placement_policies_delete.py | 2 +- .../placement_policies_get.py | 2 +- .../placement_policies_list.py | 2 +- .../placement_policies_update.py | 2 +- .../private_clouds_create_or_update.py | 2 +- ...ivate_clouds_create_or_update_stretched.py | 2 +- .../private_clouds_delete.py | 2 +- .../generated_samples/private_clouds_get.py | 2 +- .../private_clouds_get_stretched.py | 2 +- .../generated_samples/private_clouds_list.py | 2 +- .../private_clouds_list_admin_credentials.py | 2 +- .../private_clouds_list_in_subscription.py | 2 +- ...e_clouds_list_in_subscription_stretched.py | 2 +- .../private_clouds_list_stretched.py | 2 +- .../private_clouds_rotate_nsxt_password.py | 2 +- .../private_clouds_rotate_vcenter_password.py | 2 +- .../private_clouds_update.py | 2 +- .../private_clouds_update_stretched.py | 2 +- .../generated_samples/script_cmdlets_get.py | 2 +- .../generated_samples/script_cmdlets_list.py | 2 +- .../script_executions_create_or_update.py | 2 +- .../script_executions_delete.py | 2 +- .../script_executions_get.py | 2 +- .../script_executions_get_execution_logs.py | 2 +- .../script_executions_list.py | 2 +- .../generated_samples/script_packages_get.py | 2 +- .../generated_samples/script_packages_list.py | 2 +- .../generated_samples/virtual_machines_get.py | 2 +- .../virtual_machines_list.py | 2 +- .../virtual_machines_restrict_movement.py | 2 +- ...ns.py => workload_networks_create_dhcp.py} | 4 +- ...> workload_networks_create_dns_service.py} | 4 +- ...y => workload_networks_create_dns_zone.py} | 4 +- ...orkload_networks_create_port_mirroring.py} | 4 +- .../workload_networks_create_segments.py | 2 +- ...y => workload_networks_create_vm_group.py} | 4 +- ...ns.py => workload_networks_delete_dhcp.py} | 4 +- ...> workload_networks_delete_dns_service.py} | 4 +- ...y => workload_networks_delete_dns_zone.py} | 4 +- ...orkload_networks_delete_port_mirroring.py} | 4 +- ...py => workload_networks_delete_segment.py} | 4 +- ...y => workload_networks_delete_vm_group.py} | 4 +- .../workload_networks_get.py | 3 +- ...tions.py => workload_networks_get_dhcp.py} | 4 +- ...y => workload_networks_get_dns_service.py} | 4 +- ...s.py => workload_networks_get_dns_zone.py} | 4 +- .../workload_networks_get_gateway.py | 2 +- ...> workload_networks_get_port_mirroring.py} | 4 +- ...ts.py => workload_networks_get_segment.py} | 4 +- .../workload_networks_get_virtual_machine.py | 2 +- ...s.py => workload_networks_get_vm_group.py} | 4 +- .../workload_networks_list.py | 2 +- ...ions.py => workload_networks_list_dhcp.py} | 4 +- .../workload_networks_list_dns_services.py | 2 +- .../workload_networks_list_dns_zones.py | 2 +- .../workload_networks_list_gateways.py | 2 +- ... workload_networks_list_port_mirroring.py} | 4 +- .../workload_networks_list_public_ips.py | 2 +- .../workload_networks_list_segments.py | 2 +- ...workload_networks_list_virtual_machines.py | 2 +- .../workload_networks_list_vm_groups.py | 2 +- ...ns.py => workload_networks_update_dhcp.py} | 4 +- ...> workload_networks_update_dns_service.py} | 4 +- ...y => workload_networks_update_dns_zone.py} | 4 +- ...orkload_networks_update_port_mirroring.py} | 4 +- .../workload_networks_update_segments.py | 2 +- ...y => workload_networks_update_vm_group.py} | 4 +- 156 files changed, 9349 insertions(+), 7133 deletions(-) create mode 100644 sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_iscsi_paths_operations.py create mode 100644 sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_iscsi_paths_operations.py create mode 100644 sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_create_or_update.py create mode 100644 sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_delete.py create mode 100644 sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_get.py create mode 100644 sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_list.py rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_create_dhcp_configurations.py => workload_networks_create_dhcp.py} (92%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_create_dns_services.py => workload_networks_create_dns_service.py} (93%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_create_dns_zones.py => workload_networks_create_dns_zone.py} (93%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_create_port_mirroring_profiles.py => workload_networks_create_port_mirroring.py} (92%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_create_vm_groups.py => workload_networks_create_vm_group.py} (93%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_delete_dhcp_configurations.py => workload_networks_delete_dhcp.py} (90%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_delete_dns_services.py => workload_networks_delete_dns_service.py} (91%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_delete_dns_zones.py => workload_networks_delete_dns_zone.py} (92%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_delete_port_mirroring_profiles.py => workload_networks_delete_port_mirroring.py} (90%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_delete_segments.py => workload_networks_delete_segment.py} (92%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_delete_vm_groups.py => workload_networks_delete_vm_group.py} (92%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_get_dhcp_configurations.py => workload_networks_get_dhcp.py} (91%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_get_dns_services.py => workload_networks_get_dns_service.py} (92%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_get_dns_zones.py => workload_networks_get_dns_zone.py} (92%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_get_port_mirroring_profiles.py => workload_networks_get_port_mirroring.py} (91%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_get_segments.py => workload_networks_get_segment.py} (92%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_get_vm_groups.py => workload_networks_get_vm_group.py} (92%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_list_dhcp_configurations.py => workload_networks_list_dhcp.py} (91%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_list_port_mirroring_profiles.py => workload_networks_list_port_mirroring.py} (90%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_update_dhcp_configurations.py => workload_networks_update_dhcp.py} (91%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_update_dns_services.py => workload_networks_update_dns_service.py} (93%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_update_dns_zones.py => workload_networks_update_dns_zone.py} (93%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_update_port_mirroring_profiles.py => workload_networks_update_port_mirroring.py} (91%) rename sdk/compute/azure-mgmt-avs/generated_samples/{workload_networks_update_vm_groups.py => workload_networks_update_vm_group.py} (92%) diff --git a/sdk/compute/azure-mgmt-avs/_meta.json b/sdk/compute/azure-mgmt-avs/_meta.json index fe15a4e85850..4d839e910c10 100644 --- a/sdk/compute/azure-mgmt-avs/_meta.json +++ b/sdk/compute/azure-mgmt-avs/_meta.json @@ -1,11 +1,11 @@ { - "commit": "a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93", + "commit": "11bc30a6562391fde40b1e6328d1e0c958e790b1", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.7", "use": [ "@autorest/python@6.7.1", "@autorest/modelerfour@4.26.2" ], - "autorest_command": "autorest specification/vmware/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", + "autorest_command": "autorest specification/vmware/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", "readme": "specification/vmware/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py index fcbdbea68916..4029d6246543 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py @@ -23,6 +23,7 @@ DatastoresOperations, GlobalReachConnectionsOperations, HcxEnterpriseSitesOperations, + IscsiPathsOperations, LocationsOperations, Operations, PlacementPoliciesOperations, @@ -48,39 +49,41 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :vartype locations: azure.mgmt.avs.operations.LocationsOperations :ivar private_clouds: PrivateCloudsOperations operations :vartype private_clouds: azure.mgmt.avs.operations.PrivateCloudsOperations - :ivar clusters: ClustersOperations operations - :vartype clusters: azure.mgmt.avs.operations.ClustersOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.avs.operations.DatastoresOperations - :ivar hcx_enterprise_sites: HcxEnterpriseSitesOperations operations - :vartype hcx_enterprise_sites: azure.mgmt.avs.operations.HcxEnterpriseSitesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.avs.operations.AddonsOperations :ivar authorizations: AuthorizationsOperations operations :vartype authorizations: azure.mgmt.avs.operations.AuthorizationsOperations - :ivar global_reach_connections: GlobalReachConnectionsOperations operations - :vartype global_reach_connections: azure.mgmt.avs.operations.GlobalReachConnectionsOperations - :ivar workload_networks: WorkloadNetworksOperations operations - :vartype workload_networks: azure.mgmt.avs.operations.WorkloadNetworksOperations :ivar cloud_links: CloudLinksOperations operations :vartype cloud_links: azure.mgmt.avs.operations.CloudLinksOperations - :ivar addons: AddonsOperations operations - :vartype addons: azure.mgmt.avs.operations.AddonsOperations - :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.avs.operations.VirtualMachinesOperations + :ivar clusters: ClustersOperations operations + :vartype clusters: azure.mgmt.avs.operations.ClustersOperations + :ivar datastores: DatastoresOperations operations + :vartype datastores: azure.mgmt.avs.operations.DatastoresOperations :ivar placement_policies: PlacementPoliciesOperations operations :vartype placement_policies: azure.mgmt.avs.operations.PlacementPoliciesOperations + :ivar virtual_machines: VirtualMachinesOperations operations + :vartype virtual_machines: azure.mgmt.avs.operations.VirtualMachinesOperations + :ivar global_reach_connections: GlobalReachConnectionsOperations operations + :vartype global_reach_connections: azure.mgmt.avs.operations.GlobalReachConnectionsOperations + :ivar hcx_enterprise_sites: HcxEnterpriseSitesOperations operations + :vartype hcx_enterprise_sites: azure.mgmt.avs.operations.HcxEnterpriseSitesOperations + :ivar iscsi_paths: IscsiPathsOperations operations + :vartype iscsi_paths: azure.mgmt.avs.operations.IscsiPathsOperations + :ivar script_executions: ScriptExecutionsOperations operations + :vartype script_executions: azure.mgmt.avs.operations.ScriptExecutionsOperations :ivar script_packages: ScriptPackagesOperations operations :vartype script_packages: azure.mgmt.avs.operations.ScriptPackagesOperations :ivar script_cmdlets: ScriptCmdletsOperations operations :vartype script_cmdlets: azure.mgmt.avs.operations.ScriptCmdletsOperations - :ivar script_executions: ScriptExecutionsOperations operations - :vartype script_executions: azure.mgmt.avs.operations.ScriptExecutionsOperations + :ivar workload_networks: WorkloadNetworksOperations operations + :vartype workload_networks: azure.mgmt.avs.operations.WorkloadNetworksOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-03-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -104,29 +107,30 @@ def __init__( self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize) self.private_clouds = PrivateCloudsOperations(self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations(self._client, self._config, self._serialize, self._deserialize) + self.authorizations = AuthorizationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.cloud_links = CloudLinksOperations(self._client, self._config, self._serialize, self._deserialize) self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.hcx_enterprise_sites = HcxEnterpriseSitesOperations( + self.placement_policies = PlacementPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.authorizations = AuthorizationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.global_reach_connections = GlobalReachConnectionsOperations( + self.virtual_machines = VirtualMachinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.workload_networks = WorkloadNetworksOperations( + self.global_reach_connections = GlobalReachConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.cloud_links = CloudLinksOperations(self._client, self._config, self._serialize, self._deserialize) - self.addons = AddonsOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machines = VirtualMachinesOperations( + self.hcx_enterprise_sites = HcxEnterpriseSitesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.placement_policies = PlacementPoliciesOperations( + self.iscsi_paths = IscsiPathsOperations(self._client, self._config, self._serialize, self._deserialize) + self.script_executions = ScriptExecutionsOperations( self._client, self._config, self._serialize, self._deserialize ) self.script_packages = ScriptPackagesOperations(self._client, self._config, self._serialize, self._deserialize) self.script_cmdlets = ScriptCmdletsOperations(self._client, self._config, self._serialize, self._deserialize) - self.script_executions = ScriptExecutionsOperations( + self.workload_networks = WorkloadNetworksOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py index f952ef584913..eb7cbdb76caf 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py @@ -29,14 +29,14 @@ class AVSClientConfiguration(Configuration): # pylint: disable=too-many-instanc :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-03-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(AVSClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-03-01") + api_version: str = kwargs.pop("api_version", "2023-09-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py index 142a0420b39b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py index a1a6593adde5..e36ea9101523 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_avs_client.py @@ -23,6 +23,7 @@ DatastoresOperations, GlobalReachConnectionsOperations, HcxEnterpriseSitesOperations, + IscsiPathsOperations, LocationsOperations, Operations, PlacementPoliciesOperations, @@ -48,40 +49,42 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many- :vartype locations: azure.mgmt.avs.aio.operations.LocationsOperations :ivar private_clouds: PrivateCloudsOperations operations :vartype private_clouds: azure.mgmt.avs.aio.operations.PrivateCloudsOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.avs.aio.operations.AddonsOperations + :ivar authorizations: AuthorizationsOperations operations + :vartype authorizations: azure.mgmt.avs.aio.operations.AuthorizationsOperations + :ivar cloud_links: CloudLinksOperations operations + :vartype cloud_links: azure.mgmt.avs.aio.operations.CloudLinksOperations :ivar clusters: ClustersOperations operations :vartype clusters: azure.mgmt.avs.aio.operations.ClustersOperations :ivar datastores: DatastoresOperations operations :vartype datastores: azure.mgmt.avs.aio.operations.DatastoresOperations - :ivar hcx_enterprise_sites: HcxEnterpriseSitesOperations operations - :vartype hcx_enterprise_sites: azure.mgmt.avs.aio.operations.HcxEnterpriseSitesOperations - :ivar authorizations: AuthorizationsOperations operations - :vartype authorizations: azure.mgmt.avs.aio.operations.AuthorizationsOperations + :ivar placement_policies: PlacementPoliciesOperations operations + :vartype placement_policies: azure.mgmt.avs.aio.operations.PlacementPoliciesOperations + :ivar virtual_machines: VirtualMachinesOperations operations + :vartype virtual_machines: azure.mgmt.avs.aio.operations.VirtualMachinesOperations :ivar global_reach_connections: GlobalReachConnectionsOperations operations :vartype global_reach_connections: azure.mgmt.avs.aio.operations.GlobalReachConnectionsOperations - :ivar workload_networks: WorkloadNetworksOperations operations - :vartype workload_networks: azure.mgmt.avs.aio.operations.WorkloadNetworksOperations - :ivar cloud_links: CloudLinksOperations operations - :vartype cloud_links: azure.mgmt.avs.aio.operations.CloudLinksOperations - :ivar addons: AddonsOperations operations - :vartype addons: azure.mgmt.avs.aio.operations.AddonsOperations - :ivar virtual_machines: VirtualMachinesOperations operations - :vartype virtual_machines: azure.mgmt.avs.aio.operations.VirtualMachinesOperations - :ivar placement_policies: PlacementPoliciesOperations operations - :vartype placement_policies: azure.mgmt.avs.aio.operations.PlacementPoliciesOperations + :ivar hcx_enterprise_sites: HcxEnterpriseSitesOperations operations + :vartype hcx_enterprise_sites: azure.mgmt.avs.aio.operations.HcxEnterpriseSitesOperations + :ivar iscsi_paths: IscsiPathsOperations operations + :vartype iscsi_paths: azure.mgmt.avs.aio.operations.IscsiPathsOperations + :ivar script_executions: ScriptExecutionsOperations operations + :vartype script_executions: azure.mgmt.avs.aio.operations.ScriptExecutionsOperations :ivar script_packages: ScriptPackagesOperations operations :vartype script_packages: azure.mgmt.avs.aio.operations.ScriptPackagesOperations :ivar script_cmdlets: ScriptCmdletsOperations operations :vartype script_cmdlets: azure.mgmt.avs.aio.operations.ScriptCmdletsOperations - :ivar script_executions: ScriptExecutionsOperations operations - :vartype script_executions: azure.mgmt.avs.aio.operations.ScriptExecutionsOperations + :ivar workload_networks: WorkloadNetworksOperations operations + :vartype workload_networks: azure.mgmt.avs.aio.operations.WorkloadNetworksOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-03-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -105,29 +108,30 @@ def __init__( self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize) self.private_clouds = PrivateCloudsOperations(self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations(self._client, self._config, self._serialize, self._deserialize) + self.authorizations = AuthorizationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.cloud_links = CloudLinksOperations(self._client, self._config, self._serialize, self._deserialize) self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.hcx_enterprise_sites = HcxEnterpriseSitesOperations( + self.placement_policies = PlacementPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.authorizations = AuthorizationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.global_reach_connections = GlobalReachConnectionsOperations( + self.virtual_machines = VirtualMachinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.workload_networks = WorkloadNetworksOperations( + self.global_reach_connections = GlobalReachConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.cloud_links = CloudLinksOperations(self._client, self._config, self._serialize, self._deserialize) - self.addons = AddonsOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machines = VirtualMachinesOperations( + self.hcx_enterprise_sites = HcxEnterpriseSitesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.placement_policies = PlacementPoliciesOperations( + self.iscsi_paths = IscsiPathsOperations(self._client, self._config, self._serialize, self._deserialize) + self.script_executions = ScriptExecutionsOperations( self._client, self._config, self._serialize, self._deserialize ) self.script_packages = ScriptPackagesOperations(self._client, self._config, self._serialize, self._deserialize) self.script_cmdlets = ScriptCmdletsOperations(self._client, self._config, self._serialize, self._deserialize) - self.script_executions = ScriptExecutionsOperations( + self.workload_networks = WorkloadNetworksOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py index 465a98be5c5c..8879d85cf1d1 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/_configuration.py @@ -29,14 +29,14 @@ class AVSClientConfiguration(Configuration): # pylint: disable=too-many-instanc :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-03-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(AVSClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-03-01") + api_version: str = kwargs.pop("api_version", "2023-09-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/__init__.py index 7aa1e85f55b7..e6a84c5d03a3 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/__init__.py @@ -9,19 +9,20 @@ from ._operations import Operations from ._locations_operations import LocationsOperations from ._private_clouds_operations import PrivateCloudsOperations -from ._clusters_operations import ClustersOperations -from ._datastores_operations import DatastoresOperations -from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations +from ._addons_operations import AddonsOperations from ._authorizations_operations import AuthorizationsOperations -from ._global_reach_connections_operations import GlobalReachConnectionsOperations -from ._workload_networks_operations import WorkloadNetworksOperations from ._cloud_links_operations import CloudLinksOperations -from ._addons_operations import AddonsOperations -from ._virtual_machines_operations import VirtualMachinesOperations +from ._clusters_operations import ClustersOperations +from ._datastores_operations import DatastoresOperations from ._placement_policies_operations import PlacementPoliciesOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._global_reach_connections_operations import GlobalReachConnectionsOperations +from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations +from ._iscsi_paths_operations import IscsiPathsOperations +from ._script_executions_operations import ScriptExecutionsOperations from ._script_packages_operations import ScriptPackagesOperations from ._script_cmdlets_operations import ScriptCmdletsOperations -from ._script_executions_operations import ScriptExecutionsOperations +from ._workload_networks_operations import WorkloadNetworksOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -31,19 +32,20 @@ "Operations", "LocationsOperations", "PrivateCloudsOperations", - "ClustersOperations", - "DatastoresOperations", - "HcxEnterpriseSitesOperations", + "AddonsOperations", "AuthorizationsOperations", - "GlobalReachConnectionsOperations", - "WorkloadNetworksOperations", "CloudLinksOperations", - "AddonsOperations", - "VirtualMachinesOperations", + "ClustersOperations", + "DatastoresOperations", "PlacementPoliciesOperations", + "VirtualMachinesOperations", + "GlobalReachConnectionsOperations", + "HcxEnterpriseSitesOperations", + "IscsiPathsOperations", + "ScriptExecutionsOperations", "ScriptPackagesOperations", "ScriptCmdletsOperations", - "ScriptExecutionsOperations", + "WorkloadNetworksOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py index 556c4a345a31..d66dcaf548e6 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_addons_operations.py @@ -63,9 +63,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> AsyncIterable["_models.Addon"]: - """List addons in a private cloud. - - List addons in a private cloud. + """List Addon resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -81,7 +79,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AddonList] = kwargs.pop("cls", None) + cls: ClsType[_models.AddonListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -125,7 +123,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AddonList", pipeline_response) + deserialized = self._deserialize("AddonListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -157,16 +155,14 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, private_cloud_name: str, addon_name: str, **kwargs: Any ) -> _models.Addon: - """Get an addon by name in a private cloud. - - Get an addon by name in a private cloud. + """Get a Addon. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param addon_name: Name of the addon for the private cloud. Required. + :param addon_name: Name of the addon. Required. :type addon_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Addon or the result of cls(response) @@ -282,14 +278,17 @@ async def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Addon", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("Addon", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -308,18 +307,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Addon]: - """Create or update a addon in a private cloud. - - Create or update a addon in a private cloud. + """Create a Addon. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param addon_name: Name of the addon for the private cloud. Required. + :param addon_name: Name of the addon. Required. :type addon_name: str - :param addon: A addon in the private cloud. Required. + :param addon: Resource create parameters. Required. :type addon: ~azure.mgmt.avs.models.Addon :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -348,18 +345,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Addon]: - """Create or update a addon in a private cloud. - - Create or update a addon in a private cloud. + """Create a Addon. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param addon_name: Name of the addon for the private cloud. Required. + :param addon_name: Name of the addon. Required. :type addon_name: str - :param addon: A addon in the private cloud. Required. + :param addon: Resource create parameters. Required. :type addon: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -386,18 +381,16 @@ async def begin_create_or_update( addon: Union[_models.Addon, IO], **kwargs: Any ) -> AsyncLROPoller[_models.Addon]: - """Create or update a addon in a private cloud. - - Create or update a addon in a private cloud. + """Create a Addon. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param addon_name: Name of the addon for the private cloud. Required. + :param addon_name: Name of the addon. Required. :type addon_name: str - :param addon: A addon in the private cloud. Is either a Addon type or a IO type. Required. + :param addon: Resource create parameters. Is either a Addon type or a IO type. Required. :type addon: ~azure.mgmt.avs.models.Addon or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -445,7 +438,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -505,8 +501,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}" @@ -516,16 +517,14 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements async def begin_delete( self, resource_group_name: str, private_cloud_name: str, addon_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a addon in a private cloud. - - Delete a addon in a private cloud. + """Delete a Addon. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param addon_name: Name of the addon for the private cloud. Required. + :param addon_name: Name of the addon. Required. :type addon_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. @@ -565,7 +564,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py index 6c49f83e664f..c131b59260d3 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_authorizations_operations.py @@ -65,9 +65,7 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.ExpressRouteAuthorization"]: - """List ExpressRoute Circuit Authorizations in a private cloud. - - List ExpressRoute Circuit Authorizations in a private cloud. + """List ExpressRouteAuthorization resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -85,7 +83,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExpressRouteAuthorizationList] = kwargs.pop("cls", None) + cls: ClsType[_models.ExpressRouteAuthorizationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -129,7 +127,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ExpressRouteAuthorizationList", pipeline_response) + deserialized = self._deserialize("ExpressRouteAuthorizationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -161,17 +159,14 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, private_cloud_name: str, authorization_name: str, **kwargs: Any ) -> _models.ExpressRouteAuthorization: - """Get an ExpressRoute Circuit Authorization by name in a private cloud. - - Get an ExpressRoute Circuit Authorization by name in a private cloud. + """Get a ExpressRouteAuthorization. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. - Required. + :param authorization_name: Name of the ExpressRoute Circuit Authorization. Required. :type authorization_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ExpressRouteAuthorization or the result of cls(response) @@ -287,14 +282,17 @@ async def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("ExpressRouteAuthorization", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("ExpressRouteAuthorization", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -313,19 +311,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ExpressRouteAuthorization]: - """Create or update an ExpressRoute Circuit Authorization in a private cloud. - - Create or update an ExpressRoute Circuit Authorization in a private cloud. + """Create a ExpressRouteAuthorization. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. - Required. + :param authorization_name: Name of the ExpressRoute Circuit Authorization. Required. :type authorization_name: str - :param authorization: An ExpressRoute Circuit Authorization. Required. + :param authorization: Resource create parameters. Required. :type authorization: ~azure.mgmt.avs.models.ExpressRouteAuthorization :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -355,19 +350,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ExpressRouteAuthorization]: - """Create or update an ExpressRoute Circuit Authorization in a private cloud. - - Create or update an ExpressRoute Circuit Authorization in a private cloud. + """Create a ExpressRouteAuthorization. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. - Required. + :param authorization_name: Name of the ExpressRoute Circuit Authorization. Required. :type authorization_name: str - :param authorization: An ExpressRoute Circuit Authorization. Required. + :param authorization: Resource create parameters. Required. :type authorization: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -395,20 +387,17 @@ async def begin_create_or_update( authorization: Union[_models.ExpressRouteAuthorization, IO], **kwargs: Any ) -> AsyncLROPoller[_models.ExpressRouteAuthorization]: - """Create or update an ExpressRoute Circuit Authorization in a private cloud. - - Create or update an ExpressRoute Circuit Authorization in a private cloud. + """Create a ExpressRouteAuthorization. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. - Required. + :param authorization_name: Name of the ExpressRoute Circuit Authorization. Required. :type authorization_name: str - :param authorization: An ExpressRoute Circuit Authorization. Is either a - ExpressRouteAuthorization type or a IO type. Required. + :param authorization: Resource create parameters. Is either a ExpressRouteAuthorization type or + a IO type. Required. :type authorization: ~azure.mgmt.avs.models.ExpressRouteAuthorization or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -457,7 +446,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -517,8 +509,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" @@ -528,17 +525,14 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements async def begin_delete( self, resource_group_name: str, private_cloud_name: str, authorization_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete an ExpressRoute Circuit Authorization in a private cloud. - - Delete an ExpressRoute Circuit Authorization in a private cloud. + """Delete a ExpressRouteAuthorization. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. - Required. + :param authorization_name: Name of the ExpressRoute Circuit Authorization. Required. :type authorization_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. @@ -578,7 +572,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py index ae37f5323999..597e87ae7e52 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_cloud_links_operations.py @@ -65,9 +65,7 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.CloudLink"]: - """List cloud link in a private cloud. - - List cloud link in a private cloud. + """List CloudLink resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -83,7 +81,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudLinkList] = kwargs.pop("cls", None) + cls: ClsType[_models.CloudLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -127,7 +125,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CloudLinkList", pipeline_response) + deserialized = self._deserialize("CloudLinkListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -159,16 +157,14 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, private_cloud_name: str, cloud_link_name: str, **kwargs: Any ) -> _models.CloudLink: - """Get an cloud link by name in a private cloud. - - Get an cloud link by name in a private cloud. + """Get a CloudLink. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cloud_link_name: Name of the cloud link resource. Required. + :param cloud_link_name: Name of the cloud link. Required. :type cloud_link_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CloudLink or the result of cls(response) @@ -284,14 +280,17 @@ async def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("CloudLink", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("CloudLink", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -310,18 +309,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CloudLink]: - """Create or update a cloud link in a private cloud. - - Create or update a cloud link in a private cloud. + """Create a CloudLink. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cloud_link_name: Name of the cloud link resource. Required. + :param cloud_link_name: Name of the cloud link. Required. :type cloud_link_name: str - :param cloud_link: A cloud link in the private cloud. Required. + :param cloud_link: Resource create parameters. Required. :type cloud_link: ~azure.mgmt.avs.models.CloudLink :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -351,18 +348,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CloudLink]: - """Create or update a cloud link in a private cloud. - - Create or update a cloud link in a private cloud. + """Create a CloudLink. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cloud_link_name: Name of the cloud link resource. Required. + :param cloud_link_name: Name of the cloud link. Required. :type cloud_link_name: str - :param cloud_link: A cloud link in the private cloud. Required. + :param cloud_link: Resource create parameters. Required. :type cloud_link: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -390,18 +385,16 @@ async def begin_create_or_update( cloud_link: Union[_models.CloudLink, IO], **kwargs: Any ) -> AsyncLROPoller[_models.CloudLink]: - """Create or update a cloud link in a private cloud. - - Create or update a cloud link in a private cloud. + """Create a CloudLink. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cloud_link_name: Name of the cloud link resource. Required. + :param cloud_link_name: Name of the cloud link. Required. :type cloud_link_name: str - :param cloud_link: A cloud link in the private cloud. Is either a CloudLink type or a IO type. + :param cloud_link: Resource create parameters. Is either a CloudLink type or a IO type. Required. :type cloud_link: ~azure.mgmt.avs.models.CloudLink or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -451,7 +444,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -511,8 +507,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" @@ -522,16 +523,14 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements async def begin_delete( self, resource_group_name: str, private_cloud_name: str, cloud_link_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a cloud link in a private cloud. - - Delete a cloud link in a private cloud. + """Delete a CloudLink. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cloud_link_name: Name of the cloud link resource. Required. + :param cloud_link_name: Name of the cloud link. Required. :type cloud_link_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. @@ -571,7 +570,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py index 28cdd40a4fac..c72c153db933 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_clusters_operations.py @@ -67,9 +67,7 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.Cluster"]: - """List clusters in a private cloud. - - List clusters in a private cloud. + """List Cluster resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -85,7 +83,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) + cls: ClsType[_models.ClusterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -129,7 +127,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterList", pipeline_response) + deserialized = self._deserialize("ClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -161,16 +159,14 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> _models.Cluster: - """Get a cluster by name in a private cloud. - - Get a cluster by name in a private cloud. + """Get a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Cluster or the result of cls(response) @@ -286,14 +282,17 @@ async def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Cluster", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("Cluster", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -312,18 +311,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Cluster]: - """Create or update a cluster in a private cloud. - - Create or update a cluster in a private cloud. + """Create a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster: A cluster in the private cloud. Required. + :param cluster: Resource create parameters. Required. :type cluster: ~azure.mgmt.avs.models.Cluster :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -353,18 +350,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Cluster]: - """Create or update a cluster in a private cloud. - - Create or update a cluster in a private cloud. + """Create a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster: A cluster in the private cloud. Required. + :param cluster: Resource create parameters. Required. :type cluster: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -392,19 +387,16 @@ async def begin_create_or_update( cluster: Union[_models.Cluster, IO], **kwargs: Any ) -> AsyncLROPoller[_models.Cluster]: - """Create or update a cluster in a private cloud. - - Create or update a cluster in a private cloud. + """Create a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster: A cluster in the private cloud. Is either a Cluster type or a IO type. - Required. + :param cluster: Resource create parameters. Is either a Cluster type or a IO type. Required. :type cluster: ~azure.mgmt.avs.models.Cluster or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -453,7 +445,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -530,14 +525,18 @@ async def _update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Cluster", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = self._deserialize("Cluster", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -556,16 +555,14 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Cluster]: - """Update a cluster in a private cloud. - - Update a cluster in a private cloud. + """Update a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :param cluster_update: The cluster properties to be updated. Required. :type cluster_update: ~azure.mgmt.avs.models.ClusterUpdate @@ -597,16 +594,14 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Cluster]: - """Update a cluster in a private cloud. - - Update a cluster in a private cloud. + """Update a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :param cluster_update: The cluster properties to be updated. Required. :type cluster_update: IO @@ -636,16 +631,14 @@ async def begin_update( cluster_update: Union[_models.ClusterUpdate, IO], **kwargs: Any ) -> AsyncLROPoller[_models.Cluster]: - """Update a cluster in a private cloud. - - Update a cluster in a private cloud. + """Update a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :param cluster_update: The cluster properties to be updated. Is either a ClusterUpdate type or a IO type. Required. @@ -697,7 +690,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -757,8 +752,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" @@ -768,16 +768,14 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements async def begin_delete( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a cluster in a private cloud. - - Delete a cluster in a private cloud. + """Delete a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_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. @@ -817,7 +815,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -841,14 +841,12 @@ async def list_zones( ) -> _models.ClusterZoneList: """List hosts by zone in a cluster. - List hosts by zone in a cluster. - :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ClusterZoneList or the result of cls(response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py index 1390fac19a75..f73a7452d271 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_datastores_operations.py @@ -65,16 +65,14 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> AsyncIterable["_models.Datastore"]: - """List datastores in a private cloud cluster. - - List datastores in a private cloud cluster. + """List Datastore resources by Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Datastore or the result of cls(response) @@ -85,7 +83,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatastoreList] = kwargs.pop("cls", None) + cls: ClsType[_models.DatastoreListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -130,7 +128,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreList", pipeline_response) + deserialized = self._deserialize("DatastoreListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -162,18 +160,16 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, datastore_name: str, **kwargs: Any ) -> _models.Datastore: - """Get a datastore in a private cloud cluster. - - Get a datastore in a private cloud cluster. + """Get a Datastore. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param datastore_name: Name of the datastore in the private cloud cluster. Required. + :param datastore_name: Name of the datastore. Required. :type datastore_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Datastore or the result of cls(response) @@ -292,14 +288,17 @@ async def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -319,20 +318,18 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Datastore]: - """Create or update a datastore in a private cloud cluster. - - Create or update a datastore in a private cloud cluster. + """Create a Datastore. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param datastore_name: Name of the datastore in the private cloud cluster. Required. + :param datastore_name: Name of the datastore. Required. :type datastore_name: str - :param datastore: A datastore in a private cloud cluster. Required. + :param datastore: Resource create parameters. Required. :type datastore: ~azure.mgmt.avs.models.Datastore :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -363,20 +360,18 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Datastore]: - """Create or update a datastore in a private cloud cluster. - - Create or update a datastore in a private cloud cluster. + """Create a Datastore. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param datastore_name: Name of the datastore in the private cloud cluster. Required. + :param datastore_name: Name of the datastore. Required. :type datastore_name: str - :param datastore: A datastore in a private cloud cluster. Required. + :param datastore: Resource create parameters. Required. :type datastore: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -405,21 +400,19 @@ async def begin_create_or_update( datastore: Union[_models.Datastore, IO], **kwargs: Any ) -> AsyncLROPoller[_models.Datastore]: - """Create or update a datastore in a private cloud cluster. - - Create or update a datastore in a private cloud cluster. + """Create a Datastore. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param datastore_name: Name of the datastore in the private cloud cluster. Required. + :param datastore_name: Name of the datastore. Required. :type datastore_name: str - :param datastore: A datastore in a private cloud cluster. Is either a Datastore type or a IO - type. Required. + :param datastore: Resource create parameters. Is either a Datastore type or a IO type. + Required. :type datastore: ~azure.mgmt.avs.models.Datastore or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -469,7 +462,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -530,8 +526,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" @@ -541,18 +542,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements async def begin_delete( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, datastore_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a datastore in a private cloud cluster. - - Delete a datastore in a private cloud cluster. + """Delete a Datastore. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param datastore_name: Name of the datastore in the private cloud cluster. Required. + :param datastore_name: Name of the datastore. Required. :type datastore_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. @@ -593,7 +592,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py index 67f28bdf28ba..c387f2333a60 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_global_reach_connections_operations.py @@ -65,9 +65,7 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.GlobalReachConnection"]: - """List global reach connections in a private cloud. - - List global reach connections in a private cloud. + """List GlobalReachConnection resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -84,7 +82,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GlobalReachConnectionList] = kwargs.pop("cls", None) + cls: ClsType[_models.GlobalReachConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -128,7 +126,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("GlobalReachConnectionList", pipeline_response) + deserialized = self._deserialize("GlobalReachConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -160,17 +158,14 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, private_cloud_name: str, global_reach_connection_name: str, **kwargs: Any ) -> _models.GlobalReachConnection: - """Get a global reach connection by name in a private cloud. - - Get a global reach connection by name in a private cloud. + """Get a GlobalReachConnection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param global_reach_connection_name: Name of the global reach connection in the private cloud. - Required. + :param global_reach_connection_name: Name of the global reach connection. Required. :type global_reach_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GlobalReachConnection or the result of cls(response) @@ -286,14 +281,17 @@ async def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("GlobalReachConnection", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("GlobalReachConnection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -312,19 +310,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.GlobalReachConnection]: - """Create or update a global reach connection in a private cloud. - - Create or update a global reach connection in a private cloud. + """Create a GlobalReachConnection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param global_reach_connection_name: Name of the global reach connection in the private cloud. - Required. + :param global_reach_connection_name: Name of the global reach connection. Required. :type global_reach_connection_name: str - :param global_reach_connection: A global reach connection in the private cloud. Required. + :param global_reach_connection: Resource create parameters. Required. :type global_reach_connection: ~azure.mgmt.avs.models.GlobalReachConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -354,19 +349,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.GlobalReachConnection]: - """Create or update a global reach connection in a private cloud. - - Create or update a global reach connection in a private cloud. + """Create a GlobalReachConnection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param global_reach_connection_name: Name of the global reach connection in the private cloud. - Required. + :param global_reach_connection_name: Name of the global reach connection. Required. :type global_reach_connection_name: str - :param global_reach_connection: A global reach connection in the private cloud. Required. + :param global_reach_connection: Resource create parameters. Required. :type global_reach_connection: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -394,20 +386,17 @@ async def begin_create_or_update( global_reach_connection: Union[_models.GlobalReachConnection, IO], **kwargs: Any ) -> AsyncLROPoller[_models.GlobalReachConnection]: - """Create or update a global reach connection in a private cloud. - - Create or update a global reach connection in a private cloud. + """Create a GlobalReachConnection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param global_reach_connection_name: Name of the global reach connection in the private cloud. - Required. + :param global_reach_connection_name: Name of the global reach connection. Required. :type global_reach_connection_name: str - :param global_reach_connection: A global reach connection in the private cloud. Is either a - GlobalReachConnection type or a IO type. Required. + :param global_reach_connection: Resource create parameters. Is either a GlobalReachConnection + type or a IO type. Required. :type global_reach_connection: ~azure.mgmt.avs.models.GlobalReachConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -456,7 +445,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -516,8 +508,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" @@ -527,17 +524,14 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements async def begin_delete( self, resource_group_name: str, private_cloud_name: str, global_reach_connection_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a global reach connection in a private cloud. - - Delete a global reach connection in a private cloud. + """Delete a GlobalReachConnection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param global_reach_connection_name: Name of the global reach connection in the private cloud. - Required. + :param global_reach_connection_name: Name of the global reach connection. Required. :type global_reach_connection_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. @@ -577,7 +571,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py index bc50ec7a61ee..a76a448df369 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_hcx_enterprise_sites_operations.py @@ -63,9 +63,7 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.HcxEnterpriseSite"]: - """List HCX on-premises key in a private cloud. - - List HCX on-premises key in a private cloud. + """List HcxEnterpriseSite resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -81,7 +79,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.HcxEnterpriseSiteList] = kwargs.pop("cls", None) + cls: ClsType[_models.HcxEnterpriseSiteListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -125,7 +123,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("HcxEnterpriseSiteList", pipeline_response) + deserialized = self._deserialize("HcxEnterpriseSiteListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -157,17 +155,14 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, private_cloud_name: str, hcx_enterprise_site_name: str, **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Get an HCX on-premises key by name in a private cloud. - - Get an HCX on-premises key by name in a private cloud. + """Get a HcxEnterpriseSite. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. - Required. + :param hcx_enterprise_site_name: Name of the HCX Enterprise Site. Required. :type hcx_enterprise_site_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: HcxEnterpriseSite or the result of cls(response) @@ -235,19 +230,16 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an activation key for on-premises HCX site. - - Create or update an activation key for on-premises HCX site. + """Create a HcxEnterpriseSite. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. - Required. + :param hcx_enterprise_site_name: Name of the HCX Enterprise Site. Required. :type hcx_enterprise_site_name: str - :param hcx_enterprise_site: The HCX Enterprise Site. Required. + :param hcx_enterprise_site: Resource create parameters. Required. :type hcx_enterprise_site: ~azure.mgmt.avs.models.HcxEnterpriseSite :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -269,19 +261,16 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an activation key for on-premises HCX site. - - Create or update an activation key for on-premises HCX site. + """Create a HcxEnterpriseSite. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. - Required. + :param hcx_enterprise_site_name: Name of the HCX Enterprise Site. Required. :type hcx_enterprise_site_name: str - :param hcx_enterprise_site: The HCX Enterprise Site. Required. + :param hcx_enterprise_site: Resource create parameters. Required. :type hcx_enterprise_site: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -301,20 +290,17 @@ async def create_or_update( hcx_enterprise_site: Union[_models.HcxEnterpriseSite, IO], **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an activation key for on-premises HCX site. - - Create or update an activation key for on-premises HCX site. + """Create a HcxEnterpriseSite. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. - Required. + :param hcx_enterprise_site_name: Name of the HCX Enterprise Site. Required. :type hcx_enterprise_site_name: str - :param hcx_enterprise_site: The HCX Enterprise Site. Is either a HcxEnterpriseSite type or a IO - type. Required. + :param hcx_enterprise_site: Resource create parameters. Is either a HcxEnterpriseSite type or a + IO type. Required. :type hcx_enterprise_site: ~azure.mgmt.avs.models.HcxEnterpriseSite or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -394,17 +380,14 @@ async def create_or_update( async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, private_cloud_name: str, hcx_enterprise_site_name: str, **kwargs: Any ) -> None: - """Delete HCX on-premises key in a private cloud. - - Delete HCX on-premises key in a private cloud. + """Delete a HcxEnterpriseSite. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. - Required. + :param hcx_enterprise_site_name: Name of the HCX Enterprise Site. Required. :type hcx_enterprise_site_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_iscsi_paths_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_iscsi_paths_operations.py new file mode 100644 index 000000000000..f85172c2dd64 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_iscsi_paths_operations.py @@ -0,0 +1,561 @@ +# pylint: disable=too-many-lines +# 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 io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._iscsi_paths_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_private_cloud_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class IscsiPathsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.avs.aio.AVSClient`'s + :attr:`iscsi_paths` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_private_cloud( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> AsyncIterable["_models.IscsiPath"]: + """List IscsiPath resources by PrivateCloud. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IscsiPath or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.IscsiPath] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.IscsiPathListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_private_cloud_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_private_cloud.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("IscsiPathListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_by_private_cloud.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths" + } + + @distributed_trace_async + async def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> _models.IscsiPath: + """Get a IscsiPath. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IscsiPath or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.IscsiPath + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.IscsiPath] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IscsiPath", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + } + + async def _create_or_update_initial( + self, resource_group_name: str, private_cloud_name: str, resource: Union[_models.IscsiPath, IO], **kwargs: Any + ) -> _models.IscsiPath: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IscsiPath] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "IscsiPath") + + request = build_create_or_update_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_or_update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("IscsiPath", pipeline_response) + + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("IscsiPath", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + } + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + resource: _models.IscsiPath, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IscsiPath]: + """Create a IscsiPath. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.avs.models.IscsiPath + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: 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: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IscsiPath or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.IscsiPath] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IscsiPath]: + """Create a IscsiPath. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param resource: Resource create parameters. Required. + :type resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: 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: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IscsiPath or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.IscsiPath] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, resource_group_name: str, private_cloud_name: str, resource: Union[_models.IscsiPath, IO], **kwargs: Any + ) -> AsyncLROPoller[_models.IscsiPath]: + """Create a IscsiPath. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param resource: Resource create parameters. Is either a IscsiPath type or a IO type. Required. + :type resource: ~azure.mgmt.avs.models.IscsiPath or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IscsiPath or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.IscsiPath] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IscsiPath] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IscsiPath", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + } + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + } + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a IscsiPath. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_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: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + } diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py index 6e2b77657110..42297ce40b44 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_locations_operations.py @@ -54,15 +54,74 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace_async + async def check_quota_availability(self, location: str, **kwargs: Any) -> _models.Quota: + """Return quota for subscription by region. + + :param location: A location in a subscription. Required. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Quota or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.Quota + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Quota] = kwargs.pop("cls", None) + + request = build_check_quota_availability_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.check_quota_availability.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Quota", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + check_quota_availability.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability" + } + @overload async def check_trial_availability( self, location: str, sku: Optional[_models.Sku] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Trial: """Return trial status for subscription by region. - :param location: Azure region. Required. + :param location: A location in a subscription. Required. :type location: str - :param sku: The sku to check for trial availability. Default value is None. + :param sku: Optionally, check for a specific SKU. Default value is None. :type sku: ~azure.mgmt.avs.models.Sku :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -79,9 +138,9 @@ async def check_trial_availability( ) -> _models.Trial: """Return trial status for subscription by region. - :param location: Azure region. Required. + :param location: A location in a subscription. Required. :type location: str - :param sku: The sku to check for trial availability. Default value is None. + :param sku: Optionally, check for a specific SKU. Default value is None. :type sku: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -98,9 +157,9 @@ async def check_trial_availability( ) -> _models.Trial: """Return trial status for subscription by region. - :param location: Azure region. Required. + :param location: A location in a subscription. Required. :type location: str - :param sku: The sku to check for trial availability. Is either a Sku type or a IO type. Default + :param sku: Optionally, check for a specific SKU. Is either a Sku type or a IO type. Default value is None. :type sku: ~azure.mgmt.avs.models.Sku or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -173,62 +232,3 @@ async def check_trial_availability( check_trial_availability.metadata = { "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability" } - - @distributed_trace_async - async def check_quota_availability(self, location: str, **kwargs: Any) -> _models.Quota: - """Return quota for subscription by region. - - :param location: Azure region. Required. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Quota or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.Quota - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Quota] = kwargs.pop("cls", None) - - request = build_check_quota_availability_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.check_quota_availability.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Quota", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - check_quota_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability" - } diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py index 207d97cab96d..10e402736bfc 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_operations.py @@ -54,7 +54,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """Lists all of the available operations. + """List the operations for the provider. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Operation or the result of cls(response) @@ -65,7 +65,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -106,7 +106,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py index 6dbe790d4d55..2f964b2f9857 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py @@ -66,16 +66,14 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> AsyncIterable["_models.PlacementPolicy"]: - """List placement policies in a private cloud cluster. - - List placement policies in a private cloud cluster. + """List PlacementPolicy resources by Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PlacementPolicy or the result of cls(response) @@ -86,7 +84,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PlacementPoliciesList] = kwargs.pop("cls", None) + cls: ClsType[_models.PlacementPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -131,7 +129,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PlacementPoliciesList", pipeline_response) + deserialized = self._deserialize("PlacementPolicyListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -168,19 +166,16 @@ async def get( placement_policy_name: str, **kwargs: Any ) -> _models.PlacementPolicy: - """Get a placement policy by name in a private cloud cluster. - - Get a placement policy by name in a private cloud cluster. + """Get a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PlacementPolicy or the result of cls(response) @@ -299,14 +294,17 @@ async def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("PlacementPolicy", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("PlacementPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -326,21 +324,18 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.PlacementPolicy]: - """Create or update a placement policy in a private cloud cluster. - - Create or update a placement policy in a private cloud cluster. + """Create a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy: A placement policy in the private cloud cluster. Required. + :param placement_policy: Resource create parameters. Required. :type placement_policy: ~azure.mgmt.avs.models.PlacementPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -371,21 +366,18 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.PlacementPolicy]: - """Create or update a placement policy in a private cloud cluster. - - Create or update a placement policy in a private cloud cluster. + """Create a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy: A placement policy in the private cloud cluster. Required. + :param placement_policy: Resource create parameters. Required. :type placement_policy: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -414,22 +406,19 @@ async def begin_create_or_update( placement_policy: Union[_models.PlacementPolicy, IO], **kwargs: Any ) -> AsyncLROPoller[_models.PlacementPolicy]: - """Create or update a placement policy in a private cloud cluster. - - Create or update a placement policy in a private cloud cluster. + """Create a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy: A placement policy in the private cloud cluster. Is either a - PlacementPolicy type or a IO type. Required. + :param placement_policy: Resource create parameters. Is either a PlacementPolicy type or a IO + type. Required. :type placement_policy: ~azure.mgmt.avs.models.PlacementPolicy or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -479,7 +468,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -558,14 +550,18 @@ async def _update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("PlacementPolicy", pipeline_response) if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = self._deserialize("PlacementPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -585,21 +581,18 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.PlacementPolicy]: - """Update a placement policy in a private cloud cluster. - - Update a placement policy in a private cloud cluster. + """Update a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties that may be updated. Required. + :param placement_policy_update: The placement policy properties to be updated. Required. :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -630,21 +623,18 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.PlacementPolicy]: - """Update a placement policy in a private cloud cluster. - - Update a placement policy in a private cloud cluster. + """Update a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties that may be updated. Required. + :param placement_policy_update: The placement policy properties to be updated. Required. :type placement_policy_update: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -673,22 +663,19 @@ async def begin_update( placement_policy_update: Union[_models.PlacementPolicyUpdate, IO], **kwargs: Any ) -> AsyncLROPoller[_models.PlacementPolicy]: - """Update a placement policy in a private cloud cluster. - - Update a placement policy in a private cloud cluster. + """Update a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties that may be updated. Is either - a PlacementPolicyUpdate type or a IO type. Required. + :param placement_policy_update: The placement policy properties to be updated. Is either a + PlacementPolicyUpdate type or a IO type. Required. :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -738,7 +725,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -804,8 +793,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" @@ -820,19 +814,16 @@ async def begin_delete( placement_policy_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a placement policy in a private cloud cluster. - - Delete a placement policy in a private cloud cluster. + """Delete a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_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. @@ -873,7 +864,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py index 9c62783ef501..de992077a3c5 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_private_clouds_operations.py @@ -67,14 +67,9 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.PrivateCloud"]: - """List private clouds in a resource group. - - List private clouds in a resource group. + def list_in_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateCloud"]: + """List PrivateCloud resources by subscription ID. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :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 PrivateCloud or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.PrivateCloud] @@ -84,7 +79,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) + cls: ClsType[_models.PrivateCloudListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -97,11 +92,10 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( - resource_group_name=resource_group_name, + request = build_list_in_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], + template_url=self.list_in_subscription.metadata["url"], headers=_headers, params=_params, ) @@ -127,7 +121,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateCloudList", pipeline_response) + deserialized = self._deserialize("PrivateCloudListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -151,16 +145,15 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" - } + list_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds"} @distributed_trace - def list_in_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateCloud"]: - """List private clouds in a subscription. - - List private clouds in a subscription. + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.PrivateCloud"]: + """List PrivateCloud resources by resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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 PrivateCloud or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.PrivateCloud] @@ -170,7 +163,7 @@ def list_in_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateC _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) + cls: ClsType[_models.PrivateCloudListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -183,10 +176,11 @@ def list_in_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PrivateC def prepare_request(next_link=None): if not next_link: - request = build_list_in_subscription_request( + request = build_list_request( + resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_in_subscription.metadata["url"], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -212,7 +206,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateCloudList", pipeline_response) + deserialized = self._deserialize("PrivateCloudListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -236,13 +230,13 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds"} + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + } @distributed_trace_async async def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> _models.PrivateCloud: - """Get a private cloud. - - Get a private cloud. + """Get a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -360,14 +354,17 @@ async def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("PrivateCloud", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("PrivateCloud", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -385,16 +382,14 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.PrivateCloud]: - """Create or update a private cloud. - - Create or update a private cloud. + """Create a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud: The private cloud. Required. + :param private_cloud: Resource create parameters. Required. :type private_cloud: ~azure.mgmt.avs.models.PrivateCloud :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -423,16 +418,14 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.PrivateCloud]: - """Create or update a private cloud. - - Create or update a private cloud. + """Create a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud: The private cloud. Required. + :param private_cloud: Resource create parameters. Required. :type private_cloud: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -459,16 +452,15 @@ async def begin_create_or_update( private_cloud: Union[_models.PrivateCloud, IO], **kwargs: Any ) -> AsyncLROPoller[_models.PrivateCloud]: - """Create or update a private cloud. - - Create or update a private cloud. + """Create a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud: The private cloud. Is either a PrivateCloud type or a IO type. Required. + :param private_cloud: Resource create parameters. Is either a PrivateCloud type or a IO type. + Required. :type private_cloud: ~azure.mgmt.avs.models.PrivateCloud or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -516,7 +508,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -591,14 +586,18 @@ async def _update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("PrivateCloud", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = self._deserialize("PrivateCloud", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -616,9 +615,7 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.PrivateCloud]: - """Update a private cloud. - - Update a private cloud. + """Update a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -654,9 +651,7 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.PrivateCloud]: - """Update a private cloud. - - Update a private cloud. + """Update a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -690,9 +685,7 @@ async def begin_update( private_cloud_update: Union[_models.PrivateCloudUpdate, IO], **kwargs: Any ) -> AsyncLROPoller[_models.PrivateCloud]: - """Update a private cloud. - - Update a private cloud. + """Update a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -748,7 +741,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -807,8 +802,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}" @@ -818,9 +818,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements async def begin_delete( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a private cloud. - - Delete a private cloud. + """Delete a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -864,7 +862,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -882,7 +882,72 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}" } - async def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-return-statements + @distributed_trace_async + async def list_admin_credentials( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> _models.AdminCredentials: + """List the admin credentials for the private cloud. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AdminCredentials or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.AdminCredentials + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AdminCredentials] = kwargs.pop("cls", None) + + request = build_list_admin_credentials_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_admin_credentials.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AdminCredentials", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_admin_credentials.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials" + } + + async def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { @@ -899,12 +964,12 @@ async def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-retu api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_rotate_vcenter_password_request( + request = build_rotate_nsxt_password_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._rotate_vcenter_password_initial.metadata["url"], + template_url=self._rotate_nsxt_password_initial.metadata["url"], headers=_headers, params=_params, ) @@ -923,20 +988,23 @@ async def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-retu error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _rotate_vcenter_password_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword" + _rotate_nsxt_password_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword" } @distributed_trace_async - async def begin_rotate_vcenter_password( + async def begin_rotate_nsxt_password( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Rotate the vCenter password. - - Rotate the vCenter password. + """Rotate the NSX-T Manager password. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -964,7 +1032,7 @@ async def begin_rotate_vcenter_password( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._rotate_vcenter_password_initial( # type: ignore + raw_result = await self._rotate_nsxt_password_initial( # type: ignore resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, api_version=api_version, @@ -980,7 +1048,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -994,11 +1064,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_rotate_vcenter_password.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword" + begin_rotate_nsxt_password.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword" } - async def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return-statements + async def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { @@ -1015,12 +1085,12 @@ async def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_rotate_nsxt_password_request( + request = build_rotate_vcenter_password_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._rotate_nsxt_password_initial.metadata["url"], + template_url=self._rotate_vcenter_password_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1039,20 +1109,23 @@ async def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return- error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _rotate_nsxt_password_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword" + _rotate_vcenter_password_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword" } @distributed_trace_async - async def begin_rotate_nsxt_password( + async def begin_rotate_vcenter_password( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Rotate the NSX-T Manager password. - - Rotate the NSX-T Manager password. + """Rotate the vCenter password. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1080,7 +1153,7 @@ async def begin_rotate_nsxt_password( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._rotate_nsxt_password_initial( # type: ignore + raw_result = await self._rotate_vcenter_password_initial( # type: ignore resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, api_version=api_version, @@ -1096,7 +1169,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1110,73 +1185,6 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_rotate_nsxt_password.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword" - } - - @distributed_trace_async - async def list_admin_credentials( - self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> _models.AdminCredentials: - """List the admin credentials for the private cloud. - - List the admin credentials for the private cloud. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AdminCredentials or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.AdminCredentials - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AdminCredentials] = kwargs.pop("cls", None) - - request = build_list_admin_credentials_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_admin_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AdminCredentials", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_admin_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials" + begin_rotate_vcenter_password.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword" } diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py index 6533bde34e3b..7c99752f414e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_cmdlets_operations.py @@ -57,15 +57,14 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, script_package_name: str, **kwargs: Any ) -> AsyncIterable["_models.ScriptCmdlet"]: - """List script cmdlet resources available for a private cloud to create a script execution - resource on a private cloud. + """List ScriptCmdlet resources by ScriptPackage. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_package_name: Name of the script package in the private cloud. Required. + :param script_package_name: Name of the script package. Required. :type script_package_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ScriptCmdlet or the result of cls(response) @@ -76,7 +75,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ScriptCmdletsList] = kwargs.pop("cls", None) + cls: ClsType[_models.ScriptCmdletListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -121,7 +120,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ScriptCmdletsList", pipeline_response) + deserialized = self._deserialize("ScriptCmdletListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -158,17 +157,16 @@ async def get( script_cmdlet_name: str, **kwargs: Any ) -> _models.ScriptCmdlet: - """Return information about a script cmdlet resource in a specific package on a private cloud. + """Get a ScriptCmdlet. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_package_name: Name of the script package in the private cloud. Required. + :param script_package_name: Name of the script package. Required. :type script_package_name: str - :param script_cmdlet_name: Name of the script cmdlet resource in the script package in the - private cloud. Required. + :param script_cmdlet_name: Name of the script cmdlet. Required. :type script_cmdlet_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ScriptCmdlet or the result of cls(response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py index be773d15b42c..43b777792407 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_executions_operations.py @@ -66,9 +66,7 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.ScriptExecution"]: - """List script executions in a private cloud. - - List script executions in a private cloud. + """List ScriptExecution resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -84,7 +82,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ScriptExecutionsList] = kwargs.pop("cls", None) + cls: ClsType[_models.ScriptExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -128,7 +126,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ScriptExecutionsList", pipeline_response) + deserialized = self._deserialize("ScriptExecutionListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -160,16 +158,14 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, private_cloud_name: str, script_execution_name: str, **kwargs: Any ) -> _models.ScriptExecution: - """Get an script execution by name in a private cloud. - - Get an script execution by name in a private cloud. + """Get a ScriptExecution. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ScriptExecution or the result of cls(response) @@ -285,14 +281,17 @@ async def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("ScriptExecution", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("ScriptExecution", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -311,18 +310,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ScriptExecution]: - """Create or update a script execution in a private cloud. - - Create or update a script execution in a private cloud. + """Create a ScriptExecution. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str - :param script_execution: A script running in the private cloud. Required. + :param script_execution: Resource create parameters. Required. :type script_execution: ~azure.mgmt.avs.models.ScriptExecution :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -352,18 +349,16 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ScriptExecution]: - """Create or update a script execution in a private cloud. - - Create or update a script execution in a private cloud. + """Create a ScriptExecution. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str - :param script_execution: A script running in the private cloud. Required. + :param script_execution: Resource create parameters. Required. :type script_execution: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -391,19 +386,17 @@ async def begin_create_or_update( script_execution: Union[_models.ScriptExecution, IO], **kwargs: Any ) -> AsyncLROPoller[_models.ScriptExecution]: - """Create or update a script execution in a private cloud. - - Create or update a script execution in a private cloud. + """Create a ScriptExecution. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str - :param script_execution: A script running in the private cloud. Is either a ScriptExecution - type or a IO type. Required. + :param script_execution: Resource create parameters. Is either a ScriptExecution type or a IO + type. Required. :type script_execution: ~azure.mgmt.avs.models.ScriptExecution or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -452,7 +445,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -512,8 +508,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}" @@ -523,16 +524,14 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements async def begin_delete( self, resource_group_name: str, private_cloud_name: str, script_execution_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Cancel a ScriptExecution in a private cloud. - - Cancel a ScriptExecution in a private cloud. + """Delete a ScriptExecution. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_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. @@ -572,7 +571,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -608,7 +609,7 @@ async def get_execution_logs( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str :param script_output_stream_type: Name of the desired output stream to return. If not provided, will return all. An empty array will return nothing. Default value is None. @@ -640,7 +641,7 @@ async def get_execution_logs( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str :param script_output_stream_type: Name of the desired output stream to return. If not provided, will return all. An empty array will return nothing. Default value is None. @@ -670,7 +671,7 @@ async def get_execution_logs( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str :param script_output_stream_type: Name of the desired output stream to return. If not provided, will return all. An empty array will return nothing. Is either a [Union[str, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py index 67114362b10d..de0164940c88 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_script_packages_operations.py @@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.ScriptPackage"]: - """List script packages available to run on the private cloud. + """List ScriptPackage resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -73,7 +73,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ScriptPackagesList] = kwargs.pop("cls", None) + cls: ClsType[_models.ScriptPackageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -117,7 +117,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ScriptPackagesList", pipeline_response) + deserialized = self._deserialize("ScriptPackageListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -149,14 +149,14 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, private_cloud_name: str, script_package_name: str, **kwargs: Any ) -> _models.ScriptPackage: - """Get a script package available to run on a private cloud. + """Get a ScriptPackage. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_package_name: Name of the script package in the private cloud. Required. + :param script_package_name: Name of the script package. Required. :type script_package_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ScriptPackage or the result of cls(response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py index 517da4f491f7..a0af34d1ff6c 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py @@ -64,16 +64,14 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> AsyncIterable["_models.VirtualMachine"]: - """List of virtual machines in a private cloud cluster. - - List of virtual machines in a private cloud cluster. + """List VirtualMachine resources by Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachine or the result of cls(response) @@ -84,7 +82,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VirtualMachinesList] = kwargs.pop("cls", None) + cls: ClsType[_models.VirtualMachineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -129,7 +127,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualMachinesList", pipeline_response) + deserialized = self._deserialize("VirtualMachineListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -166,18 +164,16 @@ async def get( virtual_machine_id: str, **kwargs: Any ) -> _models.VirtualMachine: - """Get a virtual machine by id in a private cloud cluster. - - Get a virtual machine by id in a private cloud cluster. + """Get a VirtualMachine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param virtual_machine_id: Virtual Machine identifier. Required. + :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: VirtualMachine or the result of cls(response) @@ -296,8 +292,12 @@ async def _restrict_movement_initial( # pylint: disable=inconsistent-return-sta error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _restrict_movement_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement" @@ -317,19 +317,16 @@ async def begin_restrict_movement( ) -> AsyncLROPoller[None]: """Enable or disable DRS-driven VM movement restriction. - Enable or disable DRS-driven VM movement restriction. - :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param virtual_machine_id: Virtual Machine identifier. Required. + :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: Whether VM DRS-driven movement is restricted (Enabled) or not - (Disabled). Required. + :param restrict_movement: The body type of the operation request. Required. :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -361,19 +358,16 @@ async def begin_restrict_movement( ) -> AsyncLROPoller[None]: """Enable or disable DRS-driven VM movement restriction. - Enable or disable DRS-driven VM movement restriction. - :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param virtual_machine_id: Virtual Machine identifier. Required. + :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: Whether VM DRS-driven movement is restricted (Enabled) or not - (Disabled). Required. + :param restrict_movement: The body type of the operation request. Required. :type restrict_movement: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -403,19 +397,17 @@ async def begin_restrict_movement( ) -> AsyncLROPoller[None]: """Enable or disable DRS-driven VM movement restriction. - Enable or disable DRS-driven VM movement restriction. - :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param virtual_machine_id: Virtual Machine identifier. Required. + :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: Whether VM DRS-driven movement is restricted (Enabled) or not - (Disabled). Is either a VirtualMachineRestrictMovement type or a IO type. Required. + :param restrict_movement: The body type of the operation request. Is either a + VirtualMachineRestrictMovement type or a IO type. Required. :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -462,7 +454,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py index ad008bd9c698..bb1ce412e93c 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_workload_networks_operations.py @@ -97,88 +97,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def get( - self, - resource_group_name: str, - private_cloud_name: str, - workload_network_name: Union[str, _models.WorkloadNetworkName], - **kwargs: Any - ) -> _models.WorkloadNetwork: - """Get a private cloud workload network. - - Get a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param workload_network_name: Name for the workload network in the private cloud. "default" - Required. - :type workload_network_name: str or ~azure.mgmt.avs.models.WorkloadNetworkName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetwork or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetwork - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetwork] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - workload_network_name=workload_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkloadNetwork", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}" - } - @distributed_trace def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.WorkloadNetwork"]: - """List of workload networks in a private cloud. - - List of workload networks in a private cloud. + """List WorkloadNetwork resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -194,7 +117,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -238,7 +161,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -266,13 +189,74 @@ async def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks" } + @distributed_trace_async + async def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> _models.WorkloadNetwork: + """Get a WorkloadNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkloadNetwork or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetwork] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WorkloadNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default" + } + @distributed_trace - def list_segments( + def list_dhcp( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkloadNetworkSegment"]: - """List of segments in a private cloud workload network. - - List of segments in a private cloud workload network. + ) -> AsyncIterable["_models.WorkloadNetworkDhcp"]: + """List WorkloadNetworkDhcp resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -280,16 +264,15 @@ def list_segments( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkSegment or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :return: An iterator like instance of either WorkloadNetworkDhcp or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkSegmentsList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDhcpListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -302,12 +285,12 @@ def list_segments( def prepare_request(next_link=None): if not next_link: - request = build_list_segments_request( + request = build_list_dhcp_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_segments.metadata["url"], + template_url=self.list_dhcp.metadata["url"], headers=_headers, params=_params, ) @@ -333,7 +316,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkSegmentsList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcpListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -357,29 +340,26 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_segments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments" + list_dhcp.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations" } @distributed_trace_async - async def get_segment( - self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkSegment: - """Get a segment by id in a private cloud workload network. - - Get a segment by id in a private cloud workload network. + async def get_dhcp( + self, resource_group_name: str, dhcp_id: str, private_cloud_name: str, **kwargs: Any + ) -> _models.WorkloadNetworkDhcp: + """Get a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkSegment + :return: WorkloadNetworkDhcp or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDhcp :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -394,15 +374,15 @@ async def get_segment( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) - request = build_get_segment_request( + request = build_get_dhcp_request( resource_group_name=resource_group_name, + dhcp_id=dhcp_id, private_cloud_name=private_cloud_name, - segment_id=segment_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_segment.metadata["url"], + template_url=self.get_dhcp.metadata["url"], headers=_headers, params=_params, ) @@ -421,25 +401,25 @@ async def get_segment( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_segment.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + get_dhcp.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } - async def _create_segments_initial( + async def _create_dhcp_initial( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], + dhcp_id: str, + workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], **kwargs: Any - ) -> _models.WorkloadNetworkSegment: + ) -> _models.WorkloadNetworkDhcp: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -453,26 +433,26 @@ async def _create_segments_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_segment, (IOBase, bytes)): - _content = workload_network_segment + if isinstance(workload_network_dhcp, (IOBase, bytes)): + _content = workload_network_dhcp else: - _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegment") + _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcp") - request = build_create_segments_request( + request = build_create_dhcp_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, + dhcp_id=dhcp_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._create_segments_initial.metadata["url"], + template_url=self._create_dhcp_initial.metadata["url"], headers=_headers, params=_params, ) @@ -491,46 +471,46 @@ async def _create_segments_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_segments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + _create_dhcp_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } @overload - async def begin_create_segments( + async def begin_create_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: _models.WorkloadNetworkSegment, + dhcp_id: str, + workload_network_dhcp: _models.WorkloadNetworkDhcp, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: - """Create a segment by id in a private cloud workload network. - - Create a segment by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: + """Create a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Required. - :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: Resource create parameters. Required. + :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -542,37 +522,34 @@ async def begin_create_segments( :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 WorkloadNetworkSegment or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDhcp or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_segments( + async def begin_create_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: IO, + dhcp_id: str, + workload_network_dhcp: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: - """Create a segment by id in a private cloud workload network. - - Create a segment by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: + """Create a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Required. - :type workload_network_segment: IO + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: Resource create parameters. Required. + :type workload_network_dhcp: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -584,36 +561,33 @@ async def begin_create_segments( :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 WorkloadNetworkSegment or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDhcp or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_segments( + async def begin_create_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], + dhcp_id: str, + workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: - """Create a segment by id in a private cloud workload network. - - Create a segment by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: + """Create a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Is either a WorkloadNetworkSegment type or a IO - type. Required. - :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment or IO + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: Resource create parameters. Is either a WorkloadNetworkDhcp type + or a IO type. Required. + :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -625,9 +599,9 @@ async def begin_create_segments( :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 WorkloadNetworkSegment or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDhcp or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -635,16 +609,16 @@ async def begin_create_segments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_segments_initial( + raw_result = await self._create_dhcp_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, - workload_network_segment=workload_network_segment, + dhcp_id=dhcp_id, + workload_network_dhcp=workload_network_dhcp, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -655,13 +629,16 @@ async def begin_create_segments( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -675,18 +652,18 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_segments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + begin_create_dhcp.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } - async def _update_segments_initial( + async def _update_dhcp_initial( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], + dhcp_id: str, + workload_network_dhcp: Union[_models.WorkloadNetworkDhcpUpdate, IO], **kwargs: Any - ) -> Optional[_models.WorkloadNetworkSegment]: + ) -> Optional[_models.WorkloadNetworkDhcp]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -700,26 +677,26 @@ async def _update_segments_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkSegment]] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkDhcp]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_segment, (IOBase, bytes)): - _content = workload_network_segment + if isinstance(workload_network_dhcp, (IOBase, bytes)): + _content = workload_network_dhcp else: - _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegment") + _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcpUpdate") - request = build_update_segments_request( + request = build_update_dhcp_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, + dhcp_id=dhcp_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._update_segments_initial.metadata["url"], + template_url=self._update_dhcp_initial.metadata["url"], headers=_headers, params=_params, ) @@ -739,43 +716,45 @@ async def _update_segments_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_segments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + _update_dhcp_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } @overload - async def begin_update_segments( + async def begin_update_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: _models.WorkloadNetworkSegment, + dhcp_id: str, + workload_network_dhcp: _models.WorkloadNetworkDhcpUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: - """Create or update a segment by id in a private cloud workload network. - - Create or update a segment by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: + """Update a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Required. - :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: The resource properties to be updated. Required. + :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcpUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -787,37 +766,34 @@ async def begin_update_segments( :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 WorkloadNetworkSegment or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDhcp or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update_segments( + async def begin_update_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: IO, + dhcp_id: str, + workload_network_dhcp: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: - """Create or update a segment by id in a private cloud workload network. - - Create or update a segment by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: + """Update a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Required. - :type workload_network_segment: IO + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: The resource properties to be updated. Required. + :type workload_network_dhcp: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -829,36 +805,33 @@ async def begin_update_segments( :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 WorkloadNetworkSegment or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDhcp or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_update_segments( + async def begin_update_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], + dhcp_id: str, + workload_network_dhcp: Union[_models.WorkloadNetworkDhcpUpdate, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: - """Create or update a segment by id in a private cloud workload network. - - Create or update a segment by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: + """Update a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Is either a WorkloadNetworkSegment type or a IO - type. Required. - :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment or IO + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: The resource properties to be updated. Is either a + WorkloadNetworkDhcpUpdate type or a IO type. Required. + :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcpUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -870,9 +843,9 @@ async def begin_update_segments( :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 WorkloadNetworkSegment or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDhcp or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -880,16 +853,16 @@ async def begin_update_segments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_segments_initial( + raw_result = await self._update_dhcp_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, - workload_network_segment=workload_network_segment, + dhcp_id=dhcp_id, + workload_network_dhcp=workload_network_dhcp, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -900,13 +873,15 @@ async def begin_update_segments( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -920,12 +895,12 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_segments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + begin_update_dhcp.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } - async def _delete_segment_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any + async def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_cloud_name: str, dhcp_id: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -941,13 +916,13 @@ async def _delete_segment_initial( # pylint: disable=inconsistent-return-statem api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_segment_request( + request = build_delete_dhcp_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, + dhcp_id=dhcp_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_segment_initial.metadata["url"], + template_url=self._delete_dhcp_initial.metadata["url"], headers=_headers, params=_params, ) @@ -966,29 +941,31 @@ async def _delete_segment_initial( # pylint: disable=inconsistent-return-statem error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_segment_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + _delete_dhcp_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } @distributed_trace_async - async def begin_delete_segment( - self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any + async def begin_delete_dhcp( + self, resource_group_name: str, private_cloud_name: str, dhcp_id: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a segment by id in a private cloud workload network. - - Delete a segment by id in a private cloud workload network. + """Delete a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: 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: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -1010,10 +987,10 @@ async def begin_delete_segment( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_segment_initial( # type: ignore + raw_result = await self._delete_dhcp_initial( # type: ignore resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, + dhcp_id=dhcp_id, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -1027,7 +1004,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1041,17 +1020,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_segment.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + begin_delete_dhcp.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } @distributed_trace - def list_dhcp( + def list_dns_services( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkloadNetworkDhcp"]: - """List dhcp in a private cloud workload network. - - List dhcp in a private cloud workload network. + ) -> AsyncIterable["_models.WorkloadNetworkDnsService"]: + """List WorkloadNetworkDnsService resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1059,15 +1036,17 @@ def list_dhcp( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkDhcp or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An iterator like instance of either WorkloadNetworkDnsService or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDhcpList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsServiceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1080,12 +1059,12 @@ def list_dhcp( def prepare_request(next_link=None): if not next_link: - request = build_list_dhcp_request( + request = build_list_dns_services_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_dhcp.metadata["url"], + template_url=self.list_dns_services.metadata["url"], headers=_headers, params=_params, ) @@ -1111,7 +1090,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDhcpList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsServiceListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -1135,28 +1114,26 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_dhcp.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations" + list_dns_services.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices" } @distributed_trace_async - async def get_dhcp( - self, resource_group_name: str, dhcp_id: str, private_cloud_name: str, **kwargs: Any - ) -> _models.WorkloadNetworkDhcp: - """Get dhcp by id in a private cloud workload network. - - Get dhcp by id in a private cloud workload network. + async def get_dns_service( + self, resource_group_name: str, private_cloud_name: str, dns_service_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkDnsService: + """Get a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkDhcp or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDhcp + :return: WorkloadNetworkDnsService or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsService :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -1171,15 +1148,15 @@ async def get_dhcp( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) - request = build_get_dhcp_request( + request = build_get_dns_service_request( resource_group_name=resource_group_name, - dhcp_id=dhcp_id, private_cloud_name=private_cloud_name, + dns_service_id=dns_service_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_dhcp.metadata["url"], + template_url=self.get_dns_service.metadata["url"], headers=_headers, params=_params, ) @@ -1198,25 +1175,25 @@ async def get_dhcp( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dhcp.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + get_dns_service.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } - async def _create_dhcp_initial( + async def _create_dns_service_initial( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], + dns_service_id: str, + workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], **kwargs: Any - ) -> _models.WorkloadNetworkDhcp: + ) -> _models.WorkloadNetworkDnsService: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1230,26 +1207,26 @@ async def _create_dhcp_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dhcp, (IOBase, bytes)): - _content = workload_network_dhcp + if isinstance(workload_network_dns_service, (IOBase, bytes)): + _content = workload_network_dns_service else: - _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcp") + _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsService") - request = build_create_dhcp_request( + request = build_create_dns_service_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, + dns_service_id=dns_service_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._create_dhcp_initial.metadata["url"], + template_url=self._create_dns_service_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1268,45 +1245,46 @@ async def _create_dhcp_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_dhcp_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + _create_dns_service_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } @overload - async def begin_create_dhcp( + async def begin_create_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: _models.WorkloadNetworkDhcp, + dns_service_id: str, + workload_network_dns_service: _models.WorkloadNetworkDnsService, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: - """Create dhcp by id in a private cloud workload network. - - Create dhcp by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: + """Create a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Required. - :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: Resource create parameters. Required. + :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1318,36 +1296,34 @@ async def begin_create_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsService or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_dhcp( + async def begin_create_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: IO, + dns_service_id: str, + workload_network_dns_service: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: - """Create dhcp by id in a private cloud workload network. - - Create dhcp by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: + """Create a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Required. - :type workload_network_dhcp: IO + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: Resource create parameters. Required. + :type workload_network_dns_service: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1359,35 +1335,33 @@ async def begin_create_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsService or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_dhcp( + async def begin_create_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], + dns_service_id: str, + workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: - """Create dhcp by id in a private cloud workload network. - - Create dhcp by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: + """Create a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Is either a WorkloadNetworkDhcp type or a IO type. - Required. - :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or IO + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: Resource create parameters. Is either a + WorkloadNetworkDnsService type or a IO type. Required. + :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1399,9 +1373,9 @@ async def begin_create_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsService or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1409,16 +1383,16 @@ async def begin_create_dhcp( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_dhcp_initial( + raw_result = await self._create_dns_service_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, - workload_network_dhcp=workload_network_dhcp, + dns_service_id=dns_service_id, + workload_network_dns_service=workload_network_dns_service, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -1429,13 +1403,16 @@ async def begin_create_dhcp( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1449,18 +1426,18 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_dhcp.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + begin_create_dns_service.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } - async def _update_dhcp_initial( + async def _update_dns_service_initial( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], + dns_service_id: str, + workload_network_dns_service: Union[_models.WorkloadNetworkDnsServiceUpdate, IO], **kwargs: Any - ) -> Optional[_models.WorkloadNetworkDhcp]: + ) -> Optional[_models.WorkloadNetworkDnsService]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1474,26 +1451,26 @@ async def _update_dhcp_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkDhcp]] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkDnsService]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dhcp, (IOBase, bytes)): - _content = workload_network_dhcp + if isinstance(workload_network_dns_service, (IOBase, bytes)): + _content = workload_network_dns_service else: - _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcp") + _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsServiceUpdate") - request = build_update_dhcp_request( + request = build_update_dns_service_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, + dns_service_id=dns_service_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._update_dhcp_initial.metadata["url"], + template_url=self._update_dns_service_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1513,42 +1490,45 @@ async def _update_dhcp_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) + + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_dhcp_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + _update_dns_service_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } @overload - async def begin_update_dhcp( + async def begin_update_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: _models.WorkloadNetworkDhcp, + dns_service_id: str, + workload_network_dns_service: _models.WorkloadNetworkDnsServiceUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: - """Create or update dhcp by id in a private cloud workload network. - - Create or update dhcp by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: + """Update a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Required. - :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: The resource properties to be updated. Required. + :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsServiceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1560,36 +1540,34 @@ async def begin_update_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsService or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update_dhcp( + async def begin_update_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: IO, + dns_service_id: str, + workload_network_dns_service: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: - """Create or update dhcp by id in a private cloud workload network. - - Create or update dhcp by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: + """Update a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Required. - :type workload_network_dhcp: IO + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: The resource properties to be updated. Required. + :type workload_network_dns_service: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1601,35 +1579,34 @@ async def begin_update_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsService or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_update_dhcp( + async def begin_update_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], + dns_service_id: str, + workload_network_dns_service: Union[_models.WorkloadNetworkDnsServiceUpdate, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDhcp]: - """Create or update dhcp by id in a private cloud workload network. - - Create or update dhcp by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: + """Update a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Is either a WorkloadNetworkDhcp type or a IO type. - Required. - :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or IO + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: The resource properties to be updated. Is either a + WorkloadNetworkDnsServiceUpdate type or a IO type. Required. + :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsServiceUpdate or + IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1641,9 +1618,9 @@ async def begin_update_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsService or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1651,16 +1628,16 @@ async def begin_update_dhcp( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_dhcp_initial( + raw_result = await self._update_dns_service_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, - workload_network_dhcp=workload_network_dhcp, + dns_service_id=dns_service_id, + workload_network_dns_service=workload_network_dns_service, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -1671,13 +1648,15 @@ async def begin_update_dhcp( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1691,12 +1670,12 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_dhcp.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + begin_update_dns_service.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } - async def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, private_cloud_name: str, dhcp_id: str, **kwargs: Any + async def _delete_dns_service_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, dns_service_id: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1712,13 +1691,13 @@ async def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statement api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_dhcp_request( + request = build_delete_dns_service_request( resource_group_name=resource_group_name, + dns_service_id=dns_service_id, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_dhcp_initial.metadata["url"], + template_url=self._delete_dns_service_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1737,28 +1716,31 @@ async def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statement error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_dhcp_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + _delete_dns_service_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } @distributed_trace_async - async def begin_delete_dhcp( - self, resource_group_name: str, private_cloud_name: str, dhcp_id: str, **kwargs: Any + async def begin_delete_dns_service( + self, resource_group_name: str, dns_service_id: str, private_cloud_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete dhcp by id in a private cloud workload network. - - Delete dhcp by id in a private cloud workload network. + """Delete a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: 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: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -1780,10 +1762,10 @@ async def begin_delete_dhcp( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_dhcp_initial( # type: ignore + raw_result = await self._delete_dns_service_initial( # type: ignore resource_group_name=resource_group_name, + dns_service_id=dns_service_id, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -1797,7 +1779,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1811,17 +1795,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_dhcp.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + begin_delete_dns_service.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } @distributed_trace - def list_gateways( + def list_dns_zones( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkloadNetworkGateway"]: - """List of gateways in a private cloud workload network. - - List of gateways in a private cloud workload network. + ) -> AsyncIterable["_models.WorkloadNetworkDnsZone"]: + """List WorkloadNetworkDnsZone resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1829,16 +1811,16 @@ def list_gateways( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkGateway or the result of + :return: An iterator like instance of either WorkloadNetworkDnsZone or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkGateway] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkGatewayList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsZoneListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1851,12 +1833,12 @@ def list_gateways( def prepare_request(next_link=None): if not next_link: - request = build_list_gateways_request( + request = build_list_dns_zones_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_gateways.metadata["url"], + template_url=self.list_dns_zones.metadata["url"], headers=_headers, params=_params, ) @@ -1882,7 +1864,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkGatewayList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZoneListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -1906,29 +1888,26 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_gateways.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways" + list_dns_zones.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones" } @distributed_trace_async - async def get_gateway( - self, resource_group_name: str, private_cloud_name: str, gateway_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkGateway: - """Get a gateway by id in a private cloud workload network. - - Get a gateway by id in a private cloud workload network. + async def get_dns_zone( + self, resource_group_name: str, private_cloud_name: str, dns_zone_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkDnsZone: + """Get a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param gateway_id: NSX Gateway identifier. Generally the same as the Gateway's display name. - Required. - :type gateway_id: str + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkGateway or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkGateway + :return: WorkloadNetworkDnsZone or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -1943,15 +1922,15 @@ async def get_gateway( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkGateway] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) - request = build_get_gateway_request( + request = build_get_dns_zone_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - gateway_id=gateway_id, + dns_zone_id=dns_zone_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_gateway.metadata["url"], + template_url=self.get_dns_zone.metadata["url"], headers=_headers, params=_params, ) @@ -1970,192 +1949,25 @@ async def get_gateway( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkGateway", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_gateway.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}" + get_dns_zone.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } - @distributed_trace - def list_port_mirroring( - self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkloadNetworkPortMirroring"]: - """List of port mirroring profiles in a private cloud workload network. - - List of port mirroring profiles in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkPortMirroring or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkPortMirroringList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_port_mirroring_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_port_mirroring.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkPortMirroringList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_port_mirroring.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles" - } - - @distributed_trace_async - async def get_port_mirroring( - self, resource_group_name: str, private_cloud_name: str, port_mirroring_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkPortMirroring: - """Get a port mirroring profile by id in a private cloud workload network. - - Get a port mirroring profile by id in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkPortMirroring or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) - - request = build_get_port_mirroring_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - port_mirroring_id=port_mirroring_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_port_mirroring.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_port_mirroring.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" - } - - async def _create_port_mirroring_initial( - self, - resource_group_name: str, - private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], - **kwargs: Any - ) -> _models.WorkloadNetworkPortMirroring: + async def _create_dns_zone_initial( + self, + resource_group_name: str, + private_cloud_name: str, + dns_zone_id: str, + workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], + **kwargs: Any + ) -> _models.WorkloadNetworkDnsZone: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2169,26 +1981,26 @@ async def _create_port_mirroring_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_port_mirroring, (IOBase, bytes)): - _content = workload_network_port_mirroring + if isinstance(workload_network_dns_zone, (IOBase, bytes)): + _content = workload_network_dns_zone else: - _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroring") + _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZone") - request = build_create_port_mirroring_request( + request = build_create_dns_zone_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - port_mirroring_id=port_mirroring_id, + dns_zone_id=dns_zone_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._create_port_mirroring_initial.metadata["url"], + template_url=self._create_dns_zone_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2207,46 +2019,46 @@ async def _create_port_mirroring_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_port_mirroring_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + _create_dns_zone_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } @overload - async def begin_create_port_mirroring( + async def begin_create_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: _models.WorkloadNetworkPortMirroring, + dns_zone_id: str, + workload_network_dns_zone: _models.WorkloadNetworkDnsZone, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: - """Create a port mirroring profile by id in a private cloud workload network. - - Create a port mirroring profile by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: + """Create a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Required. - :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: Resource create parameters. Required. + :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2258,37 +2070,34 @@ async def begin_create_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsZone or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_port_mirroring( + async def begin_create_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: IO, + dns_zone_id: str, + workload_network_dns_zone: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: - """Create a port mirroring profile by id in a private cloud workload network. - - Create a port mirroring profile by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: + """Create a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Required. - :type workload_network_port_mirroring: IO + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: Resource create parameters. Required. + :type workload_network_dns_zone: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2300,37 +2109,33 @@ async def begin_create_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsZone or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_port_mirroring( + async def begin_create_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], + dns_zone_id: str, + workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: - """Create a port mirroring profile by id in a private cloud workload network. - - Create a port mirroring profile by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: + """Create a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Is either a - WorkloadNetworkPortMirroring type or a IO type. Required. - :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or - IO + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: Resource create parameters. Is either a + WorkloadNetworkDnsZone type or a IO type. Required. + :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -2342,9 +2147,9 @@ async def begin_create_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsZone or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2352,16 +2157,16 @@ async def begin_create_port_mirroring( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_port_mirroring_initial( + raw_result = await self._create_dns_zone_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - port_mirroring_id=port_mirroring_id, - workload_network_port_mirroring=workload_network_port_mirroring, + dns_zone_id=dns_zone_id, + workload_network_dns_zone=workload_network_dns_zone, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -2372,13 +2177,16 @@ async def begin_create_port_mirroring( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2392,18 +2200,18 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_port_mirroring.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + begin_create_dns_zone.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } - async def _update_port_mirroring_initial( + async def _update_dns_zone_initial( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], + dns_zone_id: str, + workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZoneUpdate, IO], **kwargs: Any - ) -> Optional[_models.WorkloadNetworkPortMirroring]: + ) -> Optional[_models.WorkloadNetworkDnsZone]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2417,26 +2225,26 @@ async def _update_port_mirroring_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkPortMirroring]] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkDnsZone]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_port_mirroring, (IOBase, bytes)): - _content = workload_network_port_mirroring + if isinstance(workload_network_dns_zone, (IOBase, bytes)): + _content = workload_network_dns_zone else: - _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroring") + _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZoneUpdate") - request = build_update_port_mirroring_request( + request = build_update_dns_zone_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - port_mirroring_id=port_mirroring_id, + dns_zone_id=dns_zone_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._update_port_mirroring_initial.metadata["url"], + template_url=self._update_dns_zone_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2456,43 +2264,45 @@ async def _update_port_mirroring_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_port_mirroring_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + _update_dns_zone_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } @overload - async def begin_update_port_mirroring( + async def begin_update_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: _models.WorkloadNetworkPortMirroring, + dns_zone_id: str, + workload_network_dns_zone: _models.WorkloadNetworkDnsZoneUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: - """Create or update a port mirroring profile by id in a private cloud workload network. - - Create or update a port mirroring profile by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: + """Update a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Required. - :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: The resource properties to be updated. Required. + :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZoneUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2504,37 +2314,34 @@ async def begin_update_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsZone or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update_port_mirroring( + async def begin_update_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: IO, + dns_zone_id: str, + workload_network_dns_zone: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: - """Create or update a port mirroring profile by id in a private cloud workload network. - - Create or update a port mirroring profile by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: + """Update a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Required. - :type workload_network_port_mirroring: IO + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: The resource properties to be updated. Required. + :type workload_network_dns_zone: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2546,37 +2353,33 @@ async def begin_update_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsZone or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_update_port_mirroring( + async def begin_update_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], + dns_zone_id: str, + workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZoneUpdate, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: - """Create or update a port mirroring profile by id in a private cloud workload network. - - Create or update a port mirroring profile by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: + """Update a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Is either a - WorkloadNetworkPortMirroring type or a IO type. Required. - :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or - IO + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: The resource properties to be updated. Is either a + WorkloadNetworkDnsZoneUpdate type or a IO type. Required. + :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZoneUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -2588,9 +2391,9 @@ async def begin_update_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsZone or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2598,16 +2401,16 @@ async def begin_update_port_mirroring( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_port_mirroring_initial( + raw_result = await self._update_dns_zone_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - port_mirroring_id=port_mirroring_id, - workload_network_port_mirroring=workload_network_port_mirroring, + dns_zone_id=dns_zone_id, + workload_network_dns_zone=workload_network_dns_zone, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -2618,13 +2421,15 @@ async def begin_update_port_mirroring( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2638,12 +2443,12 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_port_mirroring.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + begin_update_dns_zone.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } - async def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, **kwargs: Any + async def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, dns_zone_id: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2659,13 +2464,13 @@ async def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_port_mirroring_request( + request = build_delete_dns_zone_request( resource_group_name=resource_group_name, - port_mirroring_id=port_mirroring_id, + dns_zone_id=dns_zone_id, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_port_mirroring_initial.metadata["url"], + template_url=self._delete_dns_zone_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2684,27 +2489,29 @@ async def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_port_mirroring_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + _delete_dns_zone_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } @distributed_trace_async - async def begin_delete_port_mirroring( - self, resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, **kwargs: Any + async def begin_delete_dns_zone( + self, resource_group_name: str, dns_zone_id: str, private_cloud_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a port mirroring profile by id in a private cloud workload network. - - Delete a port mirroring profile by id in a private cloud workload network. + """Delete a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -2728,9 +2535,9 @@ async def begin_delete_port_mirroring( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_port_mirroring_initial( # type: ignore + raw_result = await self._delete_dns_zone_initial( # type: ignore resource_group_name=resource_group_name, - port_mirroring_id=port_mirroring_id, + dns_zone_id=dns_zone_id, private_cloud_name=private_cloud_name, api_version=api_version, cls=lambda x, y, z: x, @@ -2745,7 +2552,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2759,17 +2568,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_port_mirroring.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + begin_delete_dns_zone.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } @distributed_trace - def list_vm_groups( + def list_gateways( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkloadNetworkVMGroup"]: - """List of vm groups in a private cloud workload network. - - List of vm groups in a private cloud workload network. + ) -> AsyncIterable["_models.WorkloadNetworkGateway"]: + """List WorkloadNetworkGateway resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2777,16 +2584,16 @@ def list_vm_groups( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkVMGroup or the result of + :return: An iterator like instance of either WorkloadNetworkGateway or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkVMGroupsList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkGatewayListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2799,12 +2606,12 @@ def list_vm_groups( def prepare_request(next_link=None): if not next_link: - request = build_list_vm_groups_request( + request = build_list_gateways_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_vm_groups.metadata["url"], + template_url=self.list_gateways.metadata["url"], headers=_headers, params=_params, ) @@ -2830,7 +2637,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkVMGroupsList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkGatewayListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -2854,29 +2661,26 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_vm_groups.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups" + list_gateways.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways" } @distributed_trace_async - async def get_vm_group( - self, resource_group_name: str, private_cloud_name: str, vm_group_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkVMGroup: - """Get a vm group by id in a private cloud workload network. - - Get a vm group by id in a private cloud workload network. + async def get_gateway( + self, resource_group_name: str, private_cloud_name: str, gateway_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkGateway: + """Get a WorkloadNetworkGateway. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str + :param gateway_id: The ID of the NSX Gateway. Required. + :type gateway_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkVMGroup or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :return: WorkloadNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkGateway :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -2891,15 +2695,15 @@ async def get_vm_group( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkGateway] = kwargs.pop("cls", None) - request = build_get_vm_group_request( + request = build_get_gateway_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - vm_group_id=vm_group_id, + gateway_id=gateway_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_vm_group.metadata["url"], + template_url=self.get_gateway.metadata["url"], headers=_headers, params=_params, ) @@ -2918,25 +2722,41 @@ async def get_vm_group( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkGateway", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_vm_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + get_gateway.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}" } - async def _create_vm_group_initial( - self, - resource_group_name: str, - private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], - **kwargs: Any - ) -> _models.WorkloadNetworkVMGroup: + @distributed_trace + def list_port_mirroring( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> AsyncIterable["_models.WorkloadNetworkPortMirroring"]: + """List WorkloadNetworkPortMirroring resources by WorkloadNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkloadNetworkPortMirroring or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetworkPortMirroringListResult] = kwargs.pop("cls", None) + error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2945,89 +2765,235 @@ async def _create_vm_group_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(workload_network_vm_group, (IOBase, bytes)): - _content = workload_network_vm_group - else: - _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroup") + request = build_list_port_mirroring_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_port_mirroring.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = build_create_vm_group_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - vm_group_id=vm_group_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_vm_group_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) + async def extract_data(pipeline_response): + deserialized = self._deserialize("WorkloadNetworkPortMirroringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) - response = pipeline_response.http_response + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_port_mirroring.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles" + } + + @distributed_trace_async + async def get_port_mirroring( + self, resource_group_name: str, private_cloud_name: str, port_mirroring_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkPortMirroring: + """Get a WorkloadNetworkPortMirroring. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkloadNetworkPortMirroring or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) + + request = build_get_port_mirroring_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + port_mirroring_id=port_mirroring_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_port_mirroring.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_port_mirroring.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + } + + async def _create_port_mirroring_initial( + self, + resource_group_name: str, + private_cloud_name: str, + port_mirroring_id: str, + workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], + **kwargs: Any + ) -> _models.WorkloadNetworkPortMirroring: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(workload_network_port_mirroring, (IOBase, bytes)): + _content = workload_network_port_mirroring + else: + _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroring") + + request = build_create_port_mirroring_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + port_mirroring_id=port_mirroring_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_port_mirroring_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_vm_group_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + _create_port_mirroring_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } @overload - async def begin_create_vm_group( + async def begin_create_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: _models.WorkloadNetworkVMGroup, + port_mirroring_id: str, + workload_network_port_mirroring: _models.WorkloadNetworkPortMirroring, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: - """Create a vm group by id in a private cloud workload network. - - Create a vm group by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: + """Create a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Required. - :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: Resource create parameters. Required. + :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3039,37 +3005,34 @@ async def begin_create_vm_group( :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 WorkloadNetworkVMGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_vm_group( + async def begin_create_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: IO, + port_mirroring_id: str, + workload_network_port_mirroring: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: - """Create a vm group by id in a private cloud workload network. - - Create a vm group by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: + """Create a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Required. - :type workload_network_vm_group: IO + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: Resource create parameters. Required. + :type workload_network_port_mirroring: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -3081,36 +3044,34 @@ async def begin_create_vm_group( :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 WorkloadNetworkVMGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_vm_group( + async def begin_create_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], + port_mirroring_id: str, + workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: - """Create a vm group by id in a private cloud workload network. - - Create a vm group by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: + """Create a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Is either a WorkloadNetworkVMGroup type or a IO - type. Required. - :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or IO + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: Resource create parameters. Is either a + WorkloadNetworkPortMirroring type or a IO type. Required. + :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or + IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -3122,9 +3083,9 @@ async def begin_create_vm_group( :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 WorkloadNetworkVMGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3132,16 +3093,16 @@ async def begin_create_vm_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_vm_group_initial( + raw_result = await self._create_port_mirroring_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - vm_group_id=vm_group_id, - workload_network_vm_group=workload_network_vm_group, + port_mirroring_id=port_mirroring_id, + workload_network_port_mirroring=workload_network_port_mirroring, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3152,13 +3113,16 @@ async def begin_create_vm_group( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3172,18 +3136,18 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_vm_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + begin_create_port_mirroring.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } - async def _update_vm_group_initial( + async def _update_port_mirroring_initial( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], + port_mirroring_id: str, + workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroringUpdate, IO], **kwargs: Any - ) -> Optional[_models.WorkloadNetworkVMGroup]: + ) -> Optional[_models.WorkloadNetworkPortMirroring]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3197,26 +3161,26 @@ async def _update_vm_group_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkVMGroup]] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkPortMirroring]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_vm_group, (IOBase, bytes)): - _content = workload_network_vm_group + if isinstance(workload_network_port_mirroring, (IOBase, bytes)): + _content = workload_network_port_mirroring else: - _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroup") + _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroringUpdate") - request = build_update_vm_group_request( + request = build_update_port_mirroring_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - vm_group_id=vm_group_id, + port_mirroring_id=port_mirroring_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._update_vm_group_initial.metadata["url"], + template_url=self._update_port_mirroring_initial.metadata["url"], headers=_headers, params=_params, ) @@ -3236,43 +3200,46 @@ async def _update_vm_group_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_vm_group_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + _update_port_mirroring_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } @overload - async def begin_update_vm_group( + async def begin_update_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: _models.WorkloadNetworkVMGroup, + port_mirroring_id: str, + workload_network_port_mirroring: _models.WorkloadNetworkPortMirroringUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: - """Create or update a vm group by id in a private cloud workload network. - - Create or update a vm group by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: + """Update a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Required. - :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: The resource properties to be updated. Required. + :type workload_network_port_mirroring: + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3284,37 +3251,34 @@ async def begin_update_vm_group( :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 WorkloadNetworkVMGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update_vm_group( + async def begin_update_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: IO, + port_mirroring_id: str, + workload_network_port_mirroring: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: - """Create or update a vm group by id in a private cloud workload network. - - Create or update a vm group by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: + """Update a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Required. - :type workload_network_vm_group: IO + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: The resource properties to be updated. Required. + :type workload_network_port_mirroring: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -3326,36 +3290,34 @@ async def begin_update_vm_group( :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 WorkloadNetworkVMGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_update_vm_group( + async def begin_update_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], + port_mirroring_id: str, + workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroringUpdate, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: - """Create or update a vm group by id in a private cloud workload network. - - Create or update a vm group by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkPortMirroring]: + """Update a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Is either a WorkloadNetworkVMGroup type or a IO - type. Required. - :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or IO + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: The resource properties to be updated. Is either a + WorkloadNetworkPortMirroringUpdate type or a IO type. Required. + :type workload_network_port_mirroring: + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -3367,9 +3329,9 @@ async def begin_update_vm_group( :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 WorkloadNetworkVMGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3377,16 +3339,16 @@ async def begin_update_vm_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_vm_group_initial( + raw_result = await self._update_port_mirroring_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - vm_group_id=vm_group_id, - workload_network_vm_group=workload_network_vm_group, + port_mirroring_id=port_mirroring_id, + workload_network_port_mirroring=workload_network_port_mirroring, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3397,13 +3359,15 @@ async def begin_update_vm_group( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3417,12 +3381,12 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_vm_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + begin_update_port_mirroring.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } - async def _delete_vm_group_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, vm_group_id: str, private_cloud_name: str, **kwargs: Any + async def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -3438,13 +3402,13 @@ async def _delete_vm_group_initial( # pylint: disable=inconsistent-return-state api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_vm_group_request( + request = build_delete_port_mirroring_request( resource_group_name=resource_group_name, - vm_group_id=vm_group_id, + port_mirroring_id=port_mirroring_id, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_vm_group_initial.metadata["url"], + template_url=self._delete_port_mirroring_initial.metadata["url"], headers=_headers, params=_params, ) @@ -3463,27 +3427,29 @@ async def _delete_vm_group_initial( # pylint: disable=inconsistent-return-state error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_vm_group_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + _delete_port_mirroring_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } @distributed_trace_async - async def begin_delete_vm_group( - self, resource_group_name: str, vm_group_id: str, private_cloud_name: str, **kwargs: Any + async def begin_delete_port_mirroring( + self, resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a vm group by id in a private cloud workload network. - - Delete a vm group by id in a private cloud workload network. + """Delete a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -3507,9 +3473,9 @@ async def begin_delete_vm_group( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_vm_group_initial( # type: ignore + raw_result = await self._delete_port_mirroring_initial( # type: ignore resource_group_name=resource_group_name, - vm_group_id=vm_group_id, + port_mirroring_id=port_mirroring_id, private_cloud_name=private_cloud_name, api_version=api_version, cls=lambda x, y, z: x, @@ -3524,7 +3490,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3538,17 +3506,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_vm_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + begin_delete_port_mirroring.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } @distributed_trace - def list_virtual_machines( + def list_public_i_ps( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkloadNetworkVirtualMachine"]: - """List of virtual machines in a private cloud workload network. - - List of virtual machines in a private cloud workload network. + ) -> AsyncIterable["_models.WorkloadNetworkPublicIP"]: + """List WorkloadNetworkPublicIP resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3556,17 +3522,16 @@ def list_virtual_machines( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkVirtualMachine or the result of + :return: An iterator like instance of either WorkloadNetworkPublicIP or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkVirtualMachinesList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkPublicIPListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -3579,12 +3544,12 @@ def list_virtual_machines( def prepare_request(next_link=None): if not next_link: - request = build_list_virtual_machines_request( + request = build_list_public_i_ps_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_virtual_machines.metadata["url"], + template_url=self.list_public_i_ps.metadata["url"], headers=_headers, params=_params, ) @@ -3610,7 +3575,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkVirtualMachinesList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPublicIPListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -3634,28 +3599,26 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_virtual_machines.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines" + list_public_i_ps.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs" } @distributed_trace_async - async def get_virtual_machine( - self, resource_group_name: str, private_cloud_name: str, virtual_machine_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkVirtualMachine: - """Get a virtual machine by id in a private cloud workload network. - - Get a virtual machine by id in a private cloud workload network. + async def get_public_ip( + self, resource_group_name: str, private_cloud_name: str, public_ip_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkPublicIP: + """Get a WorkloadNetworkPublicIP. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param virtual_machine_id: Virtual Machine identifier. Required. - :type virtual_machine_id: str + :param public_ip_id: ID of the DNS zone. Required. + :type public_ip_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkVirtualMachine or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine + :return: WorkloadNetworkPublicIP or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -3670,15 +3633,15 @@ async def get_virtual_machine( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkVirtualMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) - request = build_get_virtual_machine_request( + request = build_get_public_ip_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - virtual_machine_id=virtual_machine_id, + public_ip_id=public_ip_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_virtual_machine.metadata["url"], + template_url=self.get_public_ip.metadata["url"], headers=_headers, params=_params, ) @@ -3697,43 +3660,25 @@ async def get_virtual_machine( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkVirtualMachine", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_virtual_machine.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}" + get_public_ip.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" } - @distributed_trace - def list_dns_services( - self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkloadNetworkDnsService"]: - """List of DNS services in a private cloud workload network. - - List of DNS services in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkDnsService or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDnsService] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDnsServicesList] = kwargs.pop("cls", None) - + async def _create_public_ip_initial( + self, + resource_group_name: str, + private_cloud_name: str, + public_ip_id: str, + workload_network_public_ip: Union[_models.WorkloadNetworkPublicIP, IO], + **kwargs: Any + ) -> _models.WorkloadNetworkPublicIP: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3742,238 +3687,89 @@ def list_dns_services( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_dns_services_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_dns_services.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsServicesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(workload_network_public_ip, (IOBase, bytes)): + _content = workload_network_public_ip + else: + _json = self._serialize.body(workload_network_public_ip, "WorkloadNetworkPublicIP") - async def get_next(next_link=None): - request = prepare_request(next_link) + request = build_create_public_ip_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + public_ip_id=public_ip_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_public_ip_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_dns_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices" - } - - @distributed_trace_async - async def get_dns_service( - self, resource_group_name: str, private_cloud_name: str, dns_service_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkDnsService: - """Get a DNS service by id in a private cloud workload network. - - Get a DNS service by id in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkDnsService or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsService - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) - - request = build_get_dns_service_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - dns_service_id=dns_service_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_dns_service.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_dns_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" - } - - async def _create_dns_service_initial( - self, - resource_group_name: str, - private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], - **kwargs: Any - ) -> _models.WorkloadNetworkDnsService: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(workload_network_dns_service, (IOBase, bytes)): - _content = workload_network_dns_service - else: - _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsService") - - request = build_create_dns_service_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - dns_service_id=dns_service_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_dns_service_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response + response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_dns_service_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + _create_public_ip_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" } @overload - async def begin_create_dns_service( + async def begin_create_public_ip( self, resource_group_name: str, private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: _models.WorkloadNetworkDnsService, + public_ip_id: str, + workload_network_public_ip: _models.WorkloadNetworkPublicIP, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: - """Create a DNS service by id in a private cloud workload network. - - Create a DNS service by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkPublicIP]: + """Create a WorkloadNetworkPublicIP. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Required. - :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService + :param public_ip_id: ID of the DNS zone. Required. + :type public_ip_id: str + :param workload_network_public_ip: Resource create parameters. Required. + :type workload_network_public_ip: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3985,37 +3781,34 @@ async def begin_create_dns_service( :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 WorkloadNetworkDnsService or the + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkPublicIP or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_dns_service( + async def begin_create_public_ip( self, resource_group_name: str, private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: IO, + public_ip_id: str, + workload_network_public_ip: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: - """Create a DNS service by id in a private cloud workload network. - - Create a DNS service by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkPublicIP]: + """Create a WorkloadNetworkPublicIP. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Required. - :type workload_network_dns_service: IO + :param public_ip_id: ID of the DNS zone. Required. + :type public_ip_id: str + :param workload_network_public_ip: Resource create parameters. Required. + :type workload_network_public_ip: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -4027,36 +3820,33 @@ async def begin_create_dns_service( :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 WorkloadNetworkDnsService or the + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkPublicIP or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_dns_service( + async def begin_create_public_ip( self, resource_group_name: str, private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], + public_ip_id: str, + workload_network_public_ip: Union[_models.WorkloadNetworkPublicIP, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: - """Create a DNS service by id in a private cloud workload network. - - Create a DNS service by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkPublicIP]: + """Create a WorkloadNetworkPublicIP. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Is either a WorkloadNetworkDnsService - type or a IO type. Required. - :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or IO + :param public_ip_id: ID of the DNS zone. Required. + :type public_ip_id: str + :param workload_network_public_ip: Resource create parameters. Is either a + WorkloadNetworkPublicIP type or a IO type. Required. + :type workload_network_public_ip: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -4068,9 +3858,9 @@ async def begin_create_dns_service( :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 WorkloadNetworkDnsService or the + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkPublicIP or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4078,16 +3868,16 @@ async def begin_create_dns_service( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_dns_service_initial( + raw_result = await self._create_public_ip_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_service_id=dns_service_id, - workload_network_dns_service=workload_network_dns_service, + public_ip_id=public_ip_id, + workload_network_public_ip=workload_network_public_ip, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -4098,13 +3888,16 @@ async def begin_create_dns_service( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4118,18 +3911,13 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_dns_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + begin_create_public_ip.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" } - async def _update_dns_service_initial( - self, - resource_group_name: str, - private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], - **kwargs: Any - ) -> Optional[_models.WorkloadNetworkDnsService]: + async def _delete_public_ip_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, public_ip_id: str, private_cloud_name: str, **kwargs: Any + ) -> None: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4138,31 +3926,19 @@ async def _update_dns_service_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkDnsService]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(workload_network_dns_service, (IOBase, bytes)): - _content = workload_network_dns_service - else: - _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsService") + cls: ClsType[None] = kwargs.pop("cls", None) - request = build_update_dns_service_request( + request = build_delete_public_ip_request( resource_group_name=resource_group_name, + public_ip_id=public_ip_id, private_cloud_name=private_cloud_name, - dns_service_id=dns_service_id, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_dns_service_initial.metadata["url"], + template_url=self._delete_public_ip_initial.metadata["url"], headers=_headers, params=_params, ) @@ -4176,260 +3952,34 @@ async def _update_dns_service_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, None, response_headers) - _update_dns_service_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" - } - - @overload - async def begin_update_dns_service( - self, - resource_group_name: str, - private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: _models.WorkloadNetworkDnsService, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: - """Create or update a DNS service by id in a private cloud workload network. - - Create or update a DNS service by id in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Required. - :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: 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: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsService or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_dns_service( - self, - resource_group_name: str, - private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: - """Create or update a DNS service by id in a private cloud workload network. - - Create or update a DNS service by id in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Required. - :type workload_network_dns_service: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: 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: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsService or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_dns_service( - self, - resource_group_name: str, - private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsService]: - """Create or update a DNS service by id in a private cloud workload network. - - Create or update a DNS service by id in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Is either a WorkloadNetworkDnsService - type or a IO type. Required. - :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either WorkloadNetworkDnsService or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_dns_service_initial( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - dns_service_id=dns_service_id, - workload_network_dns_service=workload_network_dns_service, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, 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, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_dns_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" - } - - async def _delete_dns_service_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, dns_service_id: str, private_cloud_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_dns_service_request( - resource_group_name=resource_group_name, - dns_service_id=dns_service_id, - private_cloud_name=private_cloud_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_dns_service_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_dns_service_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + _delete_public_ip_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" } @distributed_trace_async - async def begin_delete_dns_service( - self, resource_group_name: str, dns_service_id: str, private_cloud_name: str, **kwargs: Any + async def begin_delete_public_ip( + self, resource_group_name: str, public_ip_id: str, private_cloud_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a DNS service by id in a private cloud workload network. - - Delete a DNS service by id in a private cloud workload network. + """Delete a WorkloadNetworkPublicIP. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str + :param public_ip_id: ID of the DNS zone. Required. + :type public_ip_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -4453,9 +4003,9 @@ async def begin_delete_dns_service( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_dns_service_initial( # type: ignore + raw_result = await self._delete_public_ip_initial( # type: ignore resource_group_name=resource_group_name, - dns_service_id=dns_service_id, + public_ip_id=public_ip_id, private_cloud_name=private_cloud_name, api_version=api_version, cls=lambda x, y, z: x, @@ -4470,7 +4020,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4484,17 +4036,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_dns_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + begin_delete_public_ip.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" } @distributed_trace - def list_dns_zones( + def list_segments( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkloadNetworkDnsZone"]: - """List of DNS zones in a private cloud workload network. - - List of DNS zones in a private cloud workload network. + ) -> AsyncIterable["_models.WorkloadNetworkSegment"]: + """List WorkloadNetworkSegment resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4502,16 +4052,16 @@ def list_dns_zones( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkDnsZone or the result of + :return: An iterator like instance of either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDnsZonesList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkSegmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4524,12 +4074,12 @@ def list_dns_zones( def prepare_request(next_link=None): if not next_link: - request = build_list_dns_zones_request( + request = build_list_segments_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_dns_zones.metadata["url"], + template_url=self.list_segments.metadata["url"], headers=_headers, params=_params, ) @@ -4555,7 +4105,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsZonesList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegmentListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -4579,29 +4129,26 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_dns_zones.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones" + list_segments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments" } @distributed_trace_async - async def get_dns_zone( - self, resource_group_name: str, private_cloud_name: str, dns_zone_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkDnsZone: - """Get a DNS zone by id in a private cloud workload network. - - Get a DNS zone by id in a private cloud workload network. + async def get_segment( + self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkSegment: + """Get a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkDnsZone or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone + :return: WorkloadNetworkSegment or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkSegment :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -4616,15 +4163,15 @@ async def get_dns_zone( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) - request = build_get_dns_zone_request( + request = build_get_segment_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_zone_id=dns_zone_id, + segment_id=segment_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_dns_zone.metadata["url"], + template_url=self.get_segment.metadata["url"], headers=_headers, params=_params, ) @@ -4643,25 +4190,25 @@ async def get_dns_zone( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dns_zone.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + get_segment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } - async def _create_dns_zone_initial( + async def _create_segments_initial( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], + segment_id: str, + workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], **kwargs: Any - ) -> _models.WorkloadNetworkDnsZone: + ) -> _models.WorkloadNetworkSegment: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4675,26 +4222,26 @@ async def _create_dns_zone_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_zone, (IOBase, bytes)): - _content = workload_network_dns_zone + if isinstance(workload_network_segment, (IOBase, bytes)): + _content = workload_network_segment else: - _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZone") + _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegment") - request = build_create_dns_zone_request( + request = build_create_segments_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_zone_id=dns_zone_id, + segment_id=segment_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._create_dns_zone_initial.metadata["url"], + template_url=self._create_segments_initial.metadata["url"], headers=_headers, params=_params, ) @@ -4713,46 +4260,46 @@ async def _create_dns_zone_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_dns_zone_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + _create_segments_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } @overload - async def begin_create_dns_zone( + async def begin_create_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: _models.WorkloadNetworkDnsZone, + segment_id: str, + workload_network_segment: _models.WorkloadNetworkSegment, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: - """Create a DNS zone by id in a private cloud workload network. - - Create a DNS zone by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: + """Create a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Required. - :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: Resource create parameters. Required. + :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4764,37 +4311,34 @@ async def begin_create_dns_zone( :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 WorkloadNetworkDnsZone or the result + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_dns_zone( + async def begin_create_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: IO, + segment_id: str, + workload_network_segment: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: - """Create a DNS zone by id in a private cloud workload network. - - Create a DNS zone by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: + """Create a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Required. - :type workload_network_dns_zone: IO + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: Resource create parameters. Required. + :type workload_network_segment: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -4806,36 +4350,33 @@ async def begin_create_dns_zone( :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 WorkloadNetworkDnsZone or the result + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_dns_zone( + async def begin_create_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], + segment_id: str, + workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: - """Create a DNS zone by id in a private cloud workload network. - - Create a DNS zone by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: + """Create a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Is either a WorkloadNetworkDnsZone type or a IO - type. Required. - :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or IO + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: Resource create parameters. Is either a WorkloadNetworkSegment + type or a IO type. Required. + :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -4847,9 +4388,9 @@ async def begin_create_dns_zone( :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 WorkloadNetworkDnsZone or the result + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4857,16 +4398,16 @@ async def begin_create_dns_zone( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_dns_zone_initial( + raw_result = await self._create_segments_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_zone_id=dns_zone_id, - workload_network_dns_zone=workload_network_dns_zone, + segment_id=segment_id, + workload_network_segment=workload_network_segment, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -4877,13 +4418,16 @@ async def begin_create_dns_zone( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4897,18 +4441,18 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_dns_zone.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + begin_create_segments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } - async def _update_dns_zone_initial( + async def _update_segments_initial( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], + segment_id: str, + workload_network_segment: Union[_models.WorkloadNetworkSegmentUpdate, IO], **kwargs: Any - ) -> Optional[_models.WorkloadNetworkDnsZone]: + ) -> Optional[_models.WorkloadNetworkSegment]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4922,26 +4466,26 @@ async def _update_dns_zone_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkDnsZone]] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkSegment]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_zone, (IOBase, bytes)): - _content = workload_network_dns_zone + if isinstance(workload_network_segment, (IOBase, bytes)): + _content = workload_network_segment else: - _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZone") + _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegmentUpdate") - request = build_update_dns_zone_request( + request = build_update_segments_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_zone_id=dns_zone_id, + segment_id=segment_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._update_dns_zone_initial.metadata["url"], + template_url=self._update_segments_initial.metadata["url"], headers=_headers, params=_params, ) @@ -4961,43 +4505,45 @@ async def _update_dns_zone_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_dns_zone_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + _update_segments_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } @overload - async def begin_update_dns_zone( + async def begin_update_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: _models.WorkloadNetworkDnsZone, + segment_id: str, + workload_network_segment: _models.WorkloadNetworkSegmentUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: - """Create or update a DNS zone by id in a private cloud workload network. - - Create or update a DNS zone by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: + """Update a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Required. - :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: The resource properties to be updated. Required. + :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegmentUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5009,37 +4555,34 @@ async def begin_update_dns_zone( :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 WorkloadNetworkDnsZone or the result + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update_dns_zone( + async def begin_update_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: IO, + segment_id: str, + workload_network_segment: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: - """Create or update a DNS zone by id in a private cloud workload network. - - Create or update a DNS zone by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: + """Update a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Required. - :type workload_network_dns_zone: IO + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: The resource properties to be updated. Required. + :type workload_network_segment: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5051,36 +4594,33 @@ async def begin_update_dns_zone( :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 WorkloadNetworkDnsZone or the result + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_update_dns_zone( + async def begin_update_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], + segment_id: str, + workload_network_segment: Union[_models.WorkloadNetworkSegmentUpdate, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkDnsZone]: - """Create or update a DNS zone by id in a private cloud workload network. - - Create or update a DNS zone by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkSegment]: + """Update a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Is either a WorkloadNetworkDnsZone type or a IO - type. Required. - :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or IO + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: The resource properties to be updated. Is either a + WorkloadNetworkSegmentUpdate type or a IO type. Required. + :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegmentUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -5092,9 +4632,9 @@ async def begin_update_dns_zone( :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 WorkloadNetworkDnsZone or the result + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5102,16 +4642,16 @@ async def begin_update_dns_zone( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_dns_zone_initial( + raw_result = await self._update_segments_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_zone_id=dns_zone_id, - workload_network_dns_zone=workload_network_dns_zone, + segment_id=segment_id, + workload_network_segment=workload_network_segment, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -5122,13 +4662,15 @@ async def begin_update_dns_zone( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -5142,12 +4684,12 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_dns_zone.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + begin_update_segments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } - async def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, dns_zone_id: str, private_cloud_name: str, **kwargs: Any + async def _delete_segment_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -5163,13 +4705,13 @@ async def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-state api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_dns_zone_request( + request = build_delete_segment_request( resource_group_name=resource_group_name, - dns_zone_id=dns_zone_id, private_cloud_name=private_cloud_name, + segment_id=segment_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_dns_zone_initial.metadata["url"], + template_url=self._delete_segment_initial.metadata["url"], headers=_headers, params=_params, ) @@ -5188,29 +4730,31 @@ async def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-state error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_dns_zone_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + _delete_segment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } @distributed_trace_async - async def begin_delete_dns_zone( - self, resource_group_name: str, dns_zone_id: str, private_cloud_name: str, **kwargs: Any + async def begin_delete_segment( + self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a DNS zone by id in a private cloud workload network. - - Delete a DNS zone by id in a private cloud workload network. + """Delete a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: 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: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -5232,10 +4776,10 @@ async def begin_delete_dns_zone( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_dns_zone_initial( # type: ignore + raw_result = await self._delete_segment_initial( # type: ignore resource_group_name=resource_group_name, - dns_zone_id=dns_zone_id, private_cloud_name=private_cloud_name, + segment_id=segment_id, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -5249,7 +4793,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -5263,17 +4809,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_dns_zone.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + begin_delete_segment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } @distributed_trace - def list_public_i_ps( + def list_virtual_machines( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkloadNetworkPublicIP"]: - """List of Public IP Blocks in a private cloud workload network. - - List of Public IP Blocks in a private cloud workload network. + ) -> AsyncIterable["_models.WorkloadNetworkVirtualMachine"]: + """List WorkloadNetworkVirtualMachine resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5281,16 +4825,17 @@ def list_public_i_ps( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkPublicIP or the result of + :return: An iterator like instance of either WorkloadNetworkVirtualMachine or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkPublicIPsList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkVirtualMachineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -5303,12 +4848,12 @@ def list_public_i_ps( def prepare_request(next_link=None): if not next_link: - request = build_list_public_i_ps_request( + request = build_list_virtual_machines_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_public_i_ps.metadata["url"], + template_url=self.list_virtual_machines.metadata["url"], headers=_headers, params=_params, ) @@ -5334,7 +4879,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkPublicIPsList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkVirtualMachineListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -5358,89 +4903,491 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_public_i_ps.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs" + list_virtual_machines.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines" } @distributed_trace_async - async def get_public_ip( - self, resource_group_name: str, private_cloud_name: str, public_ip_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkPublicIP: - """Get a Public IP Block by id in a private cloud workload network. - - Get a Public IP Block by id in a private cloud workload network. + async def get_virtual_machine( + self, resource_group_name: str, private_cloud_name: str, virtual_machine_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkVirtualMachine: + """Get a WorkloadNetworkVirtualMachine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param virtual_machine_id: ID of the virtual machine. Required. + :type virtual_machine_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkloadNetworkVirtualMachine or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetworkVirtualMachine] = kwargs.pop("cls", None) + + request = build_get_virtual_machine_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + virtual_machine_id=virtual_machine_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_virtual_machine.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WorkloadNetworkVirtualMachine", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_virtual_machine.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}" + } + + @distributed_trace + def list_vm_groups( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> AsyncIterable["_models.WorkloadNetworkVMGroup"]: + """List WorkloadNetworkVMGroup resources by WorkloadNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkloadNetworkVMGroup or the result of + cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetworkVMGroupListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_vm_groups_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_vm_groups.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("WorkloadNetworkVMGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_vm_groups.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups" + } + + @distributed_trace_async + async def get_vm_group( + self, resource_group_name: str, private_cloud_name: str, vm_group_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkVMGroup: + """Get a WorkloadNetworkVMGroup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkloadNetworkVMGroup or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + + request = build_get_vm_group_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + vm_group_id=vm_group_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_vm_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_vm_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + } + + async def _create_vm_group_initial( + self, + resource_group_name: str, + private_cloud_name: str, + vm_group_id: str, + workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], + **kwargs: Any + ) -> _models.WorkloadNetworkVMGroup: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(workload_network_vm_group, (IOBase, bytes)): + _content = workload_network_vm_group + else: + _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroup") + + request = build_create_vm_group_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + vm_group_id=vm_group_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_vm_group_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + _create_vm_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + } + + @overload + async def begin_create_vm_group( + self, + resource_group_name: str, + private_cloud_name: str, + vm_group_id: str, + workload_network_vm_group: _models.WorkloadNetworkVMGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: + """Create a WorkloadNetworkVMGroup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: Resource create parameters. Required. + :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: 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: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkVMGroup or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_vm_group( + self, + resource_group_name: str, + private_cloud_name: str, + vm_group_id: str, + workload_network_vm_group: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: + """Create a WorkloadNetworkVMGroup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: Resource create parameters. Required. + :type workload_network_vm_group: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: 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: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkVMGroup or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_vm_group( + self, + resource_group_name: str, + private_cloud_name: str, + vm_group_id: str, + workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: + """Create a WorkloadNetworkVMGroup. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP - Block's display name. Required. - :type public_ip_id: str + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: Resource create parameters. Is either a + WorkloadNetworkVMGroup type or a IO type. Required. + :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkPublicIP or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkVMGroup or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) - - request = build_get_public_ip_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - public_ip_id=public_ip_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_public_ip.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_vm_group_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + vm_group_id=vm_group_id, + workload_network_vm_group=workload_network_vm_group, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) - if cls: - return cls(pipeline_response, deserialized, {}) + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized - return deserialized + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - get_public_ip.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + begin_create_vm_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" } - async def _create_public_ip_initial( + async def _update_vm_group_initial( self, resource_group_name: str, private_cloud_name: str, - public_ip_id: str, - workload_network_public_ip: Union[_models.WorkloadNetworkPublicIP, IO], + vm_group_id: str, + workload_network_vm_group: Union[_models.WorkloadNetworkVMGroupUpdate, IO], **kwargs: Any - ) -> _models.WorkloadNetworkPublicIP: + ) -> Optional[_models.WorkloadNetworkVMGroup]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5454,26 +5401,26 @@ async def _create_public_ip_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkVMGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_public_ip, (IOBase, bytes)): - _content = workload_network_public_ip + if isinstance(workload_network_vm_group, (IOBase, bytes)): + _content = workload_network_vm_group else: - _json = self._serialize.body(workload_network_public_ip, "WorkloadNetworkPublicIP") + _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroupUpdate") - request = build_create_public_ip_request( + request = build_update_vm_group_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - public_ip_id=public_ip_id, + vm_group_id=vm_group_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._create_public_ip_initial.metadata["url"], + template_url=self._update_vm_group_initial.metadata["url"], headers=_headers, params=_params, ) @@ -5487,51 +5434,51 @@ async def _create_public_ip_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) - if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) - return deserialized # type: ignore + return deserialized - _create_public_ip_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + _update_vm_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" } @overload - async def begin_create_public_ip( + async def begin_update_vm_group( self, resource_group_name: str, private_cloud_name: str, - public_ip_id: str, - workload_network_public_ip: _models.WorkloadNetworkPublicIP, + vm_group_id: str, + workload_network_vm_group: _models.WorkloadNetworkVMGroupUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkPublicIP]: - """Create a Public IP Block by id in a private cloud workload network. - - Create a Public IP Block by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: + """Update a WorkloadNetworkVMGroup. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP - Block's display name. Required. - :type public_ip_id: str - :param workload_network_public_ip: NSX Public IP Block. Required. - :type workload_network_public_ip: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: The resource properties to be updated. Required. + :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroupUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5543,37 +5490,34 @@ async def begin_create_public_ip( :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 WorkloadNetworkPublicIP or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkVMGroup or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_public_ip( + async def begin_update_vm_group( self, resource_group_name: str, private_cloud_name: str, - public_ip_id: str, - workload_network_public_ip: IO, + vm_group_id: str, + workload_network_vm_group: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkPublicIP]: - """Create a Public IP Block by id in a private cloud workload network. - - Create a Public IP Block by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: + """Update a WorkloadNetworkVMGroup. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP - Block's display name. Required. - :type public_ip_id: str - :param workload_network_public_ip: NSX Public IP Block. Required. - :type workload_network_public_ip: IO + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: The resource properties to be updated. Required. + :type workload_network_vm_group: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5585,36 +5529,33 @@ async def begin_create_public_ip( :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 WorkloadNetworkPublicIP or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkVMGroup or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_public_ip( + async def begin_update_vm_group( self, resource_group_name: str, private_cloud_name: str, - public_ip_id: str, - workload_network_public_ip: Union[_models.WorkloadNetworkPublicIP, IO], + vm_group_id: str, + workload_network_vm_group: Union[_models.WorkloadNetworkVMGroupUpdate, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadNetworkPublicIP]: - """Create a Public IP Block by id in a private cloud workload network. - - Create a Public IP Block by id in a private cloud workload network. + ) -> AsyncLROPoller[_models.WorkloadNetworkVMGroup]: + """Update a WorkloadNetworkVMGroup. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP - Block's display name. Required. - :type public_ip_id: str - :param workload_network_public_ip: NSX Public IP Block. Is either a WorkloadNetworkPublicIP - type or a IO type. Required. - :type workload_network_public_ip: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP or IO + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: The resource properties to be updated. Is either a + WorkloadNetworkVMGroupUpdate type or a IO type. Required. + :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroupUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -5626,9 +5567,9 @@ async def begin_create_public_ip( :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 WorkloadNetworkPublicIP or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + :return: An instance of AsyncLROPoller that returns either WorkloadNetworkVMGroup or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5636,16 +5577,16 @@ async def begin_create_public_ip( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_public_ip_initial( + raw_result = await self._update_vm_group_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - public_ip_id=public_ip_id, - workload_network_public_ip=workload_network_public_ip, + vm_group_id=vm_group_id, + workload_network_vm_group=workload_network_vm_group, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -5656,13 +5597,15 @@ async def begin_create_public_ip( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -5676,12 +5619,12 @@ def get_long_running_output(pipeline_response): ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_public_ip.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + begin_update_vm_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" } - async def _delete_public_ip_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, public_ip_id: str, private_cloud_name: str, **kwargs: Any + async def _delete_vm_group_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, vm_group_id: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -5697,13 +5640,13 @@ async def _delete_public_ip_initial( # pylint: disable=inconsistent-return-stat api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_public_ip_request( + request = build_delete_vm_group_request( resource_group_name=resource_group_name, - public_ip_id=public_ip_id, + vm_group_id=vm_group_id, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_public_ip_initial.metadata["url"], + template_url=self._delete_vm_group_initial.metadata["url"], headers=_headers, params=_params, ) @@ -5722,27 +5665,29 @@ async def _delete_public_ip_initial( # pylint: disable=inconsistent-return-stat error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_public_ip_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + _delete_vm_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" } @distributed_trace_async - async def begin_delete_public_ip( - self, resource_group_name: str, public_ip_id: str, private_cloud_name: str, **kwargs: Any + async def begin_delete_vm_group( + self, resource_group_name: str, vm_group_id: str, private_cloud_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a Public IP Block by id in a private cloud workload network. - - Delete a Public IP Block by id in a private cloud workload network. + """Delete a WorkloadNetworkVMGroup. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP - Block's display name. Required. - :type public_ip_id: str + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -5766,9 +5711,9 @@ async def begin_delete_public_ip( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_public_ip_initial( # type: ignore + raw_result = await self._delete_vm_group_initial( # type: ignore resource_group_name=resource_group_name, - public_ip_id=public_ip_id, + vm_group_id=vm_group_id, private_cloud_name=private_cloud_name, api_version=api_version, cls=lambda x, y, z: x, @@ -5783,7 +5728,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -5797,6 +5744,6 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_public_ip.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + begin_delete_vm_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" } diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py index 3e1a3e5014b4..148095a5ac12 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py @@ -9,7 +9,7 @@ from ._models_py3 import Addon from ._models_py3 import AddonArcProperties from ._models_py3 import AddonHcxProperties -from ._models_py3 import AddonList +from ._models_py3 import AddonListResult from ._models_py3 import AddonProperties from ._models_py3 import AddonSrmProperties from ._models_py3 import AddonVrProperties @@ -17,17 +17,16 @@ from ._models_py3 import AvailabilityProperties from ._models_py3 import Circuit from ._models_py3 import CloudLink -from ._models_py3 import CloudLinkList +from ._models_py3 import CloudLinkListResult from ._models_py3 import Cluster -from ._models_py3 import ClusterList -from ._models_py3 import ClusterProperties +from ._models_py3 import ClusterListResult from ._models_py3 import ClusterUpdate from ._models_py3 import ClusterZone from ._models_py3 import ClusterZoneList -from ._models_py3 import CommonClusterProperties from ._models_py3 import Datastore -from ._models_py3 import DatastoreList +from ._models_py3 import DatastoreListResult from ._models_py3 import DiskPoolVolume +from ._models_py3 import ElasticSanVolume from ._models_py3 import Encryption from ._models_py3 import EncryptionKeyVaultProperties from ._models_py3 import Endpoints @@ -35,104 +34,116 @@ from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse from ._models_py3 import ExpressRouteAuthorization -from ._models_py3 import ExpressRouteAuthorizationList +from ._models_py3 import ExpressRouteAuthorizationListResult from ._models_py3 import GlobalReachConnection -from ._models_py3 import GlobalReachConnectionList +from ._models_py3 import GlobalReachConnectionListResult from ._models_py3 import HcxEnterpriseSite -from ._models_py3 import HcxEnterpriseSiteList +from ._models_py3 import HcxEnterpriseSiteListResult from ._models_py3 import IdentitySource -from ._models_py3 import LogSpecification +from ._models_py3 import IscsiPath +from ._models_py3 import IscsiPathListResult from ._models_py3 import ManagementCluster -from ._models_py3 import MetricDimension -from ._models_py3 import MetricSpecification from ._models_py3 import NetAppVolume from ._models_py3 import Operation from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import OperationProperties +from ._models_py3 import OperationListResult from ._models_py3 import PSCredentialExecutionParameter -from ._models_py3 import PlacementPoliciesList from ._models_py3 import PlacementPolicy +from ._models_py3 import PlacementPolicyListResult from ._models_py3 import PlacementPolicyProperties from ._models_py3 import PlacementPolicyUpdate from ._models_py3 import PrivateCloud -from ._models_py3 import PrivateCloudIdentity -from ._models_py3 import PrivateCloudList -from ._models_py3 import PrivateCloudProperties +from ._models_py3 import PrivateCloudListResult from ._models_py3 import PrivateCloudUpdate -from ._models_py3 import PrivateCloudUpdateProperties from ._models_py3 import ProxyResource from ._models_py3 import Quota from ._models_py3 import Resource from ._models_py3 import ScriptCmdlet -from ._models_py3 import ScriptCmdletsList +from ._models_py3 import ScriptCmdletListResult from ._models_py3 import ScriptExecution +from ._models_py3 import ScriptExecutionListResult from ._models_py3 import ScriptExecutionParameter -from ._models_py3 import ScriptExecutionsList from ._models_py3 import ScriptPackage -from ._models_py3 import ScriptPackagesList +from ._models_py3 import ScriptPackageListResult from ._models_py3 import ScriptParameter from ._models_py3 import ScriptSecureStringExecutionParameter from ._models_py3 import ScriptStringExecutionParameter -from ._models_py3 import ServiceSpecification from ._models_py3 import Sku +from ._models_py3 import SystemAssignedServiceIdentity +from ._models_py3 import SystemData from ._models_py3 import TrackedResource from ._models_py3 import Trial from ._models_py3 import VirtualMachine +from ._models_py3 import VirtualMachineListResult from ._models_py3 import VirtualMachineRestrictMovement -from ._models_py3 import VirtualMachinesList from ._models_py3 import VmHostPlacementPolicyProperties from ._models_py3 import VmPlacementPolicyProperties from ._models_py3 import WorkloadNetwork from ._models_py3 import WorkloadNetworkDhcp from ._models_py3 import WorkloadNetworkDhcpEntity -from ._models_py3 import WorkloadNetworkDhcpList +from ._models_py3 import WorkloadNetworkDhcpEntityUpdate +from ._models_py3 import WorkloadNetworkDhcpListResult from ._models_py3 import WorkloadNetworkDhcpRelay +from ._models_py3 import WorkloadNetworkDhcpRelayUpdate from ._models_py3 import WorkloadNetworkDhcpServer +from ._models_py3 import WorkloadNetworkDhcpServerUpdate +from ._models_py3 import WorkloadNetworkDhcpUpdate from ._models_py3 import WorkloadNetworkDnsService -from ._models_py3 import WorkloadNetworkDnsServicesList +from ._models_py3 import WorkloadNetworkDnsServiceListResult +from ._models_py3 import WorkloadNetworkDnsServiceUpdate from ._models_py3 import WorkloadNetworkDnsZone -from ._models_py3 import WorkloadNetworkDnsZonesList +from ._models_py3 import WorkloadNetworkDnsZoneListResult +from ._models_py3 import WorkloadNetworkDnsZoneUpdate from ._models_py3 import WorkloadNetworkGateway -from ._models_py3 import WorkloadNetworkGatewayList -from ._models_py3 import WorkloadNetworkList +from ._models_py3 import WorkloadNetworkGatewayListResult +from ._models_py3 import WorkloadNetworkListResult from ._models_py3 import WorkloadNetworkPortMirroring -from ._models_py3 import WorkloadNetworkPortMirroringList +from ._models_py3 import WorkloadNetworkPortMirroringListResult +from ._models_py3 import WorkloadNetworkPortMirroringUpdate from ._models_py3 import WorkloadNetworkPublicIP -from ._models_py3 import WorkloadNetworkPublicIPsList +from ._models_py3 import WorkloadNetworkPublicIPListResult from ._models_py3 import WorkloadNetworkSegment +from ._models_py3 import WorkloadNetworkSegmentListResult from ._models_py3 import WorkloadNetworkSegmentPortVif from ._models_py3 import WorkloadNetworkSegmentSubnet -from ._models_py3 import WorkloadNetworkSegmentsList +from ._models_py3 import WorkloadNetworkSegmentUpdate from ._models_py3 import WorkloadNetworkVMGroup -from ._models_py3 import WorkloadNetworkVMGroupsList +from ._models_py3 import WorkloadNetworkVMGroupListResult +from ._models_py3 import WorkloadNetworkVMGroupUpdate from ._models_py3 import WorkloadNetworkVirtualMachine -from ._models_py3 import WorkloadNetworkVirtualMachinesList +from ._models_py3 import WorkloadNetworkVirtualMachineListResult +from ._avs_client_enums import ActionType from ._avs_client_enums import AddonProvisioningState from ._avs_client_enums import AddonType from ._avs_client_enums import AffinityStrength from ._avs_client_enums import AffinityType from ._avs_client_enums import AvailabilityStrategy from ._avs_client_enums import AzureHybridBenefitType +from ._avs_client_enums import CloudLinkProvisioningState from ._avs_client_enums import CloudLinkStatus from ._avs_client_enums import ClusterProvisioningState +from ._avs_client_enums import CreatedByType from ._avs_client_enums import DatastoreProvisioningState from ._avs_client_enums import DatastoreStatus from ._avs_client_enums import DhcpTypeEnum from ._avs_client_enums import DnsServiceLogLevelEnum from ._avs_client_enums import DnsServiceStatusEnum +from ._avs_client_enums import DnsZoneType from ._avs_client_enums import EncryptionKeyStatus from ._avs_client_enums import EncryptionState from ._avs_client_enums import EncryptionVersionType from ._avs_client_enums import ExpressRouteAuthorizationProvisioningState from ._avs_client_enums import GlobalReachConnectionProvisioningState from ._avs_client_enums import GlobalReachConnectionStatus +from ._avs_client_enums import HcxEnterpriseSiteProvisioningState from ._avs_client_enums import HcxEnterpriseSiteStatus from ._avs_client_enums import InternetEnum +from ._avs_client_enums import IscsiPathProvisioningState from ._avs_client_enums import MountOptionEnum from ._avs_client_enums import NsxPublicIpQuotaRaisedEnum from ._avs_client_enums import OptionalParamEnum +from ._avs_client_enums import Origin from ._avs_client_enums import PlacementPolicyProvisioningState from ._avs_client_enums import PlacementPolicyState from ._avs_client_enums import PlacementPolicyType @@ -140,23 +151,28 @@ from ._avs_client_enums import PortMirroringStatusEnum from ._avs_client_enums import PrivateCloudProvisioningState from ._avs_client_enums import QuotaEnabled -from ._avs_client_enums import ResourceIdentityType +from ._avs_client_enums import ScriptCmdletAudience +from ._avs_client_enums import ScriptCmdletProvisioningState from ._avs_client_enums import ScriptExecutionParameterType from ._avs_client_enums import ScriptExecutionProvisioningState from ._avs_client_enums import ScriptOutputStreamType +from ._avs_client_enums import ScriptPackageProvisioningState from ._avs_client_enums import ScriptParameterTypes from ._avs_client_enums import SegmentStatusEnum +from ._avs_client_enums import SkuTier from ._avs_client_enums import SslEnum +from ._avs_client_enums import SystemAssignedServiceIdentityType from ._avs_client_enums import TrialStatus from ._avs_client_enums import VMGroupStatusEnum from ._avs_client_enums import VMTypeEnum +from ._avs_client_enums import VirtualMachineProvisioningState from ._avs_client_enums import VirtualMachineRestrictMovementState from ._avs_client_enums import VisibilityParameterEnum from ._avs_client_enums import WorkloadNetworkDhcpProvisioningState from ._avs_client_enums import WorkloadNetworkDnsServiceProvisioningState from ._avs_client_enums import WorkloadNetworkDnsZoneProvisioningState -from ._avs_client_enums import WorkloadNetworkName from ._avs_client_enums import WorkloadNetworkPortMirroringProvisioningState +from ._avs_client_enums import WorkloadNetworkProvisioningState from ._avs_client_enums import WorkloadNetworkPublicIPProvisioningState from ._avs_client_enums import WorkloadNetworkSegmentProvisioningState from ._avs_client_enums import WorkloadNetworkVMGroupProvisioningState @@ -168,7 +184,7 @@ "Addon", "AddonArcProperties", "AddonHcxProperties", - "AddonList", + "AddonListResult", "AddonProperties", "AddonSrmProperties", "AddonVrProperties", @@ -176,17 +192,16 @@ "AvailabilityProperties", "Circuit", "CloudLink", - "CloudLinkList", + "CloudLinkListResult", "Cluster", - "ClusterList", - "ClusterProperties", + "ClusterListResult", "ClusterUpdate", "ClusterZone", "ClusterZoneList", - "CommonClusterProperties", "Datastore", - "DatastoreList", + "DatastoreListResult", "DiskPoolVolume", + "ElasticSanVolume", "Encryption", "EncryptionKeyVaultProperties", "Endpoints", @@ -194,103 +209,115 @@ "ErrorDetail", "ErrorResponse", "ExpressRouteAuthorization", - "ExpressRouteAuthorizationList", + "ExpressRouteAuthorizationListResult", "GlobalReachConnection", - "GlobalReachConnectionList", + "GlobalReachConnectionListResult", "HcxEnterpriseSite", - "HcxEnterpriseSiteList", + "HcxEnterpriseSiteListResult", "IdentitySource", - "LogSpecification", + "IscsiPath", + "IscsiPathListResult", "ManagementCluster", - "MetricDimension", - "MetricSpecification", "NetAppVolume", "Operation", "OperationDisplay", - "OperationList", - "OperationProperties", + "OperationListResult", "PSCredentialExecutionParameter", - "PlacementPoliciesList", "PlacementPolicy", + "PlacementPolicyListResult", "PlacementPolicyProperties", "PlacementPolicyUpdate", "PrivateCloud", - "PrivateCloudIdentity", - "PrivateCloudList", - "PrivateCloudProperties", + "PrivateCloudListResult", "PrivateCloudUpdate", - "PrivateCloudUpdateProperties", "ProxyResource", "Quota", "Resource", "ScriptCmdlet", - "ScriptCmdletsList", + "ScriptCmdletListResult", "ScriptExecution", + "ScriptExecutionListResult", "ScriptExecutionParameter", - "ScriptExecutionsList", "ScriptPackage", - "ScriptPackagesList", + "ScriptPackageListResult", "ScriptParameter", "ScriptSecureStringExecutionParameter", "ScriptStringExecutionParameter", - "ServiceSpecification", "Sku", + "SystemAssignedServiceIdentity", + "SystemData", "TrackedResource", "Trial", "VirtualMachine", + "VirtualMachineListResult", "VirtualMachineRestrictMovement", - "VirtualMachinesList", "VmHostPlacementPolicyProperties", "VmPlacementPolicyProperties", "WorkloadNetwork", "WorkloadNetworkDhcp", "WorkloadNetworkDhcpEntity", - "WorkloadNetworkDhcpList", + "WorkloadNetworkDhcpEntityUpdate", + "WorkloadNetworkDhcpListResult", "WorkloadNetworkDhcpRelay", + "WorkloadNetworkDhcpRelayUpdate", "WorkloadNetworkDhcpServer", + "WorkloadNetworkDhcpServerUpdate", + "WorkloadNetworkDhcpUpdate", "WorkloadNetworkDnsService", - "WorkloadNetworkDnsServicesList", + "WorkloadNetworkDnsServiceListResult", + "WorkloadNetworkDnsServiceUpdate", "WorkloadNetworkDnsZone", - "WorkloadNetworkDnsZonesList", + "WorkloadNetworkDnsZoneListResult", + "WorkloadNetworkDnsZoneUpdate", "WorkloadNetworkGateway", - "WorkloadNetworkGatewayList", - "WorkloadNetworkList", + "WorkloadNetworkGatewayListResult", + "WorkloadNetworkListResult", "WorkloadNetworkPortMirroring", - "WorkloadNetworkPortMirroringList", + "WorkloadNetworkPortMirroringListResult", + "WorkloadNetworkPortMirroringUpdate", "WorkloadNetworkPublicIP", - "WorkloadNetworkPublicIPsList", + "WorkloadNetworkPublicIPListResult", "WorkloadNetworkSegment", + "WorkloadNetworkSegmentListResult", "WorkloadNetworkSegmentPortVif", "WorkloadNetworkSegmentSubnet", - "WorkloadNetworkSegmentsList", + "WorkloadNetworkSegmentUpdate", "WorkloadNetworkVMGroup", - "WorkloadNetworkVMGroupsList", + "WorkloadNetworkVMGroupListResult", + "WorkloadNetworkVMGroupUpdate", "WorkloadNetworkVirtualMachine", - "WorkloadNetworkVirtualMachinesList", + "WorkloadNetworkVirtualMachineListResult", + "ActionType", "AddonProvisioningState", "AddonType", "AffinityStrength", "AffinityType", "AvailabilityStrategy", "AzureHybridBenefitType", + "CloudLinkProvisioningState", "CloudLinkStatus", "ClusterProvisioningState", + "CreatedByType", "DatastoreProvisioningState", "DatastoreStatus", "DhcpTypeEnum", "DnsServiceLogLevelEnum", "DnsServiceStatusEnum", + "DnsZoneType", "EncryptionKeyStatus", "EncryptionState", "EncryptionVersionType", "ExpressRouteAuthorizationProvisioningState", "GlobalReachConnectionProvisioningState", "GlobalReachConnectionStatus", + "HcxEnterpriseSiteProvisioningState", "HcxEnterpriseSiteStatus", "InternetEnum", + "IscsiPathProvisioningState", "MountOptionEnum", "NsxPublicIpQuotaRaisedEnum", "OptionalParamEnum", + "Origin", "PlacementPolicyProvisioningState", "PlacementPolicyState", "PlacementPolicyType", @@ -298,23 +325,28 @@ "PortMirroringStatusEnum", "PrivateCloudProvisioningState", "QuotaEnabled", - "ResourceIdentityType", + "ScriptCmdletAudience", + "ScriptCmdletProvisioningState", "ScriptExecutionParameterType", "ScriptExecutionProvisioningState", "ScriptOutputStreamType", + "ScriptPackageProvisioningState", "ScriptParameterTypes", "SegmentStatusEnum", + "SkuTier", "SslEnum", + "SystemAssignedServiceIdentityType", "TrialStatus", "VMGroupStatusEnum", "VMTypeEnum", + "VirtualMachineProvisioningState", "VirtualMachineRestrictMovementState", "VisibilityParameterEnum", "WorkloadNetworkDhcpProvisioningState", "WorkloadNetworkDnsServiceProvisioningState", "WorkloadNetworkDnsZoneProvisioningState", - "WorkloadNetworkName", "WorkloadNetworkPortMirroringProvisioningState", + "WorkloadNetworkProvisioningState", "WorkloadNetworkPublicIPProvisioningState", "WorkloadNetworkSegmentProvisioningState", "WorkloadNetworkVMGroupProvisioningState", diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py index d0d1e671127a..2500e12f1e46 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py @@ -10,20 +10,33 @@ from azure.core import CaseInsensitiveEnumMeta +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" + + INTERNAL = "Internal" + + class AddonProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The state of the addon provisioning.""" + """Addon provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" CANCELLED = "Cancelled" + """is cancelled""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" class AddonType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of private cloud addon.""" + """Addon type.""" SRM = "SRM" VR = "VR" @@ -32,77 +45,131 @@ class AddonType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class AffinityStrength(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """VM-Host placement policy affinity strength (should/must).""" + """Affinity Strength.""" SHOULD = "Should" + """is should""" MUST = "Must" + """is must""" class AffinityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Placement policy affinity type.""" + """Affinity type.""" AFFINITY = "Affinity" + """is affinity""" ANTI_AFFINITY = "AntiAffinity" + """is anti-affinity""" class AvailabilityStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The availability strategy for the private cloud.""" + """Whether the private clouds is available in a single zone or two zones.""" SINGLE_ZONE = "SingleZone" + """in single zone""" DUAL_ZONE = "DualZone" + """in two zones""" class AzureHybridBenefitType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Placement policy hosts opt-in Azure Hybrid Benefit type.""" + """Azure Hybrid Benefit type.""" SQL_HOST = "SqlHost" + """is SqlHost""" NONE = "None" + """is None""" + + +class CloudLinkProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """cloud link provisioning state.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" class CloudLinkStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The state of the cloud link.""" + """Cloud Link status.""" ACTIVE = "Active" + """is active""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" FAILED = "Failed" + """is failed""" DISCONNECTED = "Disconnected" + """is disconnected""" class ClusterProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The state of the cluster provisioning.""" + """Cluster provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" CANCELLED = "Cancelled" + """is cancelled""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" class DatastoreProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The state of the datastore provisioning.""" + """datastore provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" CANCELLED = "Cancelled" + """is cancelled""" PENDING = "Pending" + """is pending""" CREATING = "Creating" + """is creating""" UPDATING = "Updating" + """is updating""" DELETING = "Deleting" - CANCELED = "Canceled" + """is deleting""" class DatastoreStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The operational status of the datastore.""" + """datastore status.""" UNKNOWN = "Unknown" + """is unknown""" ACCESSIBLE = "Accessible" + """is accessible""" INACCESSIBLE = "Inaccessible" + """is inaccessible""" ATTACHED = "Attached" + """is attached""" DETACHED = "Detached" + """is detached""" LOST_COMMUNICATION = "LostCommunication" + """is lost communication""" DEAD_OR_ERROR = "DeadOrError" + """is dead or error""" class DhcpTypeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -113,179 +180,300 @@ class DhcpTypeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): class DnsServiceLogLevelEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DNS Service log level.""" + """DNS service log level.""" DEBUG = "DEBUG" + """is debug""" INFO = "INFO" + """is info""" WARNING = "WARNING" + """is warning""" ERROR = "ERROR" + """is error""" FATAL = "FATAL" + """is fatal""" class DnsServiceStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DNS Service status.""" + """DNS service status.""" SUCCESS = "SUCCESS" + """is success""" FAILURE = "FAILURE" + """is failure""" + + +class DnsZoneType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of DNS zone.""" + + PUBLIC = "Public" + """Primary DNS zone.""" + PRIVATE = "Private" + """Private DNS zone.""" class EncryptionKeyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The state of key provided.""" + """Whether the the encryption key is connected or access denied.""" CONNECTED = "Connected" + """is connected""" ACCESS_DENIED = "AccessDenied" + """is access denied""" class EncryptionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of customer managed encryption key.""" + """Whether encryption is enabled or disabled.""" ENABLED = "Enabled" + """is enabled""" DISABLED = "Disabled" + """is disabled""" class EncryptionVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Property of the key if user provided or auto detected.""" + """Whether the encryption version is fixed or auto-detected.""" FIXED = "Fixed" + """is fixed""" AUTO_DETECTED = "AutoDetected" + """is auto-detected""" class ExpressRouteAuthorizationProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The state of the ExpressRoute Circuit Authorization provisioning.""" + """Express Route Circuit Authorization provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" - UPDATING = "Updating" + """Resource creation failed.""" CANCELED = "Canceled" + """Resource creation was canceled.""" + UPDATING = "Updating" + """is updating""" class GlobalReachConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The state of the ExpressRoute Circuit Authorization provisioning.""" + """Global Reach Connection provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" - UPDATING = "Updating" + """Resource creation failed.""" CANCELED = "Canceled" + """Resource creation was canceled.""" + UPDATING = "Updating" + """is updating""" class GlobalReachConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The connection status of the global reach connection.""" + """Global Reach Connection status.""" CONNECTED = "Connected" + """is connected""" CONNECTING = "Connecting" + """is connecting""" DISCONNECTED = "Disconnected" + """is disconnected""" + + +class HcxEnterpriseSiteProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """HCX Enterprise Site provisioning state.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" class HcxEnterpriseSiteStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of the HCX Enterprise Site.""" + """HCX Enterprise Site status.""" AVAILABLE = "Available" + """is available""" CONSUMED = "Consumed" + """is consumed""" DEACTIVATED = "Deactivated" + """is deactivated""" DELETED = "Deleted" + """is deleted""" class InternetEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Connectivity to internet is enabled or disabled.""" + """Whether internet is enabled or disabled.""" ENABLED = "Enabled" + """is enabled""" DISABLED = "Disabled" + """is disabled""" + + +class IscsiPathProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """private cloud provisioning state.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + PENDING = "Pending" + """is pending""" + BUILDING = "Building" + """is building""" + DELETING = "Deleting" + """is deleting""" + UPDATING = "Updating" + """is updating""" class MountOptionEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN.""" + """Mode that describes whether the LUN has to be mounted as a datastore or + attached as a LUN. + """ MOUNT = "MOUNT" + """is mount""" ATTACH = "ATTACH" + """is attach""" class NsxPublicIpQuotaRaisedEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Flag to indicate whether the private cloud has the quota for provisioned NSX Public IP count - raised from 64 to 1024. - """ + """NSX public IP quota raised.""" ENABLED = "Enabled" + """is enabled""" DISABLED = "Disabled" + """is disabled""" class OptionalParamEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is this parameter required or optional.""" + """Optional Param.""" OPTIONAL = "Optional" + """is optional""" REQUIRED = "Required" + """is required""" + + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is "user,system". + """ + + USER = "user" + SYSTEM = "system" + USER_SYSTEM = "user,system" class PlacementPolicyProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state.""" + """Placement Policy provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" class PlacementPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether the placement policy is enabled or disabled.""" + """Placement Policy state.""" ENABLED = "Enabled" + """is enabled""" DISABLED = "Disabled" + """is disabled""" class PlacementPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """placement policy type.""" + """Placement Policy type.""" VM_VM = "VmVm" VM_HOST = "VmHost" class PortMirroringDirectionEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Direction of port mirroring profile.""" + """Port Mirroring Direction.""" INGRESS = "INGRESS" + """is ingress""" EGRESS = "EGRESS" + """is egress""" BIDIRECTIONAL = "BIDIRECTIONAL" + """is bidirectional""" class PortMirroringStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Port Mirroring Status.""" + """Port Mirroring status.""" SUCCESS = "SUCCESS" + """is success""" FAILURE = "FAILURE" + """is failure""" class PrivateCloudProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state.""" + """private cloud provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" CANCELLED = "Cancelled" + """is cancelled""" PENDING = "Pending" + """is pending""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" class QuotaEnabled(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Host quota is active for current subscription.""" + """quote enabled.""" ENABLED = "Enabled" + """is enabled""" DISABLED = "Disabled" + """is disabled""" -class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity used for the private cloud. The type 'SystemAssigned' refers to an - implicitly created identity. The type 'None' will remove any identities from the Private Cloud. +class ScriptCmdletAudience(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies whether a script cmdlet is intended to be invoked only through automation or visible + to customers. """ - SYSTEM_ASSIGNED = "SystemAssigned" - NONE = "None" + AUTOMATION = "Automation" + """is automation""" + ANY = "Any" + """is any""" + + +class ScriptCmdletProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A script cmdlet provisioning state.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" class ScriptExecutionParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of execution parameter.""" + """script execution parameter type.""" VALUE = "Value" SECURE_VALUE = "SecureValue" @@ -293,167 +481,294 @@ class ScriptExecutionParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta) class ScriptExecutionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The state of the script execution resource.""" + """Script Execution provisioning state.""" - PENDING = "Pending" - RUNNING = "Running" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + PENDING = "Pending" + """is pending""" + RUNNING = "Running" + """is running""" CANCELLING = "Cancelling" + """is cancelling""" CANCELLED = "Cancelled" + """is cancelled""" DELETING = "Deleting" - CANCELED = "Canceled" + """is deleting""" class ScriptOutputStreamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ScriptOutputStreamType.""" + """Script Output Stream type.""" INFORMATION = "Information" + """is information""" WARNING = "Warning" + """is warning""" OUTPUT = "Output" + """is output""" ERROR = "Error" + """is error""" + + +class ScriptPackageProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Script Package provisioning state.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" class ScriptParameterTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of parameter the script is expecting. psCredential is a PSCredentialObject.""" + """Script Parameter types.""" STRING = "String" + """is string""" SECURE_STRING = "SecureString" + """is secure string""" CREDENTIAL = "Credential" + """is credential""" INT = "Int" + """is int""" BOOL = "Bool" + """is bool""" FLOAT = "Float" + """is float""" class SegmentStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Segment status.""" SUCCESS = "SUCCESS" + """is success""" FAILURE = "FAILURE" + """is failure""" + + +class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This field is required to be implemented by the Resource Provider if the service has more than + one tier, but is not required on a PUT. + """ + + FREE = "Free" + BASIC = "Basic" + STANDARD = "Standard" + PREMIUM = "Premium" class SslEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protect LDAP communication using SSL certificate (LDAPS).""" + """Whether SSL is enabled or disabled.""" ENABLED = "Enabled" + """is enabled""" DISABLED = "Disabled" + """is disabled""" + + +class SystemAssignedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (either system assigned, or none).""" + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" class TrialStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trial status.""" + """trial status.""" TRIAL_AVAILABLE = "TrialAvailable" + """is available""" TRIAL_USED = "TrialUsed" + """is used""" TRIAL_DISABLED = "TrialDisabled" + """is disabled""" + + +class VirtualMachineProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Virtual Machine provisioning state.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" class VirtualMachineRestrictMovementState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether VM DRS-driven movement is restricted (enabled) or not (disabled).""" + """Virtual Machine Restrict Movement state.""" ENABLED = "Enabled" + """is enabled""" DISABLED = "Disabled" + """is disabled""" class VisibilityParameterEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Should this parameter be visible to arm and passed in the parameters argument when executing.""" + """Visibility Parameter.""" VISIBLE = "Visible" + """is visible""" HIDDEN = "Hidden" + """is hidden""" class VMGroupStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """VM Group status.""" + """VM group status.""" SUCCESS = "SUCCESS" + """is success""" FAILURE = "FAILURE" + """is failure""" class VMTypeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual machine type.""" + """VM type.""" REGULAR = "REGULAR" + """is regular""" EDGE = "EDGE" + """is edge""" SERVICE = "SERVICE" + """is service""" class WorkloadNetworkDhcpProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state.""" + """Workload Network DHCP provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" class WorkloadNetworkDnsServiceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state.""" + """Workload Network DNS Service provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" class WorkloadNetworkDnsZoneProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state.""" + """Workload Network DNS Zone provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" -class WorkloadNetworkName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """WorkloadNetworkName.""" +class WorkloadNetworkPortMirroringProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Workload Network Port Mirroring provisioning state.""" - DEFAULT = "default" + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + BUILDING = "Building" + """is building""" + DELETING = "Deleting" + """is deleting""" + UPDATING = "Updating" + """is updating""" -class WorkloadNetworkPortMirroringProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state.""" +class WorkloadNetworkProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """base Workload Network provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" class WorkloadNetworkPublicIPProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state.""" + """Workload Network Public IP provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" class WorkloadNetworkSegmentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state.""" + """Workload Network Segment provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" class WorkloadNetworkVMGroupProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state.""" + """Workload Network VM Group provisioning state.""" SUCCEEDED = "Succeeded" + """Resource has been created.""" FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" BUILDING = "Building" + """is building""" DELETING = "Deleting" + """is deleting""" UPDATING = "Updating" - CANCELED = "Canceled" + """is updating""" diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py index dc1c5cf05689..a6166bbd2b1e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py @@ -7,6 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime import sys from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union @@ -24,28 +25,35 @@ class Resource(_serialization.Model): - """The core properties of ARM resources. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } def __init__(self, **kwargs: Any) -> None: @@ -54,20 +62,64 @@ def __init__(self, **kwargs: Any) -> None: self.id = None self.name = None self.type = None + self.system_data = None -class Addon(Resource): +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + + +class Addon(ProxyResource): """An addon resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar properties: The properties of an addon resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.avs.models.AddonProperties """ @@ -75,18 +127,20 @@ class Addon(Resource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "properties": {"key": "properties", "type": "AddonProperties"}, } def __init__(self, *, properties: Optional["_models.AddonProperties"] = None, **kwargs: Any) -> None: """ - :keyword properties: The properties of an addon resource. + :keyword properties: The resource-specific properties for this resource. :paramtype properties: ~azure.mgmt.avs.models.AddonProperties """ super().__init__(**kwargs) @@ -103,11 +157,10 @@ class AddonProperties(_serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar addon_type: The type of private cloud addon. Required. Known values are: "SRM", "VR", - "HCX", and "Arc". + :ivar addon_type: Addon type. Required. Known values are: "SRM", "VR", "HCX", and "Arc". :vartype addon_type: str or ~azure.mgmt.avs.models.AddonType :ivar provisioning_state: The state of the addon provisioning. Known values are: "Succeeded", - "Failed", "Cancelled", "Building", "Deleting", "Updating", and "Canceled". + "Failed", "Canceled", "Cancelled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.AddonProvisioningState """ @@ -144,11 +197,10 @@ class AddonArcProperties(AddonProperties): All required parameters must be populated in order to send to Azure. - :ivar addon_type: The type of private cloud addon. Required. Known values are: "SRM", "VR", - "HCX", and "Arc". + :ivar addon_type: Addon type. Required. Known values are: "SRM", "VR", "HCX", and "Arc". :vartype addon_type: str or ~azure.mgmt.avs.models.AddonType :ivar provisioning_state: The state of the addon provisioning. Known values are: "Succeeded", - "Failed", "Cancelled", "Building", "Deleting", "Updating", and "Canceled". + "Failed", "Canceled", "Cancelled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.AddonProvisioningState :ivar v_center: The VMware vCenter resource ID. :vartype v_center: str @@ -182,11 +234,10 @@ class AddonHcxProperties(AddonProperties): All required parameters must be populated in order to send to Azure. - :ivar addon_type: The type of private cloud addon. Required. Known values are: "SRM", "VR", - "HCX", and "Arc". + :ivar addon_type: Addon type. Required. Known values are: "SRM", "VR", "HCX", and "Arc". :vartype addon_type: str or ~azure.mgmt.avs.models.AddonType :ivar provisioning_state: The state of the addon provisioning. Known values are: "Succeeded", - "Failed", "Cancelled", "Building", "Deleting", "Updating", and "Canceled". + "Failed", "Canceled", "Cancelled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.AddonProvisioningState :ivar offer: The HCX offer, example VMware MaaS Cloud Provider (Enterprise). Required. :vartype offer: str @@ -214,20 +265,19 @@ def __init__(self, *, offer: str, **kwargs: Any) -> None: self.offer = offer -class AddonList(_serialization.Model): - """A paged list of addons. +class AddonListResult(_serialization.Model): + """The response of a Addon list operation. - 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 value: The items on a page. + :ivar value: The Addon items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.Addon] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -235,11 +285,16 @@ class AddonList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: List["_models.Addon"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The Addon items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.Addon] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link class AddonSrmProperties(AddonProperties): @@ -249,11 +304,10 @@ class AddonSrmProperties(AddonProperties): All required parameters must be populated in order to send to Azure. - :ivar addon_type: The type of private cloud addon. Required. Known values are: "SRM", "VR", - "HCX", and "Arc". + :ivar addon_type: Addon type. Required. Known values are: "SRM", "VR", "HCX", and "Arc". :vartype addon_type: str or ~azure.mgmt.avs.models.AddonType :ivar provisioning_state: The state of the addon provisioning. Known values are: "Succeeded", - "Failed", "Cancelled", "Building", "Deleting", "Updating", and "Canceled". + "Failed", "Canceled", "Cancelled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.AddonProvisioningState :ivar license_key: The Site Recovery Manager (SRM) license. :vartype license_key: str @@ -287,11 +341,10 @@ class AddonVrProperties(AddonProperties): All required parameters must be populated in order to send to Azure. - :ivar addon_type: The type of private cloud addon. Required. Known values are: "SRM", "VR", - "HCX", and "Arc". + :ivar addon_type: Addon type. Required. Known values are: "SRM", "VR", "HCX", and "Arc". :vartype addon_type: str or ~azure.mgmt.avs.models.AddonType :ivar provisioning_state: The state of the addon provisioning. Known values are: "Succeeded", - "Failed", "Cancelled", "Building", "Deleting", "Updating", and "Canceled". + "Failed", "Canceled", "Cancelled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.AddonProvisioningState :ivar vrs_count: The vSphere Replication Server (VRS) count. Required. :vartype vrs_count: int @@ -436,17 +489,25 @@ def __init__(self, **kwargs: Any) -> None: self.express_route_private_peering_id = None -class CloudLink(Resource): +class CloudLink(ProxyResource): """A cloud link resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.CloudLinkProvisioningState :ivar status: The state of the cloud link. Known values are: "Active", "Building", "Deleting", "Failed", and "Disconnected". :vartype status: str or ~azure.mgmt.avs.models.CloudLinkStatus @@ -458,6 +519,8 @@ class CloudLink(Resource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, "status": {"readonly": True}, } @@ -465,6 +528,8 @@ class CloudLink(Resource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "status": {"key": "properties.status", "type": "str"}, "linked_cloud": {"key": "properties.linkedCloud", "type": "str"}, } @@ -475,24 +540,24 @@ def __init__(self, *, linked_cloud: Optional[str] = None, **kwargs: Any) -> None :paramtype linked_cloud: str """ super().__init__(**kwargs) + self.provisioning_state = None self.status = None self.linked_cloud = linked_cloud -class CloudLinkList(_serialization.Model): - """A paged list of cloud links. +class CloudLinkListResult(_serialization.Model): + """The response of a CloudLink list operation. - 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 value: The items on a page. + :ivar value: The CloudLink items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.CloudLink] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -500,43 +565,56 @@ class CloudLinkList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: List["_models.CloudLink"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The CloudLink items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.CloudLink] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link -class Cluster(Resource): +class Cluster(ProxyResource): """A cluster resource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar sku: The cluster SKU. Required. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. Required. :vartype sku: ~azure.mgmt.avs.models.Sku :ivar cluster_size: The cluster size. :vartype cluster_size: int :ivar provisioning_state: The state of the cluster provisioning. Known values are: "Succeeded", - "Failed", "Cancelled", "Deleting", "Updating", and "Canceled". + "Failed", "Canceled", "Cancelled", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState :ivar cluster_id: The identity. :vartype cluster_id: int :ivar hosts: The hosts. :vartype hosts: list[str] + :ivar vsan_datastore_name: Name of the vsan datastore associated with the cluster. + :vartype vsan_datastore_name: str """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "sku": {"required": True}, "provisioning_state": {"readonly": True}, "cluster_id": {"readonly": True}, @@ -546,11 +624,13 @@ class Cluster(Resource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "sku": {"key": "sku", "type": "Sku"}, "cluster_size": {"key": "properties.clusterSize", "type": "int"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "cluster_id": {"key": "properties.clusterId", "type": "int"}, "hosts": {"key": "properties.hosts", "type": "[str]"}, + "vsan_datastore_name": {"key": "properties.vsanDatastoreName", "type": "str"}, } def __init__( @@ -559,15 +639,18 @@ def __init__( sku: "_models.Sku", cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, + vsan_datastore_name: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword sku: The cluster SKU. Required. + :keyword sku: The SKU (Stock Keeping Unit) assigned to this resource. Required. :paramtype sku: ~azure.mgmt.avs.models.Sku :keyword cluster_size: The cluster size. :paramtype cluster_size: int :keyword hosts: The hosts. :paramtype hosts: list[str] + :keyword vsan_datastore_name: Name of the vsan datastore associated with the cluster. + :paramtype vsan_datastore_name: str """ super().__init__(**kwargs) self.sku = sku @@ -575,22 +658,22 @@ def __init__( self.provisioning_state = None self.cluster_id = None self.hosts = hosts + self.vsan_datastore_name = vsan_datastore_name -class ClusterList(_serialization.Model): - """A paged list of clusters. +class ClusterListResult(_serialization.Model): + """The response of a Cluster list operation. - 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 value: The items on a page. + :ivar value: The Cluster items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.Cluster] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -598,96 +681,23 @@ class ClusterList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class CommonClusterProperties(_serialization.Model): - """The common properties of a cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_size: The cluster size. - :vartype cluster_size: int - :ivar provisioning_state: The state of the cluster provisioning. Known values are: "Succeeded", - "Failed", "Cancelled", "Deleting", "Updating", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState - :ivar cluster_id: The identity. - :vartype cluster_id: int - :ivar hosts: The hosts. - :vartype hosts: list[str] - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "cluster_id": {"readonly": True}, - } - - _attribute_map = { - "cluster_size": {"key": "clusterSize", "type": "int"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "cluster_id": {"key": "clusterId", "type": "int"}, - "hosts": {"key": "hosts", "type": "[str]"}, - } - - def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs: Any) -> None: + def __init__(self, *, value: List["_models.Cluster"], next_link: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword cluster_size: The cluster size. - :paramtype cluster_size: int - :keyword hosts: The hosts. - :paramtype hosts: list[str] + :keyword value: The Cluster items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.Cluster] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str """ super().__init__(**kwargs) - self.cluster_size = cluster_size - self.provisioning_state = None - self.cluster_id = None - self.hosts = hosts - - -class ClusterProperties(CommonClusterProperties): - """The properties of a cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_size: The cluster size. - :vartype cluster_size: int - :ivar provisioning_state: The state of the cluster provisioning. Known values are: "Succeeded", - "Failed", "Cancelled", "Deleting", "Updating", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState - :ivar cluster_id: The identity. - :vartype cluster_id: int - :ivar hosts: The hosts. - :vartype hosts: list[str] - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "cluster_id": {"readonly": True}, - } - - _attribute_map = { - "cluster_size": {"key": "clusterSize", "type": "int"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "cluster_id": {"key": "clusterId", "type": "int"}, - "hosts": {"key": "hosts", "type": "[str]"}, - } - - def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword cluster_size: The cluster size. - :paramtype cluster_size: int - :keyword hosts: The hosts. - :paramtype hosts: list[str] - """ - super().__init__(cluster_size=cluster_size, hosts=hosts, **kwargs) + self.value = value + self.next_link = next_link class ClusterUpdate(_serialization.Model): """An update of a cluster resource. + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. + :vartype sku: ~azure.mgmt.avs.models.Sku :ivar cluster_size: The cluster size. :vartype cluster_size: int :ivar hosts: The hosts. @@ -695,18 +705,29 @@ class ClusterUpdate(_serialization.Model): """ _attribute_map = { + "sku": {"key": "sku", "type": "Sku"}, "cluster_size": {"key": "properties.clusterSize", "type": "int"}, "hosts": {"key": "properties.hosts", "type": "[str]"}, } - def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + sku: Optional["_models.Sku"] = None, + cluster_size: Optional[int] = None, + hosts: Optional[List[str]] = None, + **kwargs: Any + ) -> None: """ + :keyword sku: The SKU (Stock Keeping Unit) assigned to this resource. + :paramtype sku: ~azure.mgmt.avs.models.Sku :keyword cluster_size: The cluster size. :paramtype cluster_size: int :keyword hosts: The hosts. :paramtype hosts: list[str] """ super().__init__(**kwargs) + self.sku = sku self.cluster_size = cluster_size self.hosts = hosts @@ -759,25 +780,32 @@ def __init__(self, *, zones: Optional[List["_models.ClusterZone"]] = None, **kwa self.zones = zones -class Datastore(Resource): +class Datastore(ProxyResource): """A datastore resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData :ivar provisioning_state: The state of the datastore provisioning. Known values are: - "Succeeded", "Failed", "Cancelled", "Pending", "Creating", "Updating", "Deleting", and - "Canceled". + "Succeeded", "Failed", "Canceled", "Cancelled", "Pending", "Creating", "Updating", and + "Deleting". :vartype provisioning_state: str or ~azure.mgmt.avs.models.DatastoreProvisioningState :ivar net_app_volume: An Azure NetApp Files volume. :vartype net_app_volume: ~azure.mgmt.avs.models.NetAppVolume :ivar disk_pool_volume: An iSCSI volume. :vartype disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume + :ivar elastic_san_volume: An Elastic SAN volume. + :vartype elastic_san_volume: ~azure.mgmt.avs.models.ElasticSanVolume :ivar status: The operational status of the datastore. Known values are: "Unknown", "Accessible", "Inaccessible", "Attached", "Detached", "LostCommunication", and "DeadOrError". :vartype status: str or ~azure.mgmt.avs.models.DatastoreStatus @@ -787,6 +815,7 @@ class Datastore(Resource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "provisioning_state": {"readonly": True}, "status": {"readonly": True}, } @@ -795,9 +824,11 @@ class Datastore(Resource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "net_app_volume": {"key": "properties.netAppVolume", "type": "NetAppVolume"}, "disk_pool_volume": {"key": "properties.diskPoolVolume", "type": "DiskPoolVolume"}, + "elastic_san_volume": {"key": "properties.elasticSanVolume", "type": "ElasticSanVolume"}, "status": {"key": "properties.status", "type": "str"}, } @@ -806,6 +837,7 @@ def __init__( *, net_app_volume: Optional["_models.NetAppVolume"] = None, disk_pool_volume: Optional["_models.DiskPoolVolume"] = None, + elastic_san_volume: Optional["_models.ElasticSanVolume"] = None, **kwargs: Any ) -> None: """ @@ -813,28 +845,30 @@ def __init__( :paramtype net_app_volume: ~azure.mgmt.avs.models.NetAppVolume :keyword disk_pool_volume: An iSCSI volume. :paramtype disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume + :keyword elastic_san_volume: An Elastic SAN volume. + :paramtype elastic_san_volume: ~azure.mgmt.avs.models.ElasticSanVolume """ super().__init__(**kwargs) self.provisioning_state = None self.net_app_volume = net_app_volume self.disk_pool_volume = disk_pool_volume + self.elastic_san_volume = elastic_san_volume self.status = None -class DatastoreList(_serialization.Model): - """A paged list of datastores. +class DatastoreListResult(_serialization.Model): + """The response of a Datastore list operation. - 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 value: The items on a page. + :ivar value: The Datastore items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.Datastore] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -842,11 +876,16 @@ class DatastoreList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: List["_models.Datastore"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The Datastore items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.Datastore] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link class DiskPoolVolume(_serialization.Model): @@ -904,6 +943,32 @@ def __init__( self.path = None +class ElasticSanVolume(_serialization.Model): + """An Elastic SAN volume from Microsoft.ElasticSan provider. + + All required parameters must be populated in order to send to Azure. + + :ivar target_id: Azure resource ID of the Elastic SAN Volume. Required. + :vartype target_id: str + """ + + _validation = { + "target_id": {"required": True}, + } + + _attribute_map = { + "target_id": {"key": "targetId", "type": "str"}, + } + + def __init__(self, *, target_id: str, **kwargs: Any) -> None: + """ + :keyword target_id: Azure resource ID of the Elastic SAN Volume. Required. + :paramtype target_id: str + """ + super().__init__(**kwargs) + self.target_id = target_id + + class Encryption(_serialization.Model): """The properties of customer managed encryption key. @@ -1004,24 +1069,36 @@ class Endpoints(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar nsxt_manager: Endpoint for the NSX-T Data Center manager. + :ivar nsxt_manager: Endpoint FQDN for the NSX-T Data Center manager. :vartype nsxt_manager: str - :ivar vcsa: Endpoint for Virtual Center Server Appliance. + :ivar vcsa: Endpoint FQDN for Virtual Center Server Appliance. :vartype vcsa: str - :ivar hcx_cloud_manager: Endpoint for the HCX Cloud Manager. + :ivar hcx_cloud_manager: Endpoint FQDN for the HCX Cloud Manager. :vartype hcx_cloud_manager: str + :ivar nsxt_manager_ip: Endpoint IP for the NSX-T Data Center manager. + :vartype nsxt_manager_ip: str + :ivar vcenter_ip: Endpoint IP for Virtual Center Server Appliance. + :vartype vcenter_ip: str + :ivar hcx_cloud_manager_ip: Endpoint IP for the HCX Cloud Manager. + :vartype hcx_cloud_manager_ip: str """ _validation = { "nsxt_manager": {"readonly": True}, "vcsa": {"readonly": True}, "hcx_cloud_manager": {"readonly": True}, + "nsxt_manager_ip": {"readonly": True}, + "vcenter_ip": {"readonly": True}, + "hcx_cloud_manager_ip": {"readonly": True}, } _attribute_map = { "nsxt_manager": {"key": "nsxtManager", "type": "str"}, "vcsa": {"key": "vcsa", "type": "str"}, "hcx_cloud_manager": {"key": "hcxCloudManager", "type": "str"}, + "nsxt_manager_ip": {"key": "nsxtManagerIp", "type": "str"}, + "vcenter_ip": {"key": "vcenterIp", "type": "str"}, + "hcx_cloud_manager_ip": {"key": "hcxCloudManagerIp", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: @@ -1030,6 +1107,9 @@ def __init__(self, **kwargs: Any) -> None: self.nsxt_manager = None self.vcsa = None self.hcx_cloud_manager = None + self.nsxt_manager_ip = None + self.vcenter_ip = None + self.hcx_cloud_manager_ip = None class ErrorAdditionalInfo(_serialization.Model): @@ -1124,19 +1204,24 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A self.error = error -class ExpressRouteAuthorization(Resource): +class ExpressRouteAuthorization(ProxyResource): """ExpressRoute Circuit Authorization. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar provisioning_state: The state of the ExpressRoute Circuit Authorization provisioning. - Known values are: "Succeeded", "Failed", "Updating", and "Canceled". + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar provisioning_state: The state of the ExpressRoute Circuit Authorization provisioning. + Known values are: "Succeeded", "Failed", "Canceled", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.ExpressRouteAuthorizationProvisioningState :ivar express_route_authorization_id: The ID of the ExpressRoute Circuit Authorization. @@ -1151,6 +1236,7 @@ class ExpressRouteAuthorization(Resource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "provisioning_state": {"readonly": True}, "express_route_authorization_id": {"readonly": True}, "express_route_authorization_key": {"readonly": True}, @@ -1160,6 +1246,7 @@ class ExpressRouteAuthorization(Resource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "express_route_authorization_id": {"key": "properties.expressRouteAuthorizationId", "type": "str"}, "express_route_authorization_key": {"key": "properties.expressRouteAuthorizationKey", "type": "str"}, @@ -1178,20 +1265,19 @@ def __init__(self, *, express_route_id: Optional[str] = None, **kwargs: Any) -> self.express_route_id = express_route_id -class ExpressRouteAuthorizationList(_serialization.Model): - """A paged list of ExpressRoute Circuit Authorizations. +class ExpressRouteAuthorizationListResult(_serialization.Model): + """The response of a ExpressRouteAuthorization list operation. - 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 value: The items on a page. + :ivar value: The ExpressRouteAuthorization items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.ExpressRouteAuthorization] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -1199,42 +1285,58 @@ class ExpressRouteAuthorizationList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.ExpressRouteAuthorization"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The ExpressRouteAuthorization items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.ExpressRouteAuthorization] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link -class GlobalReachConnection(Resource): +class GlobalReachConnection(ProxyResource): """A global reach connection resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData :ivar provisioning_state: The state of the ExpressRoute Circuit Authorization provisioning. - Known values are: "Succeeded", "Failed", "Updating", and "Canceled". + Known values are: "Succeeded", "Failed", "Canceled", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.GlobalReachConnectionProvisioningState :ivar address_prefix: The network used for global reach carved out from the original network - block provided for the private cloud. + block + provided for the private cloud. :vartype address_prefix: str :ivar authorization_key: Authorization key from the peer express route used for the global - reach connection. + reach + connection. :vartype authorization_key: str :ivar circuit_connection_status: The connection status of the global reach connection. Known values are: "Connected", "Connecting", and "Disconnected". :vartype circuit_connection_status: str or ~azure.mgmt.avs.models.GlobalReachConnectionStatus :ivar peer_express_route_circuit: Identifier of the ExpressRoute Circuit to peer with in the - global reach connection. + global reach + connection. :vartype peer_express_route_circuit: str :ivar express_route_id: The ID of the Private Cloud's ExpressRoute Circuit that is - participating in the global reach connection. + participating in the + global reach connection. :vartype express_route_id: str """ @@ -1242,6 +1344,7 @@ class GlobalReachConnection(Resource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "provisioning_state": {"readonly": True}, "address_prefix": {"readonly": True}, "circuit_connection_status": {"readonly": True}, @@ -1251,6 +1354,7 @@ class GlobalReachConnection(Resource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, "authorization_key": {"key": "properties.authorizationKey", "type": "str"}, @@ -1269,13 +1373,16 @@ def __init__( ) -> None: """ :keyword authorization_key: Authorization key from the peer express route used for the global - reach connection. + reach + connection. :paramtype authorization_key: str :keyword peer_express_route_circuit: Identifier of the ExpressRoute Circuit to peer with in the - global reach connection. + global reach + connection. :paramtype peer_express_route_circuit: str :keyword express_route_id: The ID of the Private Cloud's ExpressRoute Circuit that is - participating in the global reach connection. + participating in the + global reach connection. :paramtype express_route_id: str """ super().__init__(**kwargs) @@ -1287,20 +1394,19 @@ def __init__( self.express_route_id = express_route_id -class GlobalReachConnectionList(_serialization.Model): - """A paged list of global reach connections. +class GlobalReachConnectionListResult(_serialization.Model): + """The response of a GlobalReachConnection list operation. - 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 value: The items on a page. + :ivar value: The GlobalReachConnection items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.GlobalReachConnection] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -1308,24 +1414,39 @@ class GlobalReachConnectionList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.GlobalReachConnection"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The GlobalReachConnection items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.GlobalReachConnection] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link -class HcxEnterpriseSite(Resource): +class HcxEnterpriseSite(ProxyResource): """An HCX Enterprise Site resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.HcxEnterpriseSiteProvisioningState :ivar activation_key: The activation key. :vartype activation_key: str :ivar status: The status of the HCX Enterprise Site. Known values are: "Available", "Consumed", @@ -1337,6 +1458,8 @@ class HcxEnterpriseSite(Resource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, "activation_key": {"readonly": True}, "status": {"readonly": True}, } @@ -1345,6 +1468,8 @@ class HcxEnterpriseSite(Resource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "activation_key": {"key": "properties.activationKey", "type": "str"}, "status": {"key": "properties.status", "type": "str"}, } @@ -1352,24 +1477,24 @@ class HcxEnterpriseSite(Resource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) + self.provisioning_state = None self.activation_key = None self.status = None -class HcxEnterpriseSiteList(_serialization.Model): - """A paged list of HCX Enterprise Sites. +class HcxEnterpriseSiteListResult(_serialization.Model): + """The response of a HcxEnterpriseSite list operation. - 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 value: The items on a page. + :ivar value: The HcxEnterpriseSite items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.HcxEnterpriseSite] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -1377,11 +1502,18 @@ class HcxEnterpriseSiteList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.HcxEnterpriseSite"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The HcxEnterpriseSite items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.HcxEnterpriseSite] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link class IdentitySource(_serialization.Model): @@ -1459,10 +1591,12 @@ def __init__( "Enabled" and "Disabled". :paramtype ssl: str or ~azure.mgmt.avs.models.SslEnum :keyword username: The ID of an Active Directory user with a minimum of read-only access to - Base DN for users and group. + Base + DN for users and group. :paramtype username: str :keyword password: The password of the Active Directory user with a minimum of read-only access - to Base DN for users and groups. + to + Base DN for users and groups. :paramtype password: str """ super().__init__(**kwargs) @@ -1478,245 +1612,141 @@ def __init__( self.password = password -class LogSpecification(_serialization.Model): - """Specifications of the Log for Azure Monitoring. +class IscsiPath(ProxyResource): + """An iSCSI path resource. + + Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Name of the log. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. :vartype name: str - :ivar display_name: Localized friendly display name of the log. - :vartype display_name: str - :ivar blob_duration: Blob duration of the log. - :vartype blob_duration: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar provisioning_state: The state of the iSCSI path provisioning. Known values are: + "Succeeded", "Failed", "Canceled", "Pending", "Building", "Deleting", and "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.IscsiPathProvisioningState + :ivar network_block: CIDR Block for iSCSI path. + :vartype network_block: str """ + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + _attribute_map = { + "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "blob_duration": {"key": "blobDuration", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "network_block": {"key": "properties.networkBlock", "type": "str"}, } - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - blob_duration: Optional[str] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, network_block: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword name: Name of the log. - :paramtype name: str - :keyword display_name: Localized friendly display name of the log. - :paramtype display_name: str - :keyword blob_duration: Blob duration of the log. - :paramtype blob_duration: str + :keyword network_block: CIDR Block for iSCSI path. + :paramtype network_block: str """ super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.blob_duration = blob_duration + self.provisioning_state = None + self.network_block = network_block -class ManagementCluster(CommonClusterProperties): - """The properties of a management cluster. +class IscsiPathListResult(_serialization.Model): + """The response of a IscsiPath list operation. - 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 cluster_size: The cluster size. - :vartype cluster_size: int - :ivar provisioning_state: The state of the cluster provisioning. Known values are: "Succeeded", - "Failed", "Cancelled", "Deleting", "Updating", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState - :ivar cluster_id: The identity. - :vartype cluster_id: int - :ivar hosts: The hosts. - :vartype hosts: list[str] + :ivar value: The IscsiPath items on this page. Required. + :vartype value: list[~azure.mgmt.avs.models.IscsiPath] + :ivar next_link: The link to the next page of items. + :vartype next_link: str """ _validation = { - "provisioning_state": {"readonly": True}, - "cluster_id": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { - "cluster_size": {"key": "clusterSize", "type": "int"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "cluster_id": {"key": "clusterId", "type": "int"}, - "hosts": {"key": "hosts", "type": "[str]"}, + "value": {"key": "value", "type": "[IscsiPath]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, cluster_size: Optional[int] = None, hosts: Optional[List[str]] = None, **kwargs: Any) -> None: + def __init__(self, *, value: List["_models.IscsiPath"], next_link: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword cluster_size: The cluster size. - :paramtype cluster_size: int - :keyword hosts: The hosts. - :paramtype hosts: list[str] + :keyword value: The IscsiPath items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.IscsiPath] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str """ - super().__init__(cluster_size=cluster_size, hosts=hosts, **kwargs) + super().__init__(**kwargs) + self.value = value + self.next_link = next_link -class MetricDimension(_serialization.Model): - """Specifications of the Dimension of metrics. +class ManagementCluster(_serialization.Model): + """The properties of a management cluster. - :ivar name: Name of the dimension. - :vartype name: str - :ivar display_name: Localized friendly display name of the dimension. - :vartype display_name: str - :ivar internal_name: Name of the dimension as it appears in MDM. - :vartype internal_name: str - :ivar to_be_exported_for_shoebox: A boolean flag indicating whether this dimension should be - included for the shoebox export scenario. - :vartype to_be_exported_for_shoebox: bool + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cluster_size: The cluster size. + :vartype cluster_size: int + :ivar provisioning_state: The state of the cluster provisioning. Known values are: "Succeeded", + "Failed", "Canceled", "Cancelled", "Deleting", and "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState + :ivar cluster_id: The identity. + :vartype cluster_id: int + :ivar hosts: The hosts. + :vartype hosts: list[str] + :ivar vsan_datastore_name: Name of the vsan datastore associated with the cluster. + :vartype vsan_datastore_name: str """ - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "internal_name": {"key": "internalName", "type": "str"}, - "to_be_exported_for_shoebox": {"key": "toBeExportedForShoebox", "type": "bool"}, + _validation = { + "provisioning_state": {"readonly": True}, + "cluster_id": {"readonly": True}, } - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - internal_name: Optional[str] = None, - to_be_exported_for_shoebox: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the dimension. - :paramtype name: str - :keyword display_name: Localized friendly display name of the dimension. - :paramtype display_name: str - :keyword internal_name: Name of the dimension as it appears in MDM. - :paramtype internal_name: str - :keyword to_be_exported_for_shoebox: A boolean flag indicating whether this dimension should be - included for the shoebox export scenario. - :paramtype to_be_exported_for_shoebox: bool - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.internal_name = internal_name - self.to_be_exported_for_shoebox = to_be_exported_for_shoebox - - -class MetricSpecification(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Specifications of the Metrics for Azure Monitoring. - - :ivar name: Name of the metric. - :vartype name: str - :ivar display_name: Localized friendly display name of the metric. - :vartype display_name: str - :ivar display_description: Localized friendly description of the metric. - :vartype display_description: str - :ivar unit: Unit that makes sense for the metric. - :vartype unit: str - :ivar category: Name of the metric category that the metric belongs to. A metric can only - belong to a single category. - :vartype category: str - :ivar aggregation_type: Only provide one value for this field. Valid values: Average, Minimum, - Maximum, Total, Count. - :vartype aggregation_type: str - :ivar supported_aggregation_types: Supported aggregation types. - :vartype supported_aggregation_types: list[str] - :ivar supported_time_grain_types: Supported time grain types. - :vartype supported_time_grain_types: list[str] - :ivar fill_gap_with_zero: Optional. If set to true, then zero will be returned for time - duration where no metric is emitted/published. - :vartype fill_gap_with_zero: bool - :ivar dimensions: Dimensions of the metric. - :vartype dimensions: list[~azure.mgmt.avs.models.MetricDimension] - :ivar enable_regional_mdm_account: Whether or not the service is using regional MDM accounts. - :vartype enable_regional_mdm_account: str - :ivar source_mdm_account: The name of the MDM account. - :vartype source_mdm_account: str - :ivar source_mdm_namespace: The name of the MDM namespace. - :vartype source_mdm_namespace: str - """ - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "display_description": {"key": "displayDescription", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "category": {"key": "category", "type": "str"}, - "aggregation_type": {"key": "aggregationType", "type": "str"}, - "supported_aggregation_types": {"key": "supportedAggregationTypes", "type": "[str]"}, - "supported_time_grain_types": {"key": "supportedTimeGrainTypes", "type": "[str]"}, - "fill_gap_with_zero": {"key": "fillGapWithZero", "type": "bool"}, - "dimensions": {"key": "dimensions", "type": "[MetricDimension]"}, - "enable_regional_mdm_account": {"key": "enableRegionalMdmAccount", "type": "str"}, - "source_mdm_account": {"key": "sourceMdmAccount", "type": "str"}, - "source_mdm_namespace": {"key": "sourceMdmNamespace", "type": "str"}, + "cluster_size": {"key": "clusterSize", "type": "int"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "cluster_id": {"key": "clusterId", "type": "int"}, + "hosts": {"key": "hosts", "type": "[str]"}, + "vsan_datastore_name": {"key": "vsanDatastoreName", "type": "str"}, } def __init__( self, *, - name: Optional[str] = None, - display_name: Optional[str] = None, - display_description: Optional[str] = None, - unit: Optional[str] = None, - category: Optional[str] = None, - aggregation_type: Optional[str] = None, - supported_aggregation_types: Optional[List[str]] = None, - supported_time_grain_types: Optional[List[str]] = None, - fill_gap_with_zero: Optional[bool] = None, - dimensions: Optional[List["_models.MetricDimension"]] = None, - enable_regional_mdm_account: Optional[str] = None, - source_mdm_account: Optional[str] = None, - source_mdm_namespace: Optional[str] = None, + cluster_size: Optional[int] = None, + hosts: Optional[List[str]] = None, + vsan_datastore_name: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword name: Name of the metric. - :paramtype name: str - :keyword display_name: Localized friendly display name of the metric. - :paramtype display_name: str - :keyword display_description: Localized friendly description of the metric. - :paramtype display_description: str - :keyword unit: Unit that makes sense for the metric. - :paramtype unit: str - :keyword category: Name of the metric category that the metric belongs to. A metric can only - belong to a single category. - :paramtype category: str - :keyword aggregation_type: Only provide one value for this field. Valid values: Average, - Minimum, Maximum, Total, Count. - :paramtype aggregation_type: str - :keyword supported_aggregation_types: Supported aggregation types. - :paramtype supported_aggregation_types: list[str] - :keyword supported_time_grain_types: Supported time grain types. - :paramtype supported_time_grain_types: list[str] - :keyword fill_gap_with_zero: Optional. If set to true, then zero will be returned for time - duration where no metric is emitted/published. - :paramtype fill_gap_with_zero: bool - :keyword dimensions: Dimensions of the metric. - :paramtype dimensions: list[~azure.mgmt.avs.models.MetricDimension] - :keyword enable_regional_mdm_account: Whether or not the service is using regional MDM - accounts. - :paramtype enable_regional_mdm_account: str - :keyword source_mdm_account: The name of the MDM account. - :paramtype source_mdm_account: str - :keyword source_mdm_namespace: The name of the MDM namespace. - :paramtype source_mdm_namespace: str + :keyword cluster_size: The cluster size. + :paramtype cluster_size: int + :keyword hosts: The hosts. + :paramtype hosts: list[str] + :keyword vsan_datastore_name: Name of the vsan datastore associated with the cluster. + :paramtype vsan_datastore_name: str """ super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.category = category - self.aggregation_type = aggregation_type - self.supported_aggregation_types = supported_aggregation_types - self.supported_time_grain_types = supported_time_grain_types - self.fill_gap_with_zero = fill_gap_with_zero - self.dimensions = dimensions - self.enable_regional_mdm_account = enable_regional_mdm_account - self.source_mdm_account = source_mdm_account - self.source_mdm_namespace = source_mdm_namespace + self.cluster_size = cluster_size + self.provisioning_state = None + self.cluster_id = None + self.hosts = hosts + self.vsan_datastore_name = vsan_datastore_name class NetAppVolume(_serialization.Model): @@ -1746,73 +1776,71 @@ def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefi class Operation(_serialization.Model): - """A REST API operation. + """Details of a REST API operation, returned from the Resource Provider Operations API. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Name of the operation being performed on this object. + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". :vartype name: str - :ivar display: Contains the localized display information for this operation. - :vartype display: ~azure.mgmt.avs.models.OperationDisplay - :ivar is_data_action: Gets or sets a value indicating whether the operation is a data action or - not. + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for ARM/control-plane operations. :vartype is_data_action: bool - :ivar origin: Origin of the operation. - :vartype origin: str - :ivar properties: Properties of the operation. - :vartype properties: ~azure.mgmt.avs.models.OperationProperties + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.avs.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.avs.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.avs.models.ActionType """ _validation = { "name": {"readonly": True}, - "display": {"readonly": True}, + "is_data_action": {"readonly": True}, + "origin": {"readonly": True}, + "action_type": {"readonly": True}, } _attribute_map = { "name": {"key": "name", "type": "str"}, - "display": {"key": "display", "type": "OperationDisplay"}, "is_data_action": {"key": "isDataAction", "type": "bool"}, + "display": {"key": "display", "type": "OperationDisplay"}, "origin": {"key": "origin", "type": "str"}, - "properties": {"key": "properties", "type": "OperationProperties"}, + "action_type": {"key": "actionType", "type": "str"}, } - def __init__( - self, - *, - is_data_action: Optional[bool] = None, - origin: Optional[str] = None, - properties: Optional["_models.OperationProperties"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ - :keyword is_data_action: Gets or sets a value indicating whether the operation is a data action - or not. - :paramtype is_data_action: bool - :keyword origin: Origin of the operation. - :paramtype origin: str - :keyword properties: Properties of the operation. - :paramtype properties: ~azure.mgmt.avs.models.OperationProperties + :keyword display: Localized display information for this particular operation. + :paramtype display: ~azure.mgmt.avs.models.OperationDisplay """ super().__init__(**kwargs) self.name = None - self.display = None - self.is_data_action = is_data_action - self.origin = origin - self.properties = properties + self.is_data_action = None + self.display = display + self.origin = None + self.action_type = None class OperationDisplay(_serialization.Model): - """Contains the localized display information for this operation. + """Localized display information for this particular operation. Variables are only populated by the server, and will be ignored when sending a request. - :ivar provider: Localized friendly form of the resource provider name. + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". :vartype provider: str - :ivar resource: Localized friendly form of the resource type related to this operation. + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". :vartype resource: str - :ivar operation: Localized friendly name for the operation. + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". :vartype operation: str - :ivar description: Localized friendly description for the operation. + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. :vartype description: str """ @@ -1839,14 +1867,15 @@ def __init__(self, **kwargs: Any) -> None: self.description = None -class OperationList(_serialization.Model): - """Pageable list of operations. +class OperationListResult(_serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of operations. + :ivar value: List of operations supported by the resource provider. :vartype value: list[~azure.mgmt.avs.models.Operation] - :ivar next_link: URL to get the next page if any. + :ivar next_link: URL to get the next set of operation list results (if there are any). :vartype next_link: str """ @@ -1867,68 +1896,23 @@ def __init__(self, **kwargs: Any) -> None: self.next_link = None -class OperationProperties(_serialization.Model): - """Extra Operation properties. - - :ivar service_specification: Service specifications of the operation. - :vartype service_specification: ~azure.mgmt.avs.models.ServiceSpecification - """ - - _attribute_map = { - "service_specification": {"key": "serviceSpecification", "type": "ServiceSpecification"}, - } - - def __init__( - self, *, service_specification: Optional["_models.ServiceSpecification"] = None, **kwargs: Any - ) -> None: - """ - :keyword service_specification: Service specifications of the operation. - :paramtype service_specification: ~azure.mgmt.avs.models.ServiceSpecification - """ - super().__init__(**kwargs) - self.service_specification = service_specification - - -class PlacementPoliciesList(_serialization.Model): - """Represents list of placement policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The items on the page. - :vartype value: list[~azure.mgmt.avs.models.PlacementPolicy] - :ivar next_link: URL to get the next page if any. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[PlacementPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class PlacementPolicy(Resource): +class PlacementPolicy(ProxyResource): """A vSphere Distributed Resource Scheduler (DRS) placement policy. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar properties: placement policy properties. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.avs.models.PlacementPolicyProperties """ @@ -1936,24 +1920,60 @@ class PlacementPolicy(Resource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "properties": {"key": "properties", "type": "PlacementPolicyProperties"}, } def __init__(self, *, properties: Optional["_models.PlacementPolicyProperties"] = None, **kwargs: Any) -> None: """ - :keyword properties: placement policy properties. + :keyword properties: The resource-specific properties for this resource. :paramtype properties: ~azure.mgmt.avs.models.PlacementPolicyProperties """ super().__init__(**kwargs) self.properties = properties +class PlacementPolicyListResult(_serialization.Model): + """The response of a PlacementPolicy list operation. + + All required parameters must be populated in order to send to Azure. + + :ivar value: The PlacementPolicy items on this page. Required. + :vartype value: list[~azure.mgmt.avs.models.PlacementPolicy] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[PlacementPolicy]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.PlacementPolicy"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The PlacementPolicy items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.PlacementPolicy] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + class PlacementPolicyProperties(_serialization.Model): """Abstract placement policy properties. @@ -1964,7 +1984,7 @@ class PlacementPolicyProperties(_serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar type: placement policy type. Required. Known values are: "VmVm" and "VmHost". + :ivar type: Placement Policy type. Required. Known values are: "VmVm" and "VmHost". :vartype type: str or ~azure.mgmt.avs.models.PlacementPolicyType :ivar state: Whether the placement policy is enabled or disabled. Known values are: "Enabled" and "Disabled". @@ -1972,7 +1992,7 @@ class PlacementPolicyProperties(_serialization.Model): :ivar display_name: Display name of the placement policy. :vartype display_name: str :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.PlacementPolicyProvisioningState """ @@ -2071,46 +2091,57 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar location: Resource location. - :vartype location: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"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"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ - :keyword location: Resource location. - :paramtype location: str :keyword tags: Resource tags. :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str """ super().__init__(**kwargs) - self.location = location self.tags = tags + self.location = location class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attributes @@ -2120,20 +2151,25 @@ class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attrib All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar location: Resource location. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar sku: The private cloud SKU. Required. + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. Required. :vartype sku: ~azure.mgmt.avs.models.Sku - :ivar identity: The identity of the private cloud, if configured. - :vartype identity: ~azure.mgmt.avs.models.PrivateCloudIdentity + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.avs.models.SystemAssignedServiceIdentity :ivar management_cluster: The default cluster used for management. :vartype management_cluster: ~azure.mgmt.avs.models.ManagementCluster :ivar internet: Connectivity to internet is enabled or disabled. Known values are: "Enabled" @@ -2147,19 +2183,22 @@ class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attrib :ivar encryption: Customer managed key encryption, can be enabled or disabled. :vartype encryption: ~azure.mgmt.avs.models.Encryption :ivar extended_network_blocks: Array of additional networks noncontiguous with networkBlock. - Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and - this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + Networks must be + unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + (A.B.C.D/X). :vartype extended_network_blocks: list[str] :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Cancelled", "Pending", "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Cancelled", "Pending", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.PrivateCloudProvisioningState :ivar circuit: An ExpressRoute Circuit. :vartype circuit: ~azure.mgmt.avs.models.Circuit :ivar endpoints: The endpoints. :vartype endpoints: ~azure.mgmt.avs.models.Endpoints :ivar network_block: The block of addresses should be unique across VNet in your subscription - as well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are - between 0 and 255, and X is between 0 and 22. + as + well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where + A,B,C,D are between 0 and 255, and X is between 0 and 22. :vartype network_block: str :ivar management_network: Network used to access vCenter Server and NSX-T Manager. :vartype management_network: str @@ -2184,15 +2223,21 @@ class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attrib stretched private cloud. :vartype secondary_circuit: ~azure.mgmt.avs.models.Circuit :ivar nsx_public_ip_quota_raised: Flag to indicate whether the private cloud has the quota for - provisioned NSX Public IP count raised from 64 to 1024. Known values are: "Enabled" and - "Disabled". + provisioned NSX + Public IP count raised from 64 to 1024. Known values are: "Enabled" and "Disabled". :vartype nsx_public_ip_quota_raised: str or ~azure.mgmt.avs.models.NsxPublicIpQuotaRaisedEnum + :ivar virtual_network_id: Azure resource ID of the virtual network. + :vartype virtual_network_id: str + :ivar dns_zone_type: The type of DNS zone to use. Known values are: "Public" and "Private". + :vartype dns_zone_type: str or ~azure.mgmt.avs.models.DnsZoneType """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, "sku": {"required": True}, "provisioning_state": {"readonly": True}, "endpoints": {"readonly": True}, @@ -2209,10 +2254,11 @@ class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attrib "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, "sku": {"key": "sku", "type": "Sku"}, - "identity": {"key": "identity", "type": "PrivateCloudIdentity"}, + "identity": {"key": "identity", "type": "SystemAssignedServiceIdentity"}, "management_cluster": {"key": "properties.managementCluster", "type": "ManagementCluster"}, "internet": {"key": "properties.internet", "type": "str"}, "identity_sources": {"key": "properties.identitySources", "type": "[IdentitySource]"}, @@ -2233,17 +2279,19 @@ class PrivateCloud(TrackedResource): # pylint: disable=too-many-instance-attrib "external_cloud_links": {"key": "properties.externalCloudLinks", "type": "[str]"}, "secondary_circuit": {"key": "properties.secondaryCircuit", "type": "Circuit"}, "nsx_public_ip_quota_raised": {"key": "properties.nsxPublicIpQuotaRaised", "type": "str"}, + "virtual_network_id": {"key": "properties.virtualNetworkId", "type": "str"}, + "dns_zone_type": {"key": "properties.dnsZoneType", "type": "str"}, } def __init__( # pylint: disable=too-many-locals self, *, + location: str, sku: "_models.Sku", - location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.PrivateCloudIdentity"] = None, + identity: Optional["_models.SystemAssignedServiceIdentity"] = None, management_cluster: Optional["_models.ManagementCluster"] = None, - internet: Union[str, "_models.InternetEnum"] = "Disabled", + internet: Optional[Union[str, "_models.InternetEnum"]] = None, identity_sources: Optional[List["_models.IdentitySource"]] = None, availability: Optional["_models.AvailabilityProperties"] = None, encryption: Optional["_models.Encryption"] = None, @@ -2253,17 +2301,19 @@ def __init__( # pylint: disable=too-many-locals vcenter_password: Optional[str] = None, nsxt_password: Optional[str] = None, secondary_circuit: Optional["_models.Circuit"] = None, + virtual_network_id: Optional[str] = None, + dns_zone_type: Optional[Union[str, "_models.DnsZoneType"]] = None, **kwargs: Any ) -> None: """ - :keyword location: Resource location. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword sku: The private cloud SKU. Required. + :keyword sku: The SKU (Stock Keeping Unit) assigned to this resource. Required. :paramtype sku: ~azure.mgmt.avs.models.Sku - :keyword identity: The identity of the private cloud, if configured. - :paramtype identity: ~azure.mgmt.avs.models.PrivateCloudIdentity + :keyword identity: The managed service identities assigned to this resource. + :paramtype identity: ~azure.mgmt.avs.models.SystemAssignedServiceIdentity :keyword management_cluster: The default cluster used for management. :paramtype management_cluster: ~azure.mgmt.avs.models.ManagementCluster :keyword internet: Connectivity to internet is enabled or disabled. Known values are: "Enabled" @@ -2277,13 +2327,16 @@ def __init__( # pylint: disable=too-many-locals :keyword encryption: Customer managed key encryption, can be enabled or disabled. :paramtype encryption: ~azure.mgmt.avs.models.Encryption :keyword extended_network_blocks: Array of additional networks noncontiguous with networkBlock. - Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and - this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + Networks must be + unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + (A.B.C.D/X). :paramtype extended_network_blocks: list[str] :keyword circuit: An ExpressRoute Circuit. :paramtype circuit: ~azure.mgmt.avs.models.Circuit :keyword network_block: The block of addresses should be unique across VNet in your - subscription as well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where + subscription as + well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22. :paramtype network_block: str :keyword vcenter_password: Optionally, set the vCenter admin password when the private cloud is @@ -2293,10 +2346,16 @@ def __init__( # pylint: disable=too-many-locals created. :paramtype nsxt_password: str :keyword secondary_circuit: A secondary expressRoute circuit from a separate AZ. Only present - in a stretched private cloud. + in a + stretched private cloud. :paramtype secondary_circuit: ~azure.mgmt.avs.models.Circuit + :keyword virtual_network_id: Azure resource ID of the virtual network. + :paramtype virtual_network_id: str + :keyword dns_zone_type: The type of DNS zone to use. Known values are: "Public" and "Private". + :paramtype dns_zone_type: str or ~azure.mgmt.avs.models.DnsZoneType """ - super().__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, **kwargs) + self.tags = tags self.sku = sku self.identity = identity self.management_cluster = management_cluster @@ -2319,63 +2378,23 @@ def __init__( # pylint: disable=too-many-locals self.external_cloud_links = None self.secondary_circuit = secondary_circuit self.nsx_public_ip_quota_raised = None + self.virtual_network_id = virtual_network_id + self.dns_zone_type = dns_zone_type -class PrivateCloudIdentity(_serialization.Model): - """Identity for the virtual machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of private cloud identity. This property will only be - provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID associated with the private cloud. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: The type of identity used for the private cloud. The type 'SystemAssigned' refers - to an implicitly created identity. The type 'None' will remove any identities from the Private - Cloud. Known values are: "SystemAssigned" and "None". - :vartype type: str or ~azure.mgmt.avs.models.ResourceIdentityType - """ - - _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, *, type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, **kwargs: Any) -> None: - """ - :keyword type: The type of identity used for the private cloud. The type 'SystemAssigned' - refers to an implicitly created identity. The type 'None' will remove any identities from the - Private Cloud. Known values are: "SystemAssigned" and "None". - :paramtype type: str or ~azure.mgmt.avs.models.ResourceIdentityType - """ - super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - - -class PrivateCloudList(_serialization.Model): - """A paged list of private clouds. +class PrivateCloudListResult(_serialization.Model): + """The response of a PrivateCloud list operation. - 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 value: The items on the page. + :ivar value: The PrivateCloud items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.PrivateCloud] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -2383,16 +2402,27 @@ class PrivateCloudList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: List["_models.PrivateCloud"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The PrivateCloud items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.PrivateCloud] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link -class PrivateCloudUpdateProperties(_serialization.Model): - """The properties of a private cloud resource that may be updated. +class PrivateCloudUpdate(_serialization.Model): + """An update to a private cloud resource. + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. + :vartype sku: ~azure.mgmt.avs.models.Sku + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.avs.models.SystemAssignedServiceIdentity :ivar management_cluster: The default cluster used for management. :vartype management_cluster: ~azure.mgmt.avs.models.ManagementCluster :ivar internet: Connectivity to internet is enabled or disabled. Known values are: "Enabled" @@ -2406,32 +2436,50 @@ class PrivateCloudUpdateProperties(_serialization.Model): :ivar encryption: Customer managed key encryption, can be enabled or disabled. :vartype encryption: ~azure.mgmt.avs.models.Encryption :ivar extended_network_blocks: Array of additional networks noncontiguous with networkBlock. - Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and - this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + Networks must be + unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + (A.B.C.D/X). :vartype extended_network_blocks: list[str] + :ivar dns_zone_type: The type of DNS zone to use. Known values are: "Public" and "Private". + :vartype dns_zone_type: str or ~azure.mgmt.avs.models.DnsZoneType """ _attribute_map = { - "management_cluster": {"key": "managementCluster", "type": "ManagementCluster"}, - "internet": {"key": "internet", "type": "str"}, - "identity_sources": {"key": "identitySources", "type": "[IdentitySource]"}, - "availability": {"key": "availability", "type": "AvailabilityProperties"}, - "encryption": {"key": "encryption", "type": "Encryption"}, - "extended_network_blocks": {"key": "extendedNetworkBlocks", "type": "[str]"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "SystemAssignedServiceIdentity"}, + "management_cluster": {"key": "properties.managementCluster", "type": "ManagementCluster"}, + "internet": {"key": "properties.internet", "type": "str"}, + "identity_sources": {"key": "properties.identitySources", "type": "[IdentitySource]"}, + "availability": {"key": "properties.availability", "type": "AvailabilityProperties"}, + "encryption": {"key": "properties.encryption", "type": "Encryption"}, + "extended_network_blocks": {"key": "properties.extendedNetworkBlocks", "type": "[str]"}, + "dns_zone_type": {"key": "properties.dnsZoneType", "type": "str"}, } def __init__( self, *, + tags: Optional[Dict[str, str]] = None, + sku: Optional["_models.Sku"] = None, + identity: Optional["_models.SystemAssignedServiceIdentity"] = None, management_cluster: Optional["_models.ManagementCluster"] = None, - internet: Union[str, "_models.InternetEnum"] = "Disabled", + internet: Optional[Union[str, "_models.InternetEnum"]] = None, identity_sources: Optional[List["_models.IdentitySource"]] = None, availability: Optional["_models.AvailabilityProperties"] = None, encryption: Optional["_models.Encryption"] = None, extended_network_blocks: Optional[List[str]] = None, + dns_zone_type: Optional[Union[str, "_models.DnsZoneType"]] = None, **kwargs: Any ) -> None: """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The SKU (Stock Keeping Unit) assigned to this resource. + :paramtype sku: ~azure.mgmt.avs.models.Sku + :keyword identity: The managed service identities assigned to this resource. + :paramtype identity: ~azure.mgmt.avs.models.SystemAssignedServiceIdentity :keyword management_cluster: The default cluster used for management. :paramtype management_cluster: ~azure.mgmt.avs.models.ManagementCluster :keyword internet: Connectivity to internet is enabled or disabled. Known values are: "Enabled" @@ -2445,327 +2493,51 @@ def __init__( :keyword encryption: Customer managed key encryption, can be enabled or disabled. :paramtype encryption: ~azure.mgmt.avs.models.Encryption :keyword extended_network_blocks: Array of additional networks noncontiguous with networkBlock. - Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and - this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). + Networks must be + unique and non-overlapping across VNet in your subscription, on-premise, and + this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + (A.B.C.D/X). :paramtype extended_network_blocks: list[str] + :keyword dns_zone_type: The type of DNS zone to use. Known values are: "Public" and "Private". + :paramtype dns_zone_type: str or ~azure.mgmt.avs.models.DnsZoneType """ super().__init__(**kwargs) + self.tags = tags + self.sku = sku + self.identity = identity self.management_cluster = management_cluster self.internet = internet self.identity_sources = identity_sources self.availability = availability self.encryption = encryption self.extended_network_blocks = extended_network_blocks + self.dns_zone_type = dns_zone_type -class PrivateCloudProperties(PrivateCloudUpdateProperties): # pylint: disable=too-many-instance-attributes - """The properties of a private cloud resource. +class ScriptExecutionParameter(_serialization.Model): + """The arguments passed in to the execution. - Variables are only populated by the server, and will be ignored when sending a request. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + PSCredentialExecutionParameter, ScriptSecureStringExecutionParameter, + ScriptStringExecutionParameter All required parameters must be populated in order to send to Azure. - :ivar management_cluster: The default cluster used for management. - :vartype management_cluster: ~azure.mgmt.avs.models.ManagementCluster - :ivar internet: Connectivity to internet is enabled or disabled. Known values are: "Enabled" - and "Disabled". - :vartype internet: str or ~azure.mgmt.avs.models.InternetEnum - :ivar identity_sources: vCenter Single Sign On Identity Sources. - :vartype identity_sources: list[~azure.mgmt.avs.models.IdentitySource] - :ivar availability: Properties describing how the cloud is distributed across availability - zones. - :vartype availability: ~azure.mgmt.avs.models.AvailabilityProperties - :ivar encryption: Customer managed key encryption, can be enabled or disabled. - :vartype encryption: ~azure.mgmt.avs.models.Encryption - :ivar extended_network_blocks: Array of additional networks noncontiguous with networkBlock. - Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and - this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). - :vartype extended_network_blocks: list[str] - :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Cancelled", "Pending", "Building", "Deleting", "Updating", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.avs.models.PrivateCloudProvisioningState - :ivar circuit: An ExpressRoute Circuit. - :vartype circuit: ~azure.mgmt.avs.models.Circuit - :ivar endpoints: The endpoints. - :vartype endpoints: ~azure.mgmt.avs.models.Endpoints - :ivar network_block: The block of addresses should be unique across VNet in your subscription - as well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are - between 0 and 255, and X is between 0 and 22. Required. - :vartype network_block: str - :ivar management_network: Network used to access vCenter Server and NSX-T Manager. - :vartype management_network: str - :ivar provisioning_network: Used for virtual machine cold migration, cloning, and snapshot - migration. - :vartype provisioning_network: str - :ivar vmotion_network: Used for live migration of virtual machines. - :vartype vmotion_network: str - :ivar vcenter_password: Optionally, set the vCenter admin password when the private cloud is - created. - :vartype vcenter_password: str - :ivar nsxt_password: Optionally, set the NSX-T Manager password when the private cloud is - created. - :vartype nsxt_password: str - :ivar vcenter_certificate_thumbprint: Thumbprint of the vCenter Server SSL certificate. - :vartype vcenter_certificate_thumbprint: str - :ivar nsxt_certificate_thumbprint: Thumbprint of the NSX-T Manager SSL certificate. - :vartype nsxt_certificate_thumbprint: str - :ivar external_cloud_links: Array of cloud link IDs from other clouds that connect to this one. - :vartype external_cloud_links: list[str] - :ivar secondary_circuit: A secondary expressRoute circuit from a separate AZ. Only present in a - stretched private cloud. - :vartype secondary_circuit: ~azure.mgmt.avs.models.Circuit - :ivar nsx_public_ip_quota_raised: Flag to indicate whether the private cloud has the quota for - provisioned NSX Public IP count raised from 64 to 1024. Known values are: "Enabled" and - "Disabled". - :vartype nsx_public_ip_quota_raised: str or ~azure.mgmt.avs.models.NsxPublicIpQuotaRaisedEnum - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "endpoints": {"readonly": True}, - "network_block": {"required": True}, - "management_network": {"readonly": True}, - "provisioning_network": {"readonly": True}, - "vmotion_network": {"readonly": True}, - "vcenter_certificate_thumbprint": {"readonly": True}, - "nsxt_certificate_thumbprint": {"readonly": True}, - "external_cloud_links": {"readonly": True}, - "nsx_public_ip_quota_raised": {"readonly": True}, - } - - _attribute_map = { - "management_cluster": {"key": "managementCluster", "type": "ManagementCluster"}, - "internet": {"key": "internet", "type": "str"}, - "identity_sources": {"key": "identitySources", "type": "[IdentitySource]"}, - "availability": {"key": "availability", "type": "AvailabilityProperties"}, - "encryption": {"key": "encryption", "type": "Encryption"}, - "extended_network_blocks": {"key": "extendedNetworkBlocks", "type": "[str]"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "circuit": {"key": "circuit", "type": "Circuit"}, - "endpoints": {"key": "endpoints", "type": "Endpoints"}, - "network_block": {"key": "networkBlock", "type": "str"}, - "management_network": {"key": "managementNetwork", "type": "str"}, - "provisioning_network": {"key": "provisioningNetwork", "type": "str"}, - "vmotion_network": {"key": "vmotionNetwork", "type": "str"}, - "vcenter_password": {"key": "vcenterPassword", "type": "str"}, - "nsxt_password": {"key": "nsxtPassword", "type": "str"}, - "vcenter_certificate_thumbprint": {"key": "vcenterCertificateThumbprint", "type": "str"}, - "nsxt_certificate_thumbprint": {"key": "nsxtCertificateThumbprint", "type": "str"}, - "external_cloud_links": {"key": "externalCloudLinks", "type": "[str]"}, - "secondary_circuit": {"key": "secondaryCircuit", "type": "Circuit"}, - "nsx_public_ip_quota_raised": {"key": "nsxPublicIpQuotaRaised", "type": "str"}, - } - - def __init__( - self, - *, - network_block: str, - management_cluster: Optional["_models.ManagementCluster"] = None, - internet: Union[str, "_models.InternetEnum"] = "Disabled", - identity_sources: Optional[List["_models.IdentitySource"]] = None, - availability: Optional["_models.AvailabilityProperties"] = None, - encryption: Optional["_models.Encryption"] = None, - extended_network_blocks: Optional[List[str]] = None, - circuit: Optional["_models.Circuit"] = None, - vcenter_password: Optional[str] = None, - nsxt_password: Optional[str] = None, - secondary_circuit: Optional["_models.Circuit"] = None, - **kwargs: Any - ) -> None: - """ - :keyword management_cluster: The default cluster used for management. - :paramtype management_cluster: ~azure.mgmt.avs.models.ManagementCluster - :keyword internet: Connectivity to internet is enabled or disabled. Known values are: "Enabled" - and "Disabled". - :paramtype internet: str or ~azure.mgmt.avs.models.InternetEnum - :keyword identity_sources: vCenter Single Sign On Identity Sources. - :paramtype identity_sources: list[~azure.mgmt.avs.models.IdentitySource] - :keyword availability: Properties describing how the cloud is distributed across availability - zones. - :paramtype availability: ~azure.mgmt.avs.models.AvailabilityProperties - :keyword encryption: Customer managed key encryption, can be enabled or disabled. - :paramtype encryption: ~azure.mgmt.avs.models.Encryption - :keyword extended_network_blocks: Array of additional networks noncontiguous with networkBlock. - Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and - this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). - :paramtype extended_network_blocks: list[str] - :keyword circuit: An ExpressRoute Circuit. - :paramtype circuit: ~azure.mgmt.avs.models.Circuit - :keyword network_block: The block of addresses should be unique across VNet in your - subscription as well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where - A,B,C,D are between 0 and 255, and X is between 0 and 22. Required. - :paramtype network_block: str - :keyword vcenter_password: Optionally, set the vCenter admin password when the private cloud is - created. - :paramtype vcenter_password: str - :keyword nsxt_password: Optionally, set the NSX-T Manager password when the private cloud is - created. - :paramtype nsxt_password: str - :keyword secondary_circuit: A secondary expressRoute circuit from a separate AZ. Only present - in a stretched private cloud. - :paramtype secondary_circuit: ~azure.mgmt.avs.models.Circuit - """ - super().__init__( - management_cluster=management_cluster, - internet=internet, - identity_sources=identity_sources, - availability=availability, - encryption=encryption, - extended_network_blocks=extended_network_blocks, - **kwargs - ) - self.provisioning_state = None - self.circuit = circuit - self.endpoints = None - self.network_block = network_block - self.management_network = None - self.provisioning_network = None - self.vmotion_network = None - self.vcenter_password = vcenter_password - self.nsxt_password = nsxt_password - self.vcenter_certificate_thumbprint = None - self.nsxt_certificate_thumbprint = None - self.external_cloud_links = None - self.secondary_circuit = secondary_circuit - self.nsx_public_ip_quota_raised = None - - -class PrivateCloudUpdate(_serialization.Model): - """An update to a private cloud resource. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: The identity of the private cloud, if configured. - :vartype identity: ~azure.mgmt.avs.models.PrivateCloudIdentity - :ivar management_cluster: The default cluster used for management. - :vartype management_cluster: ~azure.mgmt.avs.models.ManagementCluster - :ivar internet: Connectivity to internet is enabled or disabled. Known values are: "Enabled" - and "Disabled". - :vartype internet: str or ~azure.mgmt.avs.models.InternetEnum - :ivar identity_sources: vCenter Single Sign On Identity Sources. - :vartype identity_sources: list[~azure.mgmt.avs.models.IdentitySource] - :ivar availability: Properties describing how the cloud is distributed across availability - zones. - :vartype availability: ~azure.mgmt.avs.models.AvailabilityProperties - :ivar encryption: Customer managed key encryption, can be enabled or disabled. - :vartype encryption: ~azure.mgmt.avs.models.Encryption - :ivar extended_network_blocks: Array of additional networks noncontiguous with networkBlock. - Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and - this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). - :vartype extended_network_blocks: list[str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "PrivateCloudIdentity"}, - "management_cluster": {"key": "properties.managementCluster", "type": "ManagementCluster"}, - "internet": {"key": "properties.internet", "type": "str"}, - "identity_sources": {"key": "properties.identitySources", "type": "[IdentitySource]"}, - "availability": {"key": "properties.availability", "type": "AvailabilityProperties"}, - "encryption": {"key": "properties.encryption", "type": "Encryption"}, - "extended_network_blocks": {"key": "properties.extendedNetworkBlocks", "type": "[str]"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.PrivateCloudIdentity"] = None, - management_cluster: Optional["_models.ManagementCluster"] = None, - internet: Union[str, "_models.InternetEnum"] = "Disabled", - identity_sources: Optional[List["_models.IdentitySource"]] = None, - availability: Optional["_models.AvailabilityProperties"] = None, - encryption: Optional["_models.Encryption"] = None, - extended_network_blocks: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: The identity of the private cloud, if configured. - :paramtype identity: ~azure.mgmt.avs.models.PrivateCloudIdentity - :keyword management_cluster: The default cluster used for management. - :paramtype management_cluster: ~azure.mgmt.avs.models.ManagementCluster - :keyword internet: Connectivity to internet is enabled or disabled. Known values are: "Enabled" - and "Disabled". - :paramtype internet: str or ~azure.mgmt.avs.models.InternetEnum - :keyword identity_sources: vCenter Single Sign On Identity Sources. - :paramtype identity_sources: list[~azure.mgmt.avs.models.IdentitySource] - :keyword availability: Properties describing how the cloud is distributed across availability - zones. - :paramtype availability: ~azure.mgmt.avs.models.AvailabilityProperties - :keyword encryption: Customer managed key encryption, can be enabled or disabled. - :paramtype encryption: ~azure.mgmt.avs.models.Encryption - :keyword extended_network_blocks: Array of additional networks noncontiguous with networkBlock. - Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and - this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X). - :paramtype extended_network_blocks: list[str] - """ - super().__init__(**kwargs) - self.tags = tags - self.identity = identity - self.management_cluster = management_cluster - self.internet = internet - self.identity_sources = identity_sources - self.availability = availability - self.encryption = encryption - self.extended_network_blocks = extended_network_blocks - - -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. - - 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 - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - - -class ScriptExecutionParameter(_serialization.Model): - """The arguments passed in to the execution. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - PSCredentialExecutionParameter, ScriptSecureStringExecutionParameter, - ScriptStringExecutionParameter - - All required parameters must be populated in order to send to Azure. - - :ivar name: The parameter name. Required. - :vartype name: str - :ivar type: The type of execution parameter. Required. Known values are: "Value", + :ivar type: script execution parameter type. Required. Known values are: "Value", "SecureValue", and "Credential". :vartype type: str or ~azure.mgmt.avs.models.ScriptExecutionParameterType + :ivar name: The parameter name. Required. + :vartype name: str """ _validation = { - "name": {"required": True}, "type": {"required": True}, + "name": {"required": True}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "str"}, } _subtype_map = { @@ -2782,8 +2554,8 @@ def __init__(self, *, name: str, **kwargs: Any) -> None: :paramtype name: str """ super().__init__(**kwargs) - self.name = name self.type: Optional[str] = None + self.name = name class PSCredentialExecutionParameter(ScriptExecutionParameter): @@ -2791,11 +2563,11 @@ class PSCredentialExecutionParameter(ScriptExecutionParameter): All required parameters must be populated in order to send to Azure. - :ivar name: The parameter name. Required. - :vartype name: str - :ivar type: The type of execution parameter. Required. Known values are: "Value", + :ivar type: script execution parameter type. Required. Known values are: "Value", "SecureValue", and "Credential". :vartype type: str or ~azure.mgmt.avs.models.ScriptExecutionParameterType + :ivar name: The parameter name. Required. + :vartype name: str :ivar username: username for login. :vartype username: str :ivar password: password for login. @@ -2803,13 +2575,13 @@ class PSCredentialExecutionParameter(ScriptExecutionParameter): """ _validation = { - "name": {"required": True}, "type": {"required": True}, + "name": {"required": True}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "str"}, "username": {"key": "username", "type": "str"}, "password": {"key": "password", "type": "str"}, } @@ -2865,16 +2637,27 @@ class ScriptCmdlet(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.ScriptCmdletProvisioningState :ivar description: Description of the scripts functionality. :vartype description: str :ivar timeout: Recommended time limit for execution. :vartype timeout: str + :ivar audience: Specifies whether a script cmdlet is intended to be invoked only through + automation or visible to customers. Known values are: "Automation" and "Any". + :vartype audience: str or ~azure.mgmt.avs.models.ScriptCmdletAudience :ivar parameters: Parameters the script will accept. :vartype parameters: list[~azure.mgmt.avs.models.ScriptParameter] """ @@ -2883,8 +2666,11 @@ class ScriptCmdlet(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, "description": {"readonly": True}, "timeout": {"readonly": True}, + "audience": {"readonly": True}, "parameters": {"readonly": True}, } @@ -2892,33 +2678,37 @@ class ScriptCmdlet(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "description": {"key": "properties.description", "type": "str"}, "timeout": {"key": "properties.timeout", "type": "str"}, + "audience": {"key": "properties.audience", "type": "str"}, "parameters": {"key": "properties.parameters", "type": "[ScriptParameter]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) + self.provisioning_state = None self.description = None self.timeout = None + self.audience = None self.parameters = None -class ScriptCmdletsList(_serialization.Model): - """Pageable list of scripts/cmdlets. +class ScriptCmdletListResult(_serialization.Model): + """The response of a ScriptCmdlet list operation. - 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 value: List of scripts. + :ivar value: The ScriptCmdlet items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.ScriptCmdlet] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -2926,11 +2716,16 @@ class ScriptCmdletsList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: List["_models.ScriptCmdlet"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The ScriptCmdlet items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.ScriptCmdlet] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link class ScriptExecution(ProxyResource): # pylint: disable=too-many-instance-attributes @@ -2938,19 +2733,25 @@ class ScriptExecution(ProxyResource): # pylint: disable=too-many-instance-attri Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData :ivar script_cmdlet_id: A reference to the script cmdlet resource if user is running a AVS script. :vartype script_cmdlet_id: str :ivar parameters: Parameters the script will accept. :vartype parameters: list[~azure.mgmt.avs.models.ScriptExecutionParameter] :ivar hidden_parameters: Parameters that will be hidden/not visible to ARM, such as passwords - and credentials. + and + credentials. :vartype hidden_parameters: list[~azure.mgmt.avs.models.ScriptExecutionParameter] :ivar failure_reason: Error message if the script was able to run, but if the script itself had errors or powershell threw an exception. @@ -2966,8 +2767,8 @@ class ScriptExecution(ProxyResource): # pylint: disable=too-many-instance-attri :ivar finished_at: Time the script execution was finished. :vartype finished_at: ~datetime.datetime :ivar provisioning_state: The state of the script execution resource. Known values are: - "Pending", "Running", "Succeeded", "Failed", "Cancelling", "Cancelled", "Deleting", and - "Canceled". + "Succeeded", "Failed", "Canceled", "Pending", "Running", "Cancelling", "Cancelled", and + "Deleting". :vartype provisioning_state: str or ~azure.mgmt.avs.models.ScriptExecutionProvisioningState :ivar output: Standard output stream from the powershell execution. :vartype output: list[str] @@ -2985,6 +2786,7 @@ class ScriptExecution(ProxyResource): # pylint: disable=too-many-instance-attri "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "submitted_at": {"readonly": True}, "started_at": {"readonly": True}, "finished_at": {"readonly": True}, @@ -2998,6 +2800,7 @@ class ScriptExecution(ProxyResource): # pylint: disable=too-many-instance-attri "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "script_cmdlet_id": {"key": "properties.scriptCmdletId", "type": "str"}, "parameters": {"key": "properties.parameters", "type": "[ScriptExecutionParameter]"}, "hidden_parameters": {"key": "properties.hiddenParameters", "type": "[ScriptExecutionParameter]"}, @@ -3035,10 +2838,12 @@ def __init__( :keyword parameters: Parameters the script will accept. :paramtype parameters: list[~azure.mgmt.avs.models.ScriptExecutionParameter] :keyword hidden_parameters: Parameters that will be hidden/not visible to ARM, such as - passwords and credentials. + passwords and + credentials. :paramtype hidden_parameters: list[~azure.mgmt.avs.models.ScriptExecutionParameter] :keyword failure_reason: Error message if the script was able to run, but if the script itself - had errors or powershell threw an exception. + had + errors or powershell threw an exception. :paramtype failure_reason: str :keyword timeout: Time limit for execution. :paramtype timeout: str @@ -3068,20 +2873,19 @@ def __init__( self.errors = None -class ScriptExecutionsList(_serialization.Model): - """Pageable list of script executions. +class ScriptExecutionListResult(_serialization.Model): + """The response of a ScriptExecution list operation. - 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 value: List of scripts. + :ivar value: The ScriptExecution items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.ScriptExecution] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -3089,11 +2893,18 @@ class ScriptExecutionsList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.ScriptExecution"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The ScriptExecution items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.ScriptExecution] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link class ScriptPackage(ProxyResource): @@ -3101,12 +2912,20 @@ class ScriptPackage(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.ScriptPackageProvisioningState :ivar description: User friendly description of the package. :vartype description: str :ivar version: Module version. @@ -3121,6 +2940,8 @@ class ScriptPackage(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, "description": {"readonly": True}, "version": {"readonly": True}, "company": {"readonly": True}, @@ -3131,6 +2952,8 @@ class ScriptPackage(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "description": {"key": "properties.description", "type": "str"}, "version": {"key": "properties.version", "type": "str"}, "company": {"key": "properties.company", "type": "str"}, @@ -3140,26 +2963,26 @@ class ScriptPackage(ProxyResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) + self.provisioning_state = None self.description = None self.version = None self.company = None self.uri = None -class ScriptPackagesList(_serialization.Model): - """A list of the available script packages. +class ScriptPackageListResult(_serialization.Model): + """The response of a ScriptPackage list operation. - 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 value: List of script package resources. + :ivar value: The ScriptPackage items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.ScriptPackage] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -3167,11 +2990,16 @@ class ScriptPackagesList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: List["_models.ScriptPackage"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The ScriptPackage items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.ScriptPackage] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link class ScriptParameter(_serialization.Model): @@ -3228,23 +3056,23 @@ class ScriptSecureStringExecutionParameter(ScriptExecutionParameter): All required parameters must be populated in order to send to Azure. - :ivar name: The parameter name. Required. - :vartype name: str - :ivar type: The type of execution parameter. Required. Known values are: "Value", + :ivar type: script execution parameter type. Required. Known values are: "Value", "SecureValue", and "Credential". :vartype type: str or ~azure.mgmt.avs.models.ScriptExecutionParameterType + :ivar name: The parameter name. Required. + :vartype name: str :ivar secure_value: A secure value for the passed parameter, not to be stored in logs. :vartype secure_value: str """ _validation = { - "name": {"required": True}, "type": {"required": True}, + "name": {"required": True}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "str"}, "secure_value": {"key": "secureValue", "type": "str"}, } @@ -3265,23 +3093,23 @@ class ScriptStringExecutionParameter(ScriptExecutionParameter): All required parameters must be populated in order to send to Azure. - :ivar name: The parameter name. Required. - :vartype name: str - :ivar type: The type of execution parameter. Required. Known values are: "Value", + :ivar type: script execution parameter type. Required. Known values are: "Value", "SecureValue", and "Credential". :vartype type: str or ~azure.mgmt.avs.models.ScriptExecutionParameterType + :ivar name: The parameter name. Required. + :vartype name: str :ivar value: The value for the passed parameter. :vartype value: str """ _validation = { - "name": {"required": True}, "type": {"required": True}, + "name": {"required": True}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "str"}, "value": {"key": "value", "type": "str"}, } @@ -3297,62 +3125,179 @@ def __init__(self, *, name: str, value: Optional[str] = None, **kwargs: Any) -> self.value = value -class ServiceSpecification(_serialization.Model): - """Service specification payload. +class Sku(_serialization.Model): + """The resource model definition representing SKU. + + All required parameters must be populated in order to send to Azure. - :ivar log_specifications: Specifications of the Log for Azure Monitoring. - :vartype log_specifications: list[~azure.mgmt.avs.models.LogSpecification] - :ivar metric_specifications: Specifications of the Metrics for Azure Monitoring. - :vartype metric_specifications: list[~azure.mgmt.avs.models.MetricSpecification] + :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. + :vartype name: str + :ivar tier: This field is required to be implemented by the Resource Provider if the service + has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", + "Standard", and "Premium". + :vartype tier: str or ~azure.mgmt.avs.models.SkuTier + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :vartype capacity: int """ + _validation = { + "name": {"required": True}, + } + _attribute_map = { - "log_specifications": {"key": "logSpecifications", "type": "[LogSpecification]"}, - "metric_specifications": {"key": "metricSpecifications", "type": "[MetricSpecification]"}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } def __init__( self, *, - log_specifications: Optional[List["_models.LogSpecification"]] = None, - metric_specifications: Optional[List["_models.MetricSpecification"]] = None, + name: str, + tier: Optional[Union[str, "_models.SkuTier"]] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword log_specifications: Specifications of the Log for Azure Monitoring. - :paramtype log_specifications: list[~azure.mgmt.avs.models.LogSpecification] - :keyword metric_specifications: Specifications of the Metrics for Azure Monitoring. - :paramtype metric_specifications: list[~azure.mgmt.avs.models.MetricSpecification] + :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. + :paramtype name: str + :keyword tier: This field is required to be implemented by the Resource Provider if the service + has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", + "Standard", and "Premium". + :paramtype tier: str or ~azure.mgmt.avs.models.SkuTier + :keyword size: The SKU size. When the name field is the combination of tier and some other + value, this would be the standalone code. + :paramtype size: str + :keyword family: If the service has different generations of hardware, for the same SKU, then + that can be captured here. + :paramtype family: str + :keyword capacity: If the SKU supports scale out/in then the capacity integer should be + included. If scale out/in is not possible for the resource this may be omitted. + :paramtype capacity: int """ super().__init__(**kwargs) - self.log_specifications = log_specifications - self.metric_specifications = metric_specifications + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity -class Sku(_serialization.Model): - """The resource model definition representing SKU. +class SystemAssignedServiceIdentity(_serialization.Model): + """Managed service identity (either system assigned, or none). + + 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 name: The name of the SKU. Required. - :vartype name: str + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: Type of managed service identity (either system assigned, or none). Required. Known + values are: "None" and "SystemAssigned". + :vartype type: str or ~azure.mgmt.avs.models.SystemAssignedServiceIdentityType """ _validation = { - "name": {"required": True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: str, **kwargs: Any) -> None: + def __init__(self, *, type: Union[str, "_models.SystemAssignedServiceIdentityType"], **kwargs: Any) -> None: """ - :keyword name: The name of the SKU. Required. - :paramtype name: str + :keyword type: Type of managed service identity (either system assigned, or none). Required. + Known values are: "None" and "SystemAssigned". + :paramtype type: str or ~azure.mgmt.avs.models.SystemAssignedServiceIdentityType """ super().__init__(**kwargs) - self.name = name + self.principal_id = None + self.tenant_id = None + self.type = type + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.avs.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.avs.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or ~azure.mgmt.avs.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or ~azure.mgmt.avs.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at class Trial(_serialization.Model): @@ -3389,12 +3334,20 @@ class VirtualMachine(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.VirtualMachineProvisioningState :ivar display_name: Display name of the VM. :vartype display_name: str :ivar mo_ref_id: Virtual machine managed object reference id. @@ -3411,6 +3364,8 @@ class VirtualMachine(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, "display_name": {"readonly": True}, "mo_ref_id": {"readonly": True}, "folder_path": {"readonly": True}, @@ -3421,6 +3376,8 @@ class VirtualMachine(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "display_name": {"key": "properties.displayName", "type": "str"}, "mo_ref_id": {"key": "properties.moRefId", "type": "str"}, "folder_path": {"key": "properties.folderPath", "type": "str"}, @@ -3430,12 +3387,47 @@ class VirtualMachine(ProxyResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) + self.provisioning_state = None self.display_name = None self.mo_ref_id = None self.folder_path = None self.restrict_movement = None +class VirtualMachineListResult(_serialization.Model): + """The response of a VirtualMachine list operation. + + All required parameters must be populated in order to send to Azure. + + :ivar value: The VirtualMachine items on this page. Required. + :vartype value: list[~azure.mgmt.avs.models.VirtualMachine] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualMachine]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.VirtualMachine"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The VirtualMachine items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.VirtualMachine] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + class VirtualMachineRestrictMovement(_serialization.Model): """Set VM DRS-driven movement to restricted (enabled) or not (disabled). @@ -3463,34 +3455,6 @@ def __init__( self.restrict_movement = restrict_movement -class VirtualMachinesList(_serialization.Model): - """A list of Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The items to be displayed on the page. - :vartype value: list[~azure.mgmt.avs.models.VirtualMachine] - :ivar next_link: URL to get the next page if any. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[VirtualMachine]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - class VmHostPlacementPolicyProperties(PlacementPolicyProperties): """VM-Host placement policy properties. @@ -3498,7 +3462,7 @@ class VmHostPlacementPolicyProperties(PlacementPolicyProperties): All required parameters must be populated in order to send to Azure. - :ivar type: placement policy type. Required. Known values are: "VmVm" and "VmHost". + :ivar type: Placement Policy type. Required. Known values are: "VmVm" and "VmHost". :vartype type: str or ~azure.mgmt.avs.models.PlacementPolicyType :ivar state: Whether the placement policy is enabled or disabled. Known values are: "Enabled" and "Disabled". @@ -3506,7 +3470,7 @@ class VmHostPlacementPolicyProperties(PlacementPolicyProperties): :ivar display_name: Display name of the placement policy. :vartype display_name: str :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.PlacementPolicyProvisioningState :ivar vm_members: Virtual machine members list. Required. :vartype vm_members: list[str] @@ -3591,7 +3555,7 @@ class VmPlacementPolicyProperties(PlacementPolicyProperties): All required parameters must be populated in order to send to Azure. - :ivar type: placement policy type. Required. Known values are: "VmVm" and "VmHost". + :ivar type: Placement Policy type. Required. Known values are: "VmVm" and "VmHost". :vartype type: str or ~azure.mgmt.avs.models.PlacementPolicyType :ivar state: Whether the placement policy is enabled or disabled. Known values are: "Enabled" and "Disabled". @@ -3599,7 +3563,7 @@ class VmPlacementPolicyProperties(PlacementPolicyProperties): :ivar display_name: Display name of the placement policy. :vartype display_name: str :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.PlacementPolicyProvisioningState :ivar vm_members: Virtual machine members list. Required. :vartype vm_members: list[str] @@ -3656,29 +3620,42 @@ class WorkloadNetwork(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", "Canceled", "Building", "Deleting", and "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkProvisioningState """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) + self.provisioning_state = None class WorkloadNetworkDhcp(ProxyResource): @@ -3686,13 +3663,18 @@ class WorkloadNetworkDhcp(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar properties: DHCP properties. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.avs.models.WorkloadNetworkDhcpEntity """ @@ -3700,18 +3682,20 @@ class WorkloadNetworkDhcp(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "properties": {"key": "properties", "type": "WorkloadNetworkDhcpEntity"}, } def __init__(self, *, properties: Optional["_models.WorkloadNetworkDhcpEntity"] = None, **kwargs: Any) -> None: """ - :keyword properties: DHCP properties. + :keyword properties: The resource-specific properties for this resource. :paramtype properties: ~azure.mgmt.avs.models.WorkloadNetworkDhcpEntity """ super().__init__(**kwargs) @@ -3719,7 +3703,8 @@ def __init__(self, *, properties: Optional["_models.WorkloadNetworkDhcpEntity"] class WorkloadNetworkDhcpEntity(_serialization.Model): - """Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from. + """Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to + inherit from. You probably want to use the sub-classes and not this class directly. Known sub-classes are: WorkloadNetworkDhcpRelay, WorkloadNetworkDhcpServer @@ -3736,7 +3721,7 @@ class WorkloadNetworkDhcpEntity(_serialization.Model): :ivar segments: NSX Segments consuming DHCP. :vartype segments: list[str] :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState :ivar revision: NSX revision number. :vartype revision: int @@ -3773,20 +3758,64 @@ def __init__(self, *, display_name: Optional[str] = None, revision: Optional[int self.revision = revision -class WorkloadNetworkDhcpList(_serialization.Model): - """A list of NSX dhcp entities. +class WorkloadNetworkDhcpEntityUpdate(_serialization.Model): + """Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to + inherit from. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + WorkloadNetworkDhcpRelayUpdate, WorkloadNetworkDhcpServerUpdate + + All required parameters must be populated in order to send to Azure. + + :ivar dhcp_type: Type of DHCP: SERVER or RELAY. Required. Known values are: "SERVER" and + "RELAY". + :vartype dhcp_type: str or ~azure.mgmt.avs.models.DhcpTypeEnum + :ivar display_name: Display name of the DHCP entity. + :vartype display_name: str + :ivar revision: NSX revision number. + :vartype revision: int + """ + + _validation = { + "dhcp_type": {"required": True}, + } + + _attribute_map = { + "dhcp_type": {"key": "dhcpType", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "revision": {"key": "revision", "type": "int"}, + } + + _subtype_map = { + "dhcp_type": {"RELAY": "WorkloadNetworkDhcpRelayUpdate", "SERVER": "WorkloadNetworkDhcpServerUpdate"} + } + + def __init__(self, *, display_name: Optional[str] = None, revision: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword display_name: Display name of the DHCP entity. + :paramtype display_name: str + :keyword revision: NSX revision number. + :paramtype revision: int + """ + super().__init__(**kwargs) + self.dhcp_type: Optional[str] = None + self.display_name = display_name + self.revision = revision - Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The items on the page. +class WorkloadNetworkDhcpListResult(_serialization.Model): + """The response of a WorkloadNetworkDhcp list operation. + + All required parameters must be populated in order to send to Azure. + + :ivar value: The WorkloadNetworkDhcp items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkDhcp] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -3794,11 +3823,18 @@ class WorkloadNetworkDhcpList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.WorkloadNetworkDhcp"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The WorkloadNetworkDhcp items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link class WorkloadNetworkDhcpRelay(WorkloadNetworkDhcpEntity): @@ -3816,7 +3852,7 @@ class WorkloadNetworkDhcpRelay(WorkloadNetworkDhcpEntity): :ivar segments: NSX Segments consuming DHCP. :vartype segments: list[str] :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState :ivar revision: NSX revision number. :vartype revision: int @@ -3861,6 +3897,55 @@ def __init__( self.server_addresses = server_addresses +class WorkloadNetworkDhcpRelayUpdate(WorkloadNetworkDhcpEntityUpdate): + """NSX DHCP Relay. + + All required parameters must be populated in order to send to Azure. + + :ivar dhcp_type: Type of DHCP: SERVER or RELAY. Required. Known values are: "SERVER" and + "RELAY". + :vartype dhcp_type: str or ~azure.mgmt.avs.models.DhcpTypeEnum + :ivar display_name: Display name of the DHCP entity. + :vartype display_name: str + :ivar revision: NSX revision number. + :vartype revision: int + :ivar server_addresses: DHCP Relay Addresses. Max 3. + :vartype server_addresses: list[str] + """ + + _validation = { + "dhcp_type": {"required": True}, + "server_addresses": {"max_items": 3, "min_items": 1}, + } + + _attribute_map = { + "dhcp_type": {"key": "dhcpType", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "revision": {"key": "revision", "type": "int"}, + "server_addresses": {"key": "serverAddresses", "type": "[str]"}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + revision: Optional[int] = None, + server_addresses: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_name: Display name of the DHCP entity. + :paramtype display_name: str + :keyword revision: NSX revision number. + :paramtype revision: int + :keyword server_addresses: DHCP Relay Addresses. Max 3. + :paramtype server_addresses: list[str] + """ + super().__init__(display_name=display_name, revision=revision, **kwargs) + self.dhcp_type: str = "RELAY" + self.server_addresses = server_addresses + + class WorkloadNetworkDhcpServer(WorkloadNetworkDhcpEntity): """NSX DHCP Server. @@ -3876,7 +3961,7 @@ class WorkloadNetworkDhcpServer(WorkloadNetworkDhcpEntity): :ivar segments: NSX Segments consuming DHCP. :vartype segments: list[str] :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState :ivar revision: NSX revision number. :vartype revision: int @@ -3927,42 +4012,125 @@ def __init__( self.lease_time = lease_time -class WorkloadNetworkDnsService(ProxyResource): # pylint: disable=too-many-instance-attributes - """NSX DNS Service. +class WorkloadNetworkDhcpServerUpdate(WorkloadNetworkDhcpEntityUpdate): + """NSX DHCP Server. - 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 - :ivar display_name: Display name of the DNS Service. + :ivar dhcp_type: Type of DHCP: SERVER or RELAY. Required. Known values are: "SERVER" and + "RELAY". + :vartype dhcp_type: str or ~azure.mgmt.avs.models.DhcpTypeEnum + :ivar display_name: Display name of the DHCP entity. :vartype display_name: str - :ivar dns_service_ip: DNS service IP of the DNS Service. - :vartype dns_service_ip: str - :ivar default_dns_zone: Default DNS zone of the DNS Service. - :vartype default_dns_zone: str - :ivar fqdn_zones: FQDN zones of the DNS Service. - :vartype fqdn_zones: list[str] - :ivar log_level: DNS Service log level. Known values are: "DEBUG", "INFO", "WARNING", "ERROR", - and "FATAL". - :vartype log_level: str or ~azure.mgmt.avs.models.DnsServiceLogLevelEnum - :ivar status: DNS Service status. Known values are: "SUCCESS" and "FAILURE". - :vartype status: str or ~azure.mgmt.avs.models.DnsServiceStatusEnum - :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.avs.models.WorkloadNetworkDnsServiceProvisioningState :ivar revision: NSX revision number. :vartype revision: int - """ - - _validation = { + :ivar server_address: DHCP Server Address. + :vartype server_address: str + :ivar lease_time: DHCP Server Lease Time. + :vartype lease_time: int + """ + + _validation = { + "dhcp_type": {"required": True}, + } + + _attribute_map = { + "dhcp_type": {"key": "dhcpType", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "revision": {"key": "revision", "type": "int"}, + "server_address": {"key": "serverAddress", "type": "str"}, + "lease_time": {"key": "leaseTime", "type": "int"}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + revision: Optional[int] = None, + server_address: Optional[str] = None, + lease_time: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_name: Display name of the DHCP entity. + :paramtype display_name: str + :keyword revision: NSX revision number. + :paramtype revision: int + :keyword server_address: DHCP Server Address. + :paramtype server_address: str + :keyword lease_time: DHCP Server Lease Time. + :paramtype lease_time: int + """ + super().__init__(display_name=display_name, revision=revision, **kwargs) + self.dhcp_type: str = "SERVER" + self.server_address = server_address + self.lease_time = lease_time + + +class WorkloadNetworkDhcpUpdate(_serialization.Model): + """NSX DHCP update. + + :ivar properties: The updatable properties of a DHCP update. + :vartype properties: ~azure.mgmt.avs.models.WorkloadNetworkDhcpEntityUpdate + """ + + _attribute_map = { + "properties": {"key": "properties", "type": "WorkloadNetworkDhcpEntityUpdate"}, + } + + def __init__( + self, *, properties: Optional["_models.WorkloadNetworkDhcpEntityUpdate"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: The updatable properties of a DHCP update. + :paramtype properties: ~azure.mgmt.avs.models.WorkloadNetworkDhcpEntityUpdate + """ + super().__init__(**kwargs) + self.properties = properties + + +class WorkloadNetworkDnsService(ProxyResource): # pylint: disable=too-many-instance-attributes + """NSX DNS Service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar display_name: Display name of the DNS Service. + :vartype display_name: str + :ivar dns_service_ip: DNS service IP of the DNS Service. + :vartype dns_service_ip: str + :ivar default_dns_zone: Default DNS zone of the DNS Service. + :vartype default_dns_zone: str + :ivar fqdn_zones: FQDN zones of the DNS Service. + :vartype fqdn_zones: list[str] + :ivar log_level: DNS Service log level. Known values are: "DEBUG", "INFO", "WARNING", "ERROR", + and "FATAL". + :vartype log_level: str or ~azure.mgmt.avs.models.DnsServiceLogLevelEnum + :ivar status: DNS Service status. Known values are: "SUCCESS" and "FAILURE". + :vartype status: str or ~azure.mgmt.avs.models.DnsServiceStatusEnum + :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", + "Canceled", "Building", "Deleting", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDnsServiceProvisioningState + :ivar revision: NSX revision number. + :vartype revision: int + """ + + _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "status": {"readonly": True}, "provisioning_state": {"readonly": True}, } @@ -3971,6 +4139,7 @@ class WorkloadNetworkDnsService(ProxyResource): # pylint: disable=too-many-inst "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "display_name": {"key": "properties.displayName", "type": "str"}, "dns_service_ip": {"key": "properties.dnsServiceIp", "type": "str"}, "default_dns_zone": {"key": "properties.defaultDnsZone", "type": "str"}, @@ -4018,20 +4187,19 @@ def __init__( self.revision = revision -class WorkloadNetworkDnsServicesList(_serialization.Model): - """A list of NSX DNS Services. +class WorkloadNetworkDnsServiceListResult(_serialization.Model): + """The response of a WorkloadNetworkDnsService list operation. - 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 value: The items on the page. + :ivar value: The WorkloadNetworkDnsService items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkDnsService] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -4039,24 +4207,115 @@ class WorkloadNetworkDnsServicesList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.WorkloadNetworkDnsService"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The WorkloadNetworkDnsService items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.WorkloadNetworkDnsService] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link + + +class WorkloadNetworkDnsServiceUpdate(_serialization.Model): + """NSX DNS Service update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display name of the DNS Service. + :vartype display_name: str + :ivar dns_service_ip: DNS service IP of the DNS Service. + :vartype dns_service_ip: str + :ivar default_dns_zone: Default DNS zone of the DNS Service. + :vartype default_dns_zone: str + :ivar fqdn_zones: FQDN zones of the DNS Service. + :vartype fqdn_zones: list[str] + :ivar log_level: DNS Service log level. Known values are: "DEBUG", "INFO", "WARNING", "ERROR", + and "FATAL". + :vartype log_level: str or ~azure.mgmt.avs.models.DnsServiceLogLevelEnum + :ivar status: DNS Service status. Known values are: "SUCCESS" and "FAILURE". + :vartype status: str or ~azure.mgmt.avs.models.DnsServiceStatusEnum + :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", + "Canceled", "Building", "Deleting", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDnsServiceProvisioningState + :ivar revision: NSX revision number. + :vartype revision: int + """ + + _validation = { + "status": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "dns_service_ip": {"key": "properties.dnsServiceIp", "type": "str"}, + "default_dns_zone": {"key": "properties.defaultDnsZone", "type": "str"}, + "fqdn_zones": {"key": "properties.fqdnZones", "type": "[str]"}, + "log_level": {"key": "properties.logLevel", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "revision": {"key": "properties.revision", "type": "int"}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + dns_service_ip: Optional[str] = None, + default_dns_zone: Optional[str] = None, + fqdn_zones: Optional[List[str]] = None, + log_level: Optional[Union[str, "_models.DnsServiceLogLevelEnum"]] = None, + revision: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_name: Display name of the DNS Service. + :paramtype display_name: str + :keyword dns_service_ip: DNS service IP of the DNS Service. + :paramtype dns_service_ip: str + :keyword default_dns_zone: Default DNS zone of the DNS Service. + :paramtype default_dns_zone: str + :keyword fqdn_zones: FQDN zones of the DNS Service. + :paramtype fqdn_zones: list[str] + :keyword log_level: DNS Service log level. Known values are: "DEBUG", "INFO", "WARNING", + "ERROR", and "FATAL". + :paramtype log_level: str or ~azure.mgmt.avs.models.DnsServiceLogLevelEnum + :keyword revision: NSX revision number. + :paramtype revision: int + """ + super().__init__(**kwargs) + self.display_name = display_name + self.dns_service_ip = dns_service_ip + self.default_dns_zone = default_dns_zone + self.fqdn_zones = fqdn_zones + self.log_level = log_level + self.status = None + self.provisioning_state = None + self.revision = revision -class WorkloadNetworkDnsZone(ProxyResource): +class WorkloadNetworkDnsZone(ProxyResource): # pylint: disable=too-many-instance-attributes """NSX DNS Zone. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData :ivar display_name: Display name of the DNS Zone. :vartype display_name: str :ivar domain: Domain names of the DNS Zone. @@ -4068,7 +4327,7 @@ class WorkloadNetworkDnsZone(ProxyResource): :ivar dns_services: Number of DNS Services using the DNS zone. :vartype dns_services: int :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkDnsZoneProvisioningState :ivar revision: NSX revision number. @@ -4079,6 +4338,7 @@ class WorkloadNetworkDnsZone(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "provisioning_state": {"readonly": True}, } @@ -4086,6 +4346,7 @@ class WorkloadNetworkDnsZone(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "display_name": {"key": "properties.displayName", "type": "str"}, "domain": {"key": "properties.domain", "type": "[str]"}, "dns_server_ips": {"key": "properties.dnsServerIps", "type": "[str]"}, @@ -4130,20 +4391,19 @@ def __init__( self.revision = revision -class WorkloadNetworkDnsZonesList(_serialization.Model): - """A list of NSX DNS Zones. +class WorkloadNetworkDnsZoneListResult(_serialization.Model): + """The response of a WorkloadNetworkDnsZone list operation. - 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 value: The items on the page. + :ivar value: The WorkloadNetworkDnsZone items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -4151,11 +4411,90 @@ class WorkloadNetworkDnsZonesList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.WorkloadNetworkDnsZone"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The WorkloadNetworkDnsZone items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link + + +class WorkloadNetworkDnsZoneUpdate(_serialization.Model): + """NSX DNS Zone update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display name of the DNS Zone. + :vartype display_name: str + :ivar domain: Domain names of the DNS Zone. + :vartype domain: list[str] + :ivar dns_server_ips: DNS Server IP array of the DNS Zone. + :vartype dns_server_ips: list[str] + :ivar source_ip: Source IP of the DNS Zone. + :vartype source_ip: str + :ivar dns_services: Number of DNS Services using the DNS zone. + :vartype dns_services: int + :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", + "Canceled", "Building", "Deleting", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDnsZoneProvisioningState + :ivar revision: NSX revision number. + :vartype revision: int + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "domain": {"key": "properties.domain", "type": "[str]"}, + "dns_server_ips": {"key": "properties.dnsServerIps", "type": "[str]"}, + "source_ip": {"key": "properties.sourceIp", "type": "str"}, + "dns_services": {"key": "properties.dnsServices", "type": "int"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "revision": {"key": "properties.revision", "type": "int"}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + domain: Optional[List[str]] = None, + dns_server_ips: Optional[List[str]] = None, + source_ip: Optional[str] = None, + dns_services: Optional[int] = None, + revision: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_name: Display name of the DNS Zone. + :paramtype display_name: str + :keyword domain: Domain names of the DNS Zone. + :paramtype domain: list[str] + :keyword dns_server_ips: DNS Server IP array of the DNS Zone. + :paramtype dns_server_ips: list[str] + :keyword source_ip: Source IP of the DNS Zone. + :paramtype source_ip: str + :keyword dns_services: Number of DNS Services using the DNS zone. + :paramtype dns_services: int + :keyword revision: NSX revision number. + :paramtype revision: int + """ + super().__init__(**kwargs) + self.display_name = display_name + self.domain = domain + self.dns_server_ips = dns_server_ips + self.source_ip = source_ip + self.dns_services = dns_services + self.provisioning_state = None + self.revision = revision class WorkloadNetworkGateway(ProxyResource): @@ -4163,12 +4502,20 @@ class WorkloadNetworkGateway(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", "Canceled", "Building", "Deleting", and "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkProvisioningState :ivar display_name: Display name of the DHCP entity. :vartype display_name: str :ivar path: NSX Gateway Path. @@ -4179,6 +4526,8 @@ class WorkloadNetworkGateway(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, "path": {"readonly": True}, } @@ -4186,6 +4535,8 @@ class WorkloadNetworkGateway(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "display_name": {"key": "properties.displayName", "type": "str"}, "path": {"key": "properties.path", "type": "str"}, } @@ -4196,24 +4547,24 @@ def __init__(self, *, display_name: Optional[str] = None, **kwargs: Any) -> None :paramtype display_name: str """ super().__init__(**kwargs) + self.provisioning_state = None self.display_name = display_name self.path = None -class WorkloadNetworkGatewayList(_serialization.Model): - """A list of NSX Gateways. +class WorkloadNetworkGatewayListResult(_serialization.Model): + """The response of a WorkloadNetworkGateway list operation. - 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 value: The items on the page. + :ivar value: The WorkloadNetworkGateway items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkGateway] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -4221,52 +4572,184 @@ class WorkloadNetworkGatewayList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.WorkloadNetworkGateway"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The WorkloadNetworkGateway items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.WorkloadNetworkGateway] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link + +class WorkloadNetworkListResult(_serialization.Model): + """The response of a WorkloadNetwork list operation. -class WorkloadNetworkList(_serialization.Model): - """A list of workload networks. + All required parameters must be populated in order to send to Azure. + + :ivar value: The WorkloadNetwork items on this page. Required. + :vartype value: list[~azure.mgmt.avs.models.WorkloadNetwork] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[WorkloadNetwork]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.WorkloadNetwork"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The WorkloadNetwork items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.WorkloadNetwork] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WorkloadNetworkPortMirroring(ProxyResource): # pylint: disable=too-many-instance-attributes + """NSX Port Mirroring. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The items on the page. - :vartype value: list[~azure.mgmt.avs.models.WorkloadNetwork] - :ivar next_link: URL to get the next page if any. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar display_name: Display name of the port mirroring profile. + :vartype display_name: str + :ivar direction: Direction of port mirroring profile. Known values are: "INGRESS", "EGRESS", + and "BIDIRECTIONAL". + :vartype direction: str or ~azure.mgmt.avs.models.PortMirroringDirectionEnum + :ivar source: Source VM Group. + :vartype source: str + :ivar destination: Destination VM Group. + :vartype destination: str + :ivar status: Port Mirroring Status. Known values are: "SUCCESS" and "FAILURE". + :vartype status: str or ~azure.mgmt.avs.models.PortMirroringStatusEnum + :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", + "Canceled", "Building", "Deleting", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringProvisioningState + :ivar revision: NSX revision number. + :vartype revision: int + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "status": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "display_name": {"key": "properties.displayName", "type": "str"}, + "direction": {"key": "properties.direction", "type": "str"}, + "source": {"key": "properties.source", "type": "str"}, + "destination": {"key": "properties.destination", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "revision": {"key": "properties.revision", "type": "int"}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + direction: Optional[Union[str, "_models.PortMirroringDirectionEnum"]] = None, + source: Optional[str] = None, + destination: Optional[str] = None, + revision: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_name: Display name of the port mirroring profile. + :paramtype display_name: str + :keyword direction: Direction of port mirroring profile. Known values are: "INGRESS", "EGRESS", + and "BIDIRECTIONAL". + :paramtype direction: str or ~azure.mgmt.avs.models.PortMirroringDirectionEnum + :keyword source: Source VM Group. + :paramtype source: str + :keyword destination: Destination VM Group. + :paramtype destination: str + :keyword revision: NSX revision number. + :paramtype revision: int + """ + super().__init__(**kwargs) + self.display_name = display_name + self.direction = direction + self.source = source + self.destination = destination + self.status = None + self.provisioning_state = None + self.revision = revision + + +class WorkloadNetworkPortMirroringListResult(_serialization.Model): + """The response of a WorkloadNetworkPortMirroring list operation. + + All required parameters must be populated in order to send to Azure. + + :ivar value: The WorkloadNetworkPortMirroring items on this page. Required. + :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { - "value": {"key": "value", "type": "[WorkloadNetwork]"}, + "value": {"key": "value", "type": "[WorkloadNetworkPortMirroring]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.WorkloadNetworkPortMirroring"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The WorkloadNetworkPortMirroring items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link -class WorkloadNetworkPortMirroring(ProxyResource): - """NSX Port Mirroring. +class WorkloadNetworkPortMirroringUpdate(_serialization.Model): + """NSX Port Mirroring 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 :ivar display_name: Display name of the port mirroring profile. :vartype display_name: str :ivar direction: Direction of port mirroring profile. Known values are: "INGRESS", "EGRESS", @@ -4279,7 +4762,7 @@ class WorkloadNetworkPortMirroring(ProxyResource): :ivar status: Port Mirroring Status. Known values are: "SUCCESS" and "FAILURE". :vartype status: str or ~azure.mgmt.avs.models.PortMirroringStatusEnum :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringProvisioningState :ivar revision: NSX revision number. @@ -4287,17 +4770,11 @@ class WorkloadNetworkPortMirroring(ProxyResource): """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, "status": {"readonly": True}, "provisioning_state": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, "display_name": {"key": "properties.displayName", "type": "str"}, "direction": {"key": "properties.direction", "type": "str"}, "source": {"key": "properties.source", "type": "str"}, @@ -4340,45 +4817,22 @@ def __init__( self.revision = revision -class WorkloadNetworkPortMirroringList(_serialization.Model): - """A list of NSX Port Mirroring. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The items on the page. - :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] - :ivar next_link: URL to get the next page if any. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[WorkloadNetworkPortMirroring]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - class WorkloadNetworkPublicIP(ProxyResource): """NSX Public IP Block. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData :ivar display_name: Display name of the Public IP Block. :vartype display_name: str :ivar number_of_public_i_ps: Number of Public IPs requested. @@ -4386,7 +4840,7 @@ class WorkloadNetworkPublicIP(ProxyResource): :ivar public_ip_block: CIDR Block of the Public IP Block. :vartype public_ip_block: str :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkPublicIPProvisioningState """ @@ -4395,6 +4849,7 @@ class WorkloadNetworkPublicIP(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "public_ip_block": {"readonly": True}, "provisioning_state": {"readonly": True}, } @@ -4403,6 +4858,7 @@ class WorkloadNetworkPublicIP(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "display_name": {"key": "properties.displayName", "type": "str"}, "number_of_public_i_ps": {"key": "properties.numberOfPublicIPs", "type": "int"}, "public_ip_block": {"key": "properties.publicIPBlock", "type": "str"}, @@ -4425,20 +4881,19 @@ def __init__( self.provisioning_state = None -class WorkloadNetworkPublicIPsList(_serialization.Model): - """A list of NSX Public IP Blocks. +class WorkloadNetworkPublicIPListResult(_serialization.Model): + """The response of a WorkloadNetworkPublicIP list operation. - 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 value: The items on the page. + :ivar value: The WorkloadNetworkPublicIP items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -4446,24 +4901,36 @@ class WorkloadNetworkPublicIPsList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.WorkloadNetworkPublicIP"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The WorkloadNetworkPublicIP items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link -class WorkloadNetworkSegment(ProxyResource): +class WorkloadNetworkSegment(ProxyResource): # pylint: disable=too-many-instance-attributes """NSX Segment. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData :ivar display_name: Display name of the segment. :vartype display_name: str :ivar connected_gateway: Gateway which to connect segment to. @@ -4475,7 +4942,7 @@ class WorkloadNetworkSegment(ProxyResource): :ivar status: Segment status. Known values are: "SUCCESS" and "FAILURE". :vartype status: str or ~azure.mgmt.avs.models.SegmentStatusEnum :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkSegmentProvisioningState :ivar revision: NSX revision number. @@ -4486,6 +4953,7 @@ class WorkloadNetworkSegment(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "port_vif": {"readonly": True}, "status": {"readonly": True}, "provisioning_state": {"readonly": True}, @@ -4495,6 +4963,7 @@ class WorkloadNetworkSegment(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "display_name": {"key": "properties.displayName", "type": "str"}, "connected_gateway": {"key": "properties.connectedGateway", "type": "str"}, "subnet": {"key": "properties.subnet", "type": "WorkloadNetworkSegmentSubnet"}, @@ -4533,52 +5002,58 @@ def __init__( self.revision = revision -class WorkloadNetworkSegmentPortVif(_serialization.Model): - """Ports and any VIF attached to segment. +class WorkloadNetworkSegmentListResult(_serialization.Model): + """The response of a WorkloadNetworkSegment list operation. - :ivar port_name: Name of port or VIF attached to segment. - :vartype port_name: str + All required parameters must be populated in order to send to Azure. + + :ivar value: The WorkloadNetworkSegment items on this page. Required. + :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :ivar next_link: The link to the next page of items. + :vartype next_link: str """ + _validation = { + "value": {"required": True}, + } + _attribute_map = { - "port_name": {"key": "portName", "type": "str"}, + "value": {"key": "value", "type": "[WorkloadNetworkSegment]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, port_name: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, *, value: List["_models.WorkloadNetworkSegment"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ - :keyword port_name: Name of port or VIF attached to segment. - :paramtype port_name: str + :keyword value: The WorkloadNetworkSegment items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str """ super().__init__(**kwargs) - self.port_name = port_name - + self.value = value + self.next_link = next_link -class WorkloadNetworkSegmentsList(_serialization.Model): - """A list of NSX Segments. - Variables are only populated by the server, and will be ignored when sending a request. +class WorkloadNetworkSegmentPortVif(_serialization.Model): + """Ports and any VIF attached to segment. - :ivar value: The items on the page. - :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkSegment] - :ivar next_link: URL to get the next page if any. - :vartype next_link: str + :ivar port_name: Name of port or VIF attached to segment. + :vartype port_name: str """ - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[WorkloadNetworkSegment]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "port_name": {"key": "portName", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, port_name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword port_name: Name of port or VIF attached to segment. + :paramtype port_name: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.port_name = port_name class WorkloadNetworkSegmentSubnet(_serialization.Model): @@ -4609,17 +5084,93 @@ def __init__( self.gateway_address = gateway_address +class WorkloadNetworkSegmentUpdate(_serialization.Model): + """NSX Segment update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display name of the segment. + :vartype display_name: str + :ivar connected_gateway: Gateway which to connect segment to. + :vartype connected_gateway: str + :ivar subnet: Subnet which to connect segment to. + :vartype subnet: ~azure.mgmt.avs.models.WorkloadNetworkSegmentSubnet + :ivar port_vif: Port Vif which segment is associated with. + :vartype port_vif: list[~azure.mgmt.avs.models.WorkloadNetworkSegmentPortVif] + :ivar status: Segment status. Known values are: "SUCCESS" and "FAILURE". + :vartype status: str or ~azure.mgmt.avs.models.SegmentStatusEnum + :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", + "Canceled", "Building", "Deleting", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkSegmentProvisioningState + :ivar revision: NSX revision number. + :vartype revision: int + """ + + _validation = { + "port_vif": {"readonly": True}, + "status": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "connected_gateway": {"key": "properties.connectedGateway", "type": "str"}, + "subnet": {"key": "properties.subnet", "type": "WorkloadNetworkSegmentSubnet"}, + "port_vif": {"key": "properties.portVif", "type": "[WorkloadNetworkSegmentPortVif]"}, + "status": {"key": "properties.status", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "revision": {"key": "properties.revision", "type": "int"}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + connected_gateway: Optional[str] = None, + subnet: Optional["_models.WorkloadNetworkSegmentSubnet"] = None, + revision: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_name: Display name of the segment. + :paramtype display_name: str + :keyword connected_gateway: Gateway which to connect segment to. + :paramtype connected_gateway: str + :keyword subnet: Subnet which to connect segment to. + :paramtype subnet: ~azure.mgmt.avs.models.WorkloadNetworkSegmentSubnet + :keyword revision: NSX revision number. + :paramtype revision: int + """ + super().__init__(**kwargs) + self.display_name = display_name + self.connected_gateway = connected_gateway + self.subnet = subnet + self.port_vif = None + self.status = None + self.provisioning_state = None + self.revision = revision + + class WorkloadNetworkVirtualMachine(ProxyResource): """NSX Virtual Machine. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData + :ivar provisioning_state: The provisioning state of the resource. Known values are: + "Succeeded", "Failed", "Canceled", "Building", "Deleting", and "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkProvisioningState :ivar display_name: Display name of the VM. :vartype display_name: str :ivar vm_type: Virtual machine type. Known values are: "REGULAR", "EDGE", and "SERVICE". @@ -4630,6 +5181,8 @@ class WorkloadNetworkVirtualMachine(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, "vm_type": {"readonly": True}, } @@ -4637,6 +5190,8 @@ class WorkloadNetworkVirtualMachine(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "display_name": {"key": "properties.displayName", "type": "str"}, "vm_type": {"key": "properties.vmType", "type": "str"}, } @@ -4647,24 +5202,24 @@ def __init__(self, *, display_name: Optional[str] = None, **kwargs: Any) -> None :paramtype display_name: str """ super().__init__(**kwargs) + self.provisioning_state = None self.display_name = display_name self.vm_type = None -class WorkloadNetworkVirtualMachinesList(_serialization.Model): - """A list of NSX Virtual Machines. +class WorkloadNetworkVirtualMachineListResult(_serialization.Model): + """The response of a WorkloadNetworkVirtualMachine list operation. - 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 value: The items on the page. + :ivar value: The WorkloadNetworkVirtualMachine items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -4672,11 +5227,18 @@ class WorkloadNetworkVirtualMachinesList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.WorkloadNetworkVirtualMachine"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The WorkloadNetworkVirtualMachine items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link class WorkloadNetworkVMGroup(ProxyResource): @@ -4684,12 +5246,17 @@ class WorkloadNetworkVMGroup(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: Resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.avs.models.SystemData :ivar display_name: Display name of the VM group. :vartype display_name: str :ivar members: Virtual machine members of this group. @@ -4697,7 +5264,7 @@ class WorkloadNetworkVMGroup(ProxyResource): :ivar status: VM Group status. Known values are: "SUCCESS" and "FAILURE". :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", - "Building", "Deleting", "Updating", and "Canceled". + "Canceled", "Building", "Deleting", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.WorkloadNetworkVMGroupProvisioningState :ivar revision: NSX revision number. @@ -4708,6 +5275,7 @@ class WorkloadNetworkVMGroup(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "status": {"readonly": True}, "provisioning_state": {"readonly": True}, } @@ -4716,6 +5284,7 @@ class WorkloadNetworkVMGroup(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "display_name": {"key": "properties.displayName", "type": "str"}, "members": {"key": "properties.members", "type": "[str]"}, "status": {"key": "properties.status", "type": "str"}, @@ -4747,20 +5316,19 @@ def __init__( self.revision = revision -class WorkloadNetworkVMGroupsList(_serialization.Model): - """A list of NSX VM Groups. +class WorkloadNetworkVMGroupListResult(_serialization.Model): + """The response of a WorkloadNetworkVMGroup list operation. - 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 value: The items on the page. + :ivar value: The WorkloadNetworkVMGroup items on this page. Required. :vartype value: list[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] - :ivar next_link: URL to get the next page if any. + :ivar next_link: The link to the next page of items. :vartype next_link: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { @@ -4768,8 +5336,71 @@ class WorkloadNetworkVMGroupsList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.WorkloadNetworkVMGroup"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The WorkloadNetworkVMGroup items on this page. Required. + :paramtype value: list[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value = value + self.next_link = next_link + + +class WorkloadNetworkVMGroupUpdate(_serialization.Model): + """NSX VM Group update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display name of the VM group. + :vartype display_name: str + :ivar members: Virtual machine members of this group. + :vartype members: list[str] + :ivar status: VM Group status. Known values are: "SUCCESS" and "FAILURE". + :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum + :ivar provisioning_state: The provisioning state. Known values are: "Succeeded", "Failed", + "Canceled", "Building", "Deleting", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkVMGroupProvisioningState + :ivar revision: NSX revision number. + :vartype revision: int + """ + + _validation = { + "status": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "members": {"key": "properties.members", "type": "[str]"}, + "status": {"key": "properties.status", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "revision": {"key": "properties.revision", "type": "int"}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + members: Optional[List[str]] = None, + revision: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_name: Display name of the VM group. + :paramtype display_name: str + :keyword members: Virtual machine members of this group. + :paramtype members: list[str] + :keyword revision: NSX revision number. + :paramtype revision: int + """ + super().__init__(**kwargs) + self.display_name = display_name + self.members = members + self.status = None + self.provisioning_state = None + self.revision = revision diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py index 7aa1e85f55b7..e6a84c5d03a3 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py @@ -9,19 +9,20 @@ from ._operations import Operations from ._locations_operations import LocationsOperations from ._private_clouds_operations import PrivateCloudsOperations -from ._clusters_operations import ClustersOperations -from ._datastores_operations import DatastoresOperations -from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations +from ._addons_operations import AddonsOperations from ._authorizations_operations import AuthorizationsOperations -from ._global_reach_connections_operations import GlobalReachConnectionsOperations -from ._workload_networks_operations import WorkloadNetworksOperations from ._cloud_links_operations import CloudLinksOperations -from ._addons_operations import AddonsOperations -from ._virtual_machines_operations import VirtualMachinesOperations +from ._clusters_operations import ClustersOperations +from ._datastores_operations import DatastoresOperations from ._placement_policies_operations import PlacementPoliciesOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._global_reach_connections_operations import GlobalReachConnectionsOperations +from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations +from ._iscsi_paths_operations import IscsiPathsOperations +from ._script_executions_operations import ScriptExecutionsOperations from ._script_packages_operations import ScriptPackagesOperations from ._script_cmdlets_operations import ScriptCmdletsOperations -from ._script_executions_operations import ScriptExecutionsOperations +from ._workload_networks_operations import WorkloadNetworksOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -31,19 +32,20 @@ "Operations", "LocationsOperations", "PrivateCloudsOperations", - "ClustersOperations", - "DatastoresOperations", - "HcxEnterpriseSitesOperations", + "AddonsOperations", "AuthorizationsOperations", - "GlobalReachConnectionsOperations", - "WorkloadNetworksOperations", "CloudLinksOperations", - "AddonsOperations", - "VirtualMachinesOperations", + "ClustersOperations", + "DatastoresOperations", "PlacementPoliciesOperations", + "VirtualMachinesOperations", + "GlobalReachConnectionsOperations", + "HcxEnterpriseSitesOperations", + "IscsiPathsOperations", + "ScriptExecutionsOperations", "ScriptPackagesOperations", "ScriptCmdletsOperations", - "ScriptExecutionsOperations", + "WorkloadNetworksOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py index 9b6fa93d92a4..5ae32da89d1e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py @@ -45,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -126,7 +126,7 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "addonName": _SERIALIZER.url("addon_name", addon_name, "str", pattern=r"^[-\w\._]+$"), } @@ -149,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,9 +198,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> Iterable["_models.Addon"]: - """List addons in a private cloud. - - List addons in a private cloud. + """List Addon resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -216,7 +214,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AddonList] = kwargs.pop("cls", None) + cls: ClsType[_models.AddonListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -260,7 +258,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AddonList", pipeline_response) + deserialized = self._deserialize("AddonListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -290,16 +288,14 @@ def get_next(next_link=None): @distributed_trace def get(self, resource_group_name: str, private_cloud_name: str, addon_name: str, **kwargs: Any) -> _models.Addon: - """Get an addon by name in a private cloud. - - Get an addon by name in a private cloud. + """Get a Addon. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param addon_name: Name of the addon for the private cloud. Required. + :param addon_name: Name of the addon. Required. :type addon_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Addon or the result of cls(response) @@ -415,14 +411,17 @@ def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Addon", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("Addon", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -441,18 +440,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Addon]: - """Create or update a addon in a private cloud. - - Create or update a addon in a private cloud. + """Create a Addon. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param addon_name: Name of the addon for the private cloud. Required. + :param addon_name: Name of the addon. Required. :type addon_name: str - :param addon: A addon in the private cloud. Required. + :param addon: Resource create parameters. Required. :type addon: ~azure.mgmt.avs.models.Addon :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -481,18 +478,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Addon]: - """Create or update a addon in a private cloud. - - Create or update a addon in a private cloud. + """Create a Addon. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param addon_name: Name of the addon for the private cloud. Required. + :param addon_name: Name of the addon. Required. :type addon_name: str - :param addon: A addon in the private cloud. Required. + :param addon: Resource create parameters. Required. :type addon: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -519,18 +514,16 @@ def begin_create_or_update( addon: Union[_models.Addon, IO], **kwargs: Any ) -> LROPoller[_models.Addon]: - """Create or update a addon in a private cloud. - - Create or update a addon in a private cloud. + """Create a Addon. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param addon_name: Name of the addon for the private cloud. Required. + :param addon_name: Name of the addon. Required. :type addon_name: str - :param addon: A addon in the private cloud. Is either a Addon type or a IO type. Required. + :param addon: Resource create parameters. Is either a Addon type or a IO type. Required. :type addon: ~azure.mgmt.avs.models.Addon or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -578,7 +571,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -638,8 +633,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}" @@ -649,16 +649,14 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements def begin_delete( self, resource_group_name: str, private_cloud_name: str, addon_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a addon in a private cloud. - - Delete a addon in a private cloud. + """Delete a Addon. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param addon_name: Name of the addon for the private cloud. Required. + :param addon_name: Name of the addon. Required. :type addon_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. @@ -698,7 +696,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py index 38688a5f3b7b..9645693b1d58 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py @@ -45,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -126,7 +126,7 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "authorizationName": _SERIALIZER.url("authorization_name", authorization_name, "str", pattern=r"^[-\w\._]+$"), } @@ -149,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,9 +200,7 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> Iterable["_models.ExpressRouteAuthorization"]: - """List ExpressRoute Circuit Authorizations in a private cloud. - - List ExpressRoute Circuit Authorizations in a private cloud. + """List ExpressRouteAuthorization resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -219,7 +217,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExpressRouteAuthorizationList] = kwargs.pop("cls", None) + cls: ClsType[_models.ExpressRouteAuthorizationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -263,7 +261,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ExpressRouteAuthorizationList", pipeline_response) + deserialized = self._deserialize("ExpressRouteAuthorizationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -295,17 +293,14 @@ def get_next(next_link=None): def get( self, resource_group_name: str, private_cloud_name: str, authorization_name: str, **kwargs: Any ) -> _models.ExpressRouteAuthorization: - """Get an ExpressRoute Circuit Authorization by name in a private cloud. - - Get an ExpressRoute Circuit Authorization by name in a private cloud. + """Get a ExpressRouteAuthorization. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. - Required. + :param authorization_name: Name of the ExpressRoute Circuit Authorization. Required. :type authorization_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ExpressRouteAuthorization or the result of cls(response) @@ -421,14 +416,17 @@ def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("ExpressRouteAuthorization", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("ExpressRouteAuthorization", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -447,19 +445,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ExpressRouteAuthorization]: - """Create or update an ExpressRoute Circuit Authorization in a private cloud. - - Create or update an ExpressRoute Circuit Authorization in a private cloud. + """Create a ExpressRouteAuthorization. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. - Required. + :param authorization_name: Name of the ExpressRoute Circuit Authorization. Required. :type authorization_name: str - :param authorization: An ExpressRoute Circuit Authorization. Required. + :param authorization: Resource create parameters. Required. :type authorization: ~azure.mgmt.avs.models.ExpressRouteAuthorization :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -489,19 +484,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ExpressRouteAuthorization]: - """Create or update an ExpressRoute Circuit Authorization in a private cloud. - - Create or update an ExpressRoute Circuit Authorization in a private cloud. + """Create a ExpressRouteAuthorization. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. - Required. + :param authorization_name: Name of the ExpressRoute Circuit Authorization. Required. :type authorization_name: str - :param authorization: An ExpressRoute Circuit Authorization. Required. + :param authorization: Resource create parameters. Required. :type authorization: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -529,20 +521,17 @@ def begin_create_or_update( authorization: Union[_models.ExpressRouteAuthorization, IO], **kwargs: Any ) -> LROPoller[_models.ExpressRouteAuthorization]: - """Create or update an ExpressRoute Circuit Authorization in a private cloud. - - Create or update an ExpressRoute Circuit Authorization in a private cloud. + """Create a ExpressRouteAuthorization. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. - Required. + :param authorization_name: Name of the ExpressRoute Circuit Authorization. Required. :type authorization_name: str - :param authorization: An ExpressRoute Circuit Authorization. Is either a - ExpressRouteAuthorization type or a IO type. Required. + :param authorization: Resource create parameters. Is either a ExpressRouteAuthorization type or + a IO type. Required. :type authorization: ~azure.mgmt.avs.models.ExpressRouteAuthorization or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -591,7 +580,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -651,8 +642,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" @@ -662,17 +658,14 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements def begin_delete( self, resource_group_name: str, private_cloud_name: str, authorization_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete an ExpressRoute Circuit Authorization in a private cloud. - - Delete an ExpressRoute Circuit Authorization in a private cloud. + """Delete a ExpressRouteAuthorization. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud. - Required. + :param authorization_name: Name of the ExpressRoute Circuit Authorization. Required. :type authorization_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. @@ -712,7 +705,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py index d2781997659e..18bdfb83a50c 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py @@ -45,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -126,7 +126,7 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "cloudLinkName": _SERIALIZER.url("cloud_link_name", cloud_link_name, "str", pattern=r"^[-\w\._]+$"), } @@ -149,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,9 +198,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> Iterable["_models.CloudLink"]: - """List cloud link in a private cloud. - - List cloud link in a private cloud. + """List CloudLink resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -216,7 +214,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudLinkList] = kwargs.pop("cls", None) + cls: ClsType[_models.CloudLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -260,7 +258,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CloudLinkList", pipeline_response) + deserialized = self._deserialize("CloudLinkListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -292,16 +290,14 @@ def get_next(next_link=None): def get( self, resource_group_name: str, private_cloud_name: str, cloud_link_name: str, **kwargs: Any ) -> _models.CloudLink: - """Get an cloud link by name in a private cloud. - - Get an cloud link by name in a private cloud. + """Get a CloudLink. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cloud_link_name: Name of the cloud link resource. Required. + :param cloud_link_name: Name of the cloud link. Required. :type cloud_link_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CloudLink or the result of cls(response) @@ -417,14 +413,17 @@ def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("CloudLink", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("CloudLink", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -443,18 +442,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.CloudLink]: - """Create or update a cloud link in a private cloud. - - Create or update a cloud link in a private cloud. + """Create a CloudLink. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cloud_link_name: Name of the cloud link resource. Required. + :param cloud_link_name: Name of the cloud link. Required. :type cloud_link_name: str - :param cloud_link: A cloud link in the private cloud. Required. + :param cloud_link: Resource create parameters. Required. :type cloud_link: ~azure.mgmt.avs.models.CloudLink :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -483,18 +480,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.CloudLink]: - """Create or update a cloud link in a private cloud. - - Create or update a cloud link in a private cloud. + """Create a CloudLink. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cloud_link_name: Name of the cloud link resource. Required. + :param cloud_link_name: Name of the cloud link. Required. :type cloud_link_name: str - :param cloud_link: A cloud link in the private cloud. Required. + :param cloud_link: Resource create parameters. Required. :type cloud_link: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -521,18 +516,16 @@ def begin_create_or_update( cloud_link: Union[_models.CloudLink, IO], **kwargs: Any ) -> LROPoller[_models.CloudLink]: - """Create or update a cloud link in a private cloud. - - Create or update a cloud link in a private cloud. + """Create a CloudLink. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cloud_link_name: Name of the cloud link resource. Required. + :param cloud_link_name: Name of the cloud link. Required. :type cloud_link_name: str - :param cloud_link: A cloud link in the private cloud. Is either a CloudLink type or a IO type. + :param cloud_link: Resource create parameters. Is either a CloudLink type or a IO type. Required. :type cloud_link: ~azure.mgmt.avs.models.CloudLink or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -581,7 +574,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -641,8 +636,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" @@ -652,16 +652,14 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements def begin_delete( self, resource_group_name: str, private_cloud_name: str, cloud_link_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a cloud link in a private cloud. - - Delete a cloud link in a private cloud. + """Delete a CloudLink. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cloud_link_name: Name of the cloud link resource. Required. + :param cloud_link_name: Name of the cloud link. Required. :type cloud_link_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. @@ -701,7 +699,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py index 91c553f20b9a..726baefb2f6f 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py @@ -45,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -126,7 +126,7 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), } @@ -149,7 +149,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -186,7 +186,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -220,7 +220,7 @@ def build_list_zones_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -269,9 +269,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> Iterable["_models.Cluster"]: - """List clusters in a private cloud. - - List clusters in a private cloud. + """List Cluster resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -287,7 +285,7 @@ def list(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) + cls: ClsType[_models.ClusterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -331,7 +329,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterList", pipeline_response) + deserialized = self._deserialize("ClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -363,16 +361,14 @@ def get_next(next_link=None): def get( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> _models.Cluster: - """Get a cluster by name in a private cloud. - - Get a cluster by name in a private cloud. + """Get a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Cluster or the result of cls(response) @@ -488,14 +484,17 @@ def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Cluster", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("Cluster", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -514,18 +513,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Cluster]: - """Create or update a cluster in a private cloud. - - Create or update a cluster in a private cloud. + """Create a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster: A cluster in the private cloud. Required. + :param cluster: Resource create parameters. Required. :type cluster: ~azure.mgmt.avs.models.Cluster :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -554,18 +551,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Cluster]: - """Create or update a cluster in a private cloud. - - Create or update a cluster in a private cloud. + """Create a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster: A cluster in the private cloud. Required. + :param cluster: Resource create parameters. Required. :type cluster: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -592,19 +587,16 @@ def begin_create_or_update( cluster: Union[_models.Cluster, IO], **kwargs: Any ) -> LROPoller[_models.Cluster]: - """Create or update a cluster in a private cloud. - - Create or update a cluster in a private cloud. + """Create a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param cluster: A cluster in the private cloud. Is either a Cluster type or a IO type. - Required. + :param cluster: Resource create parameters. Is either a Cluster type or a IO type. Required. :type cluster: ~azure.mgmt.avs.models.Cluster or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -652,7 +644,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -729,14 +723,18 @@ def _update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Cluster", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = self._deserialize("Cluster", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -755,16 +753,14 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Cluster]: - """Update a cluster in a private cloud. - - Update a cluster in a private cloud. + """Update a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :param cluster_update: The cluster properties to be updated. Required. :type cluster_update: ~azure.mgmt.avs.models.ClusterUpdate @@ -795,16 +791,14 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Cluster]: - """Update a cluster in a private cloud. - - Update a cluster in a private cloud. + """Update a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :param cluster_update: The cluster properties to be updated. Required. :type cluster_update: IO @@ -833,16 +827,14 @@ def begin_update( cluster_update: Union[_models.ClusterUpdate, IO], **kwargs: Any ) -> LROPoller[_models.Cluster]: - """Update a cluster in a private cloud. - - Update a cluster in a private cloud. + """Update a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :param cluster_update: The cluster properties to be updated. Is either a ClusterUpdate type or a IO type. Required. @@ -893,7 +885,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -953,8 +947,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" @@ -964,16 +963,14 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements def begin_delete( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a cluster in a private cloud. - - Delete a cluster in a private cloud. + """Delete a Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_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. @@ -1013,7 +1010,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1037,14 +1036,12 @@ def list_zones( ) -> _models.ClusterZoneList: """List hosts by zone in a cluster. - List hosts by zone in a cluster. - :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ClusterZoneList or the result of cls(response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py index 934635530870..39a1ae22f6ae 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py @@ -45,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -84,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -124,7 +124,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -167,7 +167,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,16 +219,14 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> Iterable["_models.Datastore"]: - """List datastores in a private cloud cluster. - - List datastores in a private cloud cluster. + """List Datastore resources by Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Datastore or the result of cls(response) @@ -239,7 +237,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatastoreList] = kwargs.pop("cls", None) + cls: ClsType[_models.DatastoreListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -284,7 +282,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreList", pipeline_response) + deserialized = self._deserialize("DatastoreListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -316,18 +314,16 @@ def get_next(next_link=None): def get( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, datastore_name: str, **kwargs: Any ) -> _models.Datastore: - """Get a datastore in a private cloud cluster. - - Get a datastore in a private cloud cluster. + """Get a Datastore. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param datastore_name: Name of the datastore in the private cloud cluster. Required. + :param datastore_name: Name of the datastore. Required. :type datastore_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Datastore or the result of cls(response) @@ -446,14 +442,17 @@ def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -473,20 +472,18 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Datastore]: - """Create or update a datastore in a private cloud cluster. - - Create or update a datastore in a private cloud cluster. + """Create a Datastore. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param datastore_name: Name of the datastore in the private cloud cluster. Required. + :param datastore_name: Name of the datastore. Required. :type datastore_name: str - :param datastore: A datastore in a private cloud cluster. Required. + :param datastore: Resource create parameters. Required. :type datastore: ~azure.mgmt.avs.models.Datastore :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -516,20 +513,18 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Datastore]: - """Create or update a datastore in a private cloud cluster. - - Create or update a datastore in a private cloud cluster. + """Create a Datastore. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param datastore_name: Name of the datastore in the private cloud cluster. Required. + :param datastore_name: Name of the datastore. Required. :type datastore_name: str - :param datastore: A datastore in a private cloud cluster. Required. + :param datastore: Resource create parameters. Required. :type datastore: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -557,21 +552,19 @@ def begin_create_or_update( datastore: Union[_models.Datastore, IO], **kwargs: Any ) -> LROPoller[_models.Datastore]: - """Create or update a datastore in a private cloud cluster. - - Create or update a datastore in a private cloud cluster. + """Create a Datastore. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param datastore_name: Name of the datastore in the private cloud cluster. Required. + :param datastore_name: Name of the datastore. Required. :type datastore_name: str - :param datastore: A datastore in a private cloud cluster. Is either a Datastore type or a IO - type. Required. + :param datastore: Resource create parameters. Is either a Datastore type or a IO type. + Required. :type datastore: ~azure.mgmt.avs.models.Datastore or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -620,7 +613,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -681,8 +676,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" @@ -692,18 +692,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements def begin_delete( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, datastore_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a datastore in a private cloud cluster. - - Delete a datastore in a private cloud cluster. + """Delete a Datastore. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param datastore_name: Name of the datastore in the private cloud cluster. Required. + :param datastore_name: Name of the datastore. Required. :type datastore_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. @@ -744,7 +742,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py index bb0d3b96cfb6..bc2b1c704edd 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py @@ -45,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,7 +136,7 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "globalReachConnectionName": _SERIALIZER.url( "global_reach_connection_name", global_reach_connection_name, "str", pattern=r"^[-\w\._]+$" ), @@ -165,7 +165,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,9 +218,7 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> Iterable["_models.GlobalReachConnection"]: - """List global reach connections in a private cloud. - - List global reach connections in a private cloud. + """List GlobalReachConnection resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -237,7 +235,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GlobalReachConnectionList] = kwargs.pop("cls", None) + cls: ClsType[_models.GlobalReachConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -281,7 +279,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("GlobalReachConnectionList", pipeline_response) + deserialized = self._deserialize("GlobalReachConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -313,17 +311,14 @@ def get_next(next_link=None): def get( self, resource_group_name: str, private_cloud_name: str, global_reach_connection_name: str, **kwargs: Any ) -> _models.GlobalReachConnection: - """Get a global reach connection by name in a private cloud. - - Get a global reach connection by name in a private cloud. + """Get a GlobalReachConnection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param global_reach_connection_name: Name of the global reach connection in the private cloud. - Required. + :param global_reach_connection_name: Name of the global reach connection. Required. :type global_reach_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GlobalReachConnection or the result of cls(response) @@ -439,14 +434,17 @@ def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("GlobalReachConnection", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("GlobalReachConnection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -465,19 +463,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.GlobalReachConnection]: - """Create or update a global reach connection in a private cloud. - - Create or update a global reach connection in a private cloud. + """Create a GlobalReachConnection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param global_reach_connection_name: Name of the global reach connection in the private cloud. - Required. + :param global_reach_connection_name: Name of the global reach connection. Required. :type global_reach_connection_name: str - :param global_reach_connection: A global reach connection in the private cloud. Required. + :param global_reach_connection: Resource create parameters. Required. :type global_reach_connection: ~azure.mgmt.avs.models.GlobalReachConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -507,19 +502,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.GlobalReachConnection]: - """Create or update a global reach connection in a private cloud. - - Create or update a global reach connection in a private cloud. + """Create a GlobalReachConnection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param global_reach_connection_name: Name of the global reach connection in the private cloud. - Required. + :param global_reach_connection_name: Name of the global reach connection. Required. :type global_reach_connection_name: str - :param global_reach_connection: A global reach connection in the private cloud. Required. + :param global_reach_connection: Resource create parameters. Required. :type global_reach_connection: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -547,20 +539,17 @@ def begin_create_or_update( global_reach_connection: Union[_models.GlobalReachConnection, IO], **kwargs: Any ) -> LROPoller[_models.GlobalReachConnection]: - """Create or update a global reach connection in a private cloud. - - Create or update a global reach connection in a private cloud. + """Create a GlobalReachConnection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param global_reach_connection_name: Name of the global reach connection in the private cloud. - Required. + :param global_reach_connection_name: Name of the global reach connection. Required. :type global_reach_connection_name: str - :param global_reach_connection: A global reach connection in the private cloud. Is either a - GlobalReachConnection type or a IO type. Required. + :param global_reach_connection: Resource create parameters. Is either a GlobalReachConnection + type or a IO type. Required. :type global_reach_connection: ~azure.mgmt.avs.models.GlobalReachConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -609,7 +598,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -669,8 +660,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" @@ -680,17 +676,14 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements def begin_delete( self, resource_group_name: str, private_cloud_name: str, global_reach_connection_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a global reach connection in a private cloud. - - Delete a global reach connection in a private cloud. + """Delete a GlobalReachConnection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param global_reach_connection_name: Name of the global reach connection in the private cloud. - Required. + :param global_reach_connection_name: Name of the global reach connection. Required. :type global_reach_connection_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. @@ -730,7 +723,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py index 0f458c3d69f8..d93130a61a96 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py @@ -43,7 +43,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +120,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -134,7 +134,7 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "hcxEnterpriseSiteName": _SERIALIZER.url( "hcx_enterprise_site_name", hcx_enterprise_site_name, "str", pattern=r"^[-\w\._]+$" ), @@ -163,7 +163,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,9 +216,7 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> Iterable["_models.HcxEnterpriseSite"]: - """List HCX on-premises key in a private cloud. - - List HCX on-premises key in a private cloud. + """List HcxEnterpriseSite resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -234,7 +232,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.HcxEnterpriseSiteList] = kwargs.pop("cls", None) + cls: ClsType[_models.HcxEnterpriseSiteListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -278,7 +276,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("HcxEnterpriseSiteList", pipeline_response) + deserialized = self._deserialize("HcxEnterpriseSiteListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -310,17 +308,14 @@ def get_next(next_link=None): def get( self, resource_group_name: str, private_cloud_name: str, hcx_enterprise_site_name: str, **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Get an HCX on-premises key by name in a private cloud. - - Get an HCX on-premises key by name in a private cloud. + """Get a HcxEnterpriseSite. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. - Required. + :param hcx_enterprise_site_name: Name of the HCX Enterprise Site. Required. :type hcx_enterprise_site_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: HcxEnterpriseSite or the result of cls(response) @@ -388,19 +383,16 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an activation key for on-premises HCX site. - - Create or update an activation key for on-premises HCX site. + """Create a HcxEnterpriseSite. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. - Required. + :param hcx_enterprise_site_name: Name of the HCX Enterprise Site. Required. :type hcx_enterprise_site_name: str - :param hcx_enterprise_site: The HCX Enterprise Site. Required. + :param hcx_enterprise_site: Resource create parameters. Required. :type hcx_enterprise_site: ~azure.mgmt.avs.models.HcxEnterpriseSite :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -422,19 +414,16 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an activation key for on-premises HCX site. - - Create or update an activation key for on-premises HCX site. + """Create a HcxEnterpriseSite. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. - Required. + :param hcx_enterprise_site_name: Name of the HCX Enterprise Site. Required. :type hcx_enterprise_site_name: str - :param hcx_enterprise_site: The HCX Enterprise Site. Required. + :param hcx_enterprise_site: Resource create parameters. Required. :type hcx_enterprise_site: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -454,20 +443,17 @@ def create_or_update( hcx_enterprise_site: Union[_models.HcxEnterpriseSite, IO], **kwargs: Any ) -> _models.HcxEnterpriseSite: - """Create or update an activation key for on-premises HCX site. - - Create or update an activation key for on-premises HCX site. + """Create a HcxEnterpriseSite. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. - Required. + :param hcx_enterprise_site_name: Name of the HCX Enterprise Site. Required. :type hcx_enterprise_site_name: str - :param hcx_enterprise_site: The HCX Enterprise Site. Is either a HcxEnterpriseSite type or a IO - type. Required. + :param hcx_enterprise_site: Resource create parameters. Is either a HcxEnterpriseSite type or a + IO type. Required. :type hcx_enterprise_site: ~azure.mgmt.avs.models.HcxEnterpriseSite or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -547,17 +533,14 @@ def create_or_update( def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, private_cloud_name: str, hcx_enterprise_site_name: str, **kwargs: Any ) -> None: - """Delete HCX on-premises key in a private cloud. - - Delete HCX on-premises key in a private cloud. + """Delete a HcxEnterpriseSite. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud. - Required. + :param hcx_enterprise_site_name: Name of the HCX Enterprise Site. Required. :type hcx_enterprise_site_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_iscsi_paths_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_iscsi_paths_operations.py new file mode 100644 index 000000000000..f21ed12e0bfd --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_iscsi_paths_operations.py @@ -0,0 +1,687 @@ +# pylint: disable=too-many-lines +# 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 io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_private_cloud_request( + resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class IscsiPathsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.avs.AVSClient`'s + :attr:`iscsi_paths` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_private_cloud( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> Iterable["_models.IscsiPath"]: + """List IscsiPath resources by PrivateCloud. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IscsiPath or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.IscsiPath] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.IscsiPathListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_private_cloud_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_private_cloud.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("IscsiPathListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_by_private_cloud.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths" + } + + @distributed_trace + def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> _models.IscsiPath: + """Get a IscsiPath. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IscsiPath or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.IscsiPath + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.IscsiPath] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("IscsiPath", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + } + + def _create_or_update_initial( + self, resource_group_name: str, private_cloud_name: str, resource: Union[_models.IscsiPath, IO], **kwargs: Any + ) -> _models.IscsiPath: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IscsiPath] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "IscsiPath") + + request = build_create_or_update_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_or_update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("IscsiPath", pipeline_response) + + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("IscsiPath", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + } + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + resource: _models.IscsiPath, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IscsiPath]: + """Create a IscsiPath. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.avs.models.IscsiPath + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: 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: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either IscsiPath or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.IscsiPath] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IscsiPath]: + """Create a IscsiPath. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param resource: Resource create parameters. Required. + :type resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: 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: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either IscsiPath or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.IscsiPath] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, resource_group_name: str, private_cloud_name: str, resource: Union[_models.IscsiPath, IO], **kwargs: Any + ) -> LROPoller[_models.IscsiPath]: + """Create a IscsiPath. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param resource: Resource create parameters. Is either a IscsiPath type or a IO type. Required. + :type resource: ~azure.mgmt.avs.models.IscsiPath or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either IscsiPath or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.IscsiPath] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IscsiPath] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("IscsiPath", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + } + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + } + + @distributed_trace + def begin_delete(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a IscsiPath. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_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: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + } diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py index f078668e4ffa..8d74c86c62d2 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py @@ -35,22 +35,21 @@ _SERIALIZER.client_side_validation = False -def build_check_trial_availability_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_check_quota_availability_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability", + "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "location": _SERIALIZER.url("location", location, "str"), + "location": _SERIALIZER.url("location", location, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -59,28 +58,27 @@ def build_check_trial_availability_request(location: str, subscription_id: str, _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_check_quota_availability_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_check_trial_availability_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability", + "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "location": _SERIALIZER.url("location", location, "str"), + "location": _SERIALIZER.url("location", location, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -89,6 +87,8 @@ def build_check_quota_availability_request(location: str, subscription_id: str, _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -113,15 +113,74 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def check_quota_availability(self, location: str, **kwargs: Any) -> _models.Quota: + """Return quota for subscription by region. + + :param location: A location in a subscription. Required. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Quota or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.Quota + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Quota] = kwargs.pop("cls", None) + + request = build_check_quota_availability_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.check_quota_availability.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Quota", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + check_quota_availability.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability" + } + @overload def check_trial_availability( self, location: str, sku: Optional[_models.Sku] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Trial: """Return trial status for subscription by region. - :param location: Azure region. Required. + :param location: A location in a subscription. Required. :type location: str - :param sku: The sku to check for trial availability. Default value is None. + :param sku: Optionally, check for a specific SKU. Default value is None. :type sku: ~azure.mgmt.avs.models.Sku :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -138,9 +197,9 @@ def check_trial_availability( ) -> _models.Trial: """Return trial status for subscription by region. - :param location: Azure region. Required. + :param location: A location in a subscription. Required. :type location: str - :param sku: The sku to check for trial availability. Default value is None. + :param sku: Optionally, check for a specific SKU. Default value is None. :type sku: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -157,9 +216,9 @@ def check_trial_availability( ) -> _models.Trial: """Return trial status for subscription by region. - :param location: Azure region. Required. + :param location: A location in a subscription. Required. :type location: str - :param sku: The sku to check for trial availability. Is either a Sku type or a IO type. Default + :param sku: Optionally, check for a specific SKU. Is either a Sku type or a IO type. Default value is None. :type sku: ~azure.mgmt.avs.models.Sku or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -232,62 +291,3 @@ def check_trial_availability( check_trial_availability.metadata = { "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability" } - - @distributed_trace - def check_quota_availability(self, location: str, **kwargs: Any) -> _models.Quota: - """Return quota for subscription by region. - - :param location: Azure region. Required. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Quota or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.Quota - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Quota] = kwargs.pop("cls", None) - - request = build_check_quota_availability_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.check_quota_availability.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Quota", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - check_quota_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability" - } diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py index a0be57989bf7..e13c4a949200 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py @@ -40,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: - """Lists all of the available operations. + """List the operations for the provider. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Operation or the result of cls(response) @@ -87,7 +87,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -128,7 +128,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py index 8e3da3e88436..0dfdc77221bf 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py @@ -45,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -84,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,7 +126,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -171,7 +171,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -216,7 +216,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,16 +270,14 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> Iterable["_models.PlacementPolicy"]: - """List placement policies in a private cloud cluster. - - List placement policies in a private cloud cluster. + """List PlacementPolicy resources by Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PlacementPolicy or the result of cls(response) @@ -290,7 +288,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PlacementPoliciesList] = kwargs.pop("cls", None) + cls: ClsType[_models.PlacementPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -335,7 +333,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PlacementPoliciesList", pipeline_response) + deserialized = self._deserialize("PlacementPolicyListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -372,19 +370,16 @@ def get( placement_policy_name: str, **kwargs: Any ) -> _models.PlacementPolicy: - """Get a placement policy by name in a private cloud cluster. - - Get a placement policy by name in a private cloud cluster. + """Get a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PlacementPolicy or the result of cls(response) @@ -503,14 +498,17 @@ def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("PlacementPolicy", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("PlacementPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -530,21 +528,18 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.PlacementPolicy]: - """Create or update a placement policy in a private cloud cluster. - - Create or update a placement policy in a private cloud cluster. + """Create a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy: A placement policy in the private cloud cluster. Required. + :param placement_policy: Resource create parameters. Required. :type placement_policy: ~azure.mgmt.avs.models.PlacementPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -575,21 +570,18 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.PlacementPolicy]: - """Create or update a placement policy in a private cloud cluster. - - Create or update a placement policy in a private cloud cluster. + """Create a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy: A placement policy in the private cloud cluster. Required. + :param placement_policy: Resource create parameters. Required. :type placement_policy: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -618,22 +610,19 @@ def begin_create_or_update( placement_policy: Union[_models.PlacementPolicy, IO], **kwargs: Any ) -> LROPoller[_models.PlacementPolicy]: - """Create or update a placement policy in a private cloud cluster. - - Create or update a placement policy in a private cloud cluster. + """Create a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy: A placement policy in the private cloud cluster. Is either a - PlacementPolicy type or a IO type. Required. + :param placement_policy: Resource create parameters. Is either a PlacementPolicy type or a IO + type. Required. :type placement_policy: ~azure.mgmt.avs.models.PlacementPolicy or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -683,7 +672,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -762,14 +753,18 @@ def _update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("PlacementPolicy", pipeline_response) if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = self._deserialize("PlacementPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -789,21 +784,18 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.PlacementPolicy]: - """Update a placement policy in a private cloud cluster. - - Update a placement policy in a private cloud cluster. + """Update a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties that may be updated. Required. + :param placement_policy_update: The placement policy properties to be updated. Required. :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -834,21 +826,18 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.PlacementPolicy]: - """Update a placement policy in a private cloud cluster. - - Update a placement policy in a private cloud cluster. + """Update a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties that may be updated. Required. + :param placement_policy_update: The placement policy properties to be updated. Required. :type placement_policy_update: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -877,22 +866,19 @@ def begin_update( placement_policy_update: Union[_models.PlacementPolicyUpdate, IO], **kwargs: Any ) -> LROPoller[_models.PlacementPolicy]: - """Update a placement policy in a private cloud cluster. - - Update a placement policy in a private cloud cluster. + """Update a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_name: str - :param placement_policy_update: The placement policy properties that may be updated. Is either - a PlacementPolicyUpdate type or a IO type. Required. + :param placement_policy_update: The placement policy properties to be updated. Is either a + PlacementPolicyUpdate type or a IO type. Required. :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -942,7 +928,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1008,8 +996,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" @@ -1024,19 +1017,16 @@ def begin_delete( placement_policy_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a placement policy in a private cloud cluster. - - Delete a placement policy in a private cloud cluster. + """Delete a PlacementPolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) - placement policy. Required. + :param placement_policy_name: Name of the placement policy. Required. :type placement_policy_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. @@ -1077,7 +1067,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py index 6f351e0922f1..fd00fc0b433b 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py @@ -39,23 +39,17 @@ _SERIALIZER.client_side_validation = False -def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_list_in_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds", - ) # pylint: disable=line-too-long + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds") path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -69,17 +63,23 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_in_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds") + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds", + ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -99,7 +99,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +132,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -168,7 +168,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -204,7 +204,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -231,19 +231,19 @@ def build_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_rotate_vcenter_password_request( +def build_list_admin_credentials_request( resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -270,7 +270,7 @@ def build_rotate_nsxt_password_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,19 +297,19 @@ def build_rotate_nsxt_password_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_admin_credentials_request( +def build_rotate_vcenter_password_request( resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -350,14 +350,9 @@ def __init__(self, *args, **kwargs): self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.PrivateCloud"]: - """List private clouds in a resource group. - - List private clouds in a resource group. + def list_in_subscription(self, **kwargs: Any) -> Iterable["_models.PrivateCloud"]: + """List PrivateCloud resources by subscription ID. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :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 PrivateCloud or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.PrivateCloud] @@ -367,7 +362,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Pri _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) + cls: ClsType[_models.PrivateCloudListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -380,11 +375,10 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Pri def prepare_request(next_link=None): if not next_link: - request = build_list_request( - resource_group_name=resource_group_name, + request = build_list_in_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], + template_url=self.list_in_subscription.metadata["url"], headers=_headers, params=_params, ) @@ -410,7 +404,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateCloudList", pipeline_response) + deserialized = self._deserialize("PrivateCloudListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -434,16 +428,15 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" - } + list_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds"} @distributed_trace - def list_in_subscription(self, **kwargs: Any) -> Iterable["_models.PrivateCloud"]: - """List private clouds in a subscription. - - List private clouds in a subscription. + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.PrivateCloud"]: + """List PrivateCloud resources by resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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 PrivateCloud or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.PrivateCloud] @@ -453,7 +446,7 @@ def list_in_subscription(self, **kwargs: Any) -> Iterable["_models.PrivateCloud" _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateCloudList] = kwargs.pop("cls", None) + cls: ClsType[_models.PrivateCloudListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -466,10 +459,11 @@ def list_in_subscription(self, **kwargs: Any) -> Iterable["_models.PrivateCloud" def prepare_request(next_link=None): if not next_link: - request = build_list_in_subscription_request( + request = build_list_request( + resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_in_subscription.metadata["url"], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -495,7 +489,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateCloudList", pipeline_response) + deserialized = self._deserialize("PrivateCloudListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -519,13 +513,13 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds"} + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + } @distributed_trace def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> _models.PrivateCloud: - """Get a private cloud. - - Get a private cloud. + """Get a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -643,14 +637,17 @@ def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("PrivateCloud", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("PrivateCloud", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -668,16 +665,14 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.PrivateCloud]: - """Create or update a private cloud. - - Create or update a private cloud. + """Create a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud: The private cloud. Required. + :param private_cloud: Resource create parameters. Required. :type private_cloud: ~azure.mgmt.avs.models.PrivateCloud :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -706,16 +701,14 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.PrivateCloud]: - """Create or update a private cloud. - - Create or update a private cloud. + """Create a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud: The private cloud. Required. + :param private_cloud: Resource create parameters. Required. :type private_cloud: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -742,16 +735,15 @@ def begin_create_or_update( private_cloud: Union[_models.PrivateCloud, IO], **kwargs: Any ) -> LROPoller[_models.PrivateCloud]: - """Create or update a private cloud. - - Create or update a private cloud. + """Create a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param private_cloud: The private cloud. Is either a PrivateCloud type or a IO type. Required. + :param private_cloud: Resource create parameters. Is either a PrivateCloud type or a IO type. + Required. :type private_cloud: ~azure.mgmt.avs.models.PrivateCloud or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -799,7 +791,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -874,14 +868,18 @@ def _update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("PrivateCloud", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = self._deserialize("PrivateCloud", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -899,9 +897,7 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.PrivateCloud]: - """Update a private cloud. - - Update a private cloud. + """Update a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -937,9 +933,7 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.PrivateCloud]: - """Update a private cloud. - - Update a private cloud. + """Update a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -973,9 +967,7 @@ def begin_update( private_cloud_update: Union[_models.PrivateCloudUpdate, IO], **kwargs: Any ) -> LROPoller[_models.PrivateCloud]: - """Update a private cloud. - - Update a private cloud. + """Update a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1031,7 +1023,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1090,8 +1084,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}" @@ -1099,9 +1098,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace def begin_delete(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a private cloud. - - Delete a private cloud. + """Delete a PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1145,7 +1142,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1163,7 +1162,72 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}" } - def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-return-statements + @distributed_trace + def list_admin_credentials( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> _models.AdminCredentials: + """List the admin credentials for the private cloud. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AdminCredentials or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.AdminCredentials + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AdminCredentials] = kwargs.pop("cls", None) + + request = build_list_admin_credentials_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_admin_credentials.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AdminCredentials", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_admin_credentials.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials" + } + + def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { @@ -1180,12 +1244,12 @@ def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-return-sta api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_rotate_vcenter_password_request( + request = build_rotate_nsxt_password_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._rotate_vcenter_password_initial.metadata["url"], + template_url=self._rotate_nsxt_password_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1204,20 +1268,23 @@ def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-return-sta error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _rotate_vcenter_password_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword" + _rotate_nsxt_password_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword" } @distributed_trace - def begin_rotate_vcenter_password( + def begin_rotate_nsxt_password( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> LROPoller[None]: - """Rotate the vCenter password. - - Rotate the vCenter password. + """Rotate the NSX-T Manager password. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1245,7 +1312,7 @@ def begin_rotate_vcenter_password( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._rotate_vcenter_password_initial( # type: ignore + raw_result = self._rotate_nsxt_password_initial( # type: ignore resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, api_version=api_version, @@ -1261,7 +1328,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1275,11 +1344,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_rotate_vcenter_password.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword" + begin_rotate_nsxt_password.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword" } - def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return-statements + def _rotate_vcenter_password_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { @@ -1296,12 +1365,12 @@ def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return-statem api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_rotate_nsxt_password_request( + request = build_rotate_vcenter_password_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._rotate_nsxt_password_initial.metadata["url"], + template_url=self._rotate_vcenter_password_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1320,20 +1389,23 @@ def _rotate_nsxt_password_initial( # pylint: disable=inconsistent-return-statem error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _rotate_nsxt_password_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword" + _rotate_vcenter_password_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword" } @distributed_trace - def begin_rotate_nsxt_password( + def begin_rotate_vcenter_password( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> LROPoller[None]: - """Rotate the NSX-T Manager password. - - Rotate the NSX-T Manager password. + """Rotate the vCenter password. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1361,7 +1433,7 @@ def begin_rotate_nsxt_password( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._rotate_nsxt_password_initial( # type: ignore + raw_result = self._rotate_vcenter_password_initial( # type: ignore resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, api_version=api_version, @@ -1377,7 +1449,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1391,73 +1465,6 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_rotate_nsxt_password.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword" - } - - @distributed_trace - def list_admin_credentials( - self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> _models.AdminCredentials: - """List the admin credentials for the private cloud. - - List the admin credentials for the private cloud. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AdminCredentials or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.AdminCredentials - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AdminCredentials] = kwargs.pop("cls", None) - - request = build_list_admin_credentials_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_admin_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AdminCredentials", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_admin_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials" + begin_rotate_vcenter_password.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword" } diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py index 204dbac22837..690bea9652b4 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py @@ -42,7 +42,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,15 +137,14 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, private_cloud_name: str, script_package_name: str, **kwargs: Any ) -> Iterable["_models.ScriptCmdlet"]: - """List script cmdlet resources available for a private cloud to create a script execution - resource on a private cloud. + """List ScriptCmdlet resources by ScriptPackage. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_package_name: Name of the script package in the private cloud. Required. + :param script_package_name: Name of the script package. Required. :type script_package_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ScriptCmdlet or the result of cls(response) @@ -156,7 +155,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ScriptCmdletsList] = kwargs.pop("cls", None) + cls: ClsType[_models.ScriptCmdletListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -201,7 +200,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ScriptCmdletsList", pipeline_response) + deserialized = self._deserialize("ScriptCmdletListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -238,17 +237,16 @@ def get( script_cmdlet_name: str, **kwargs: Any ) -> _models.ScriptCmdlet: - """Return information about a script cmdlet resource in a specific package on a private cloud. + """Get a ScriptCmdlet. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_package_name: Name of the script package in the private cloud. Required. + :param script_package_name: Name of the script package. Required. :type script_package_name: str - :param script_cmdlet_name: Name of the script cmdlet resource in the script package in the - private cloud. Required. + :param script_cmdlet_name: Name of the script cmdlet. Required. :type script_cmdlet_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ScriptCmdlet or the result of cls(response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py index c1f4b16372a9..f0c1496b7bb7 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py @@ -45,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +114,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -128,7 +128,7 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str"), + "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "scriptExecutionName": _SERIALIZER.url( "script_execution_name", script_execution_name, "str", pattern=r"^[-\w\._]+$" ), @@ -153,7 +153,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -189,7 +189,7 @@ def build_get_execution_logs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -245,9 +245,7 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> Iterable["_models.ScriptExecution"]: - """List script executions in a private cloud. - - List script executions in a private cloud. + """List ScriptExecution resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -263,7 +261,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ScriptExecutionsList] = kwargs.pop("cls", None) + cls: ClsType[_models.ScriptExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -307,7 +305,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ScriptExecutionsList", pipeline_response) + deserialized = self._deserialize("ScriptExecutionListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -339,16 +337,14 @@ def get_next(next_link=None): def get( self, resource_group_name: str, private_cloud_name: str, script_execution_name: str, **kwargs: Any ) -> _models.ScriptExecution: - """Get an script execution by name in a private cloud. - - Get an script execution by name in a private cloud. + """Get a ScriptExecution. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ScriptExecution or the result of cls(response) @@ -464,14 +460,17 @@ def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("ScriptExecution", pipeline_response) if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = self._deserialize("ScriptExecution", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -490,18 +489,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ScriptExecution]: - """Create or update a script execution in a private cloud. - - Create or update a script execution in a private cloud. + """Create a ScriptExecution. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str - :param script_execution: A script running in the private cloud. Required. + :param script_execution: Resource create parameters. Required. :type script_execution: ~azure.mgmt.avs.models.ScriptExecution :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -531,18 +528,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ScriptExecution]: - """Create or update a script execution in a private cloud. - - Create or update a script execution in a private cloud. + """Create a ScriptExecution. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str - :param script_execution: A script running in the private cloud. Required. + :param script_execution: Resource create parameters. Required. :type script_execution: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -570,19 +565,17 @@ def begin_create_or_update( script_execution: Union[_models.ScriptExecution, IO], **kwargs: Any ) -> LROPoller[_models.ScriptExecution]: - """Create or update a script execution in a private cloud. - - Create or update a script execution in a private cloud. + """Create a ScriptExecution. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_cloud_name: The name of the private cloud. Required. + :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str - :param script_execution: A script running in the private cloud. Is either a ScriptExecution - type or a IO type. Required. + :param script_execution: Resource create parameters. Is either a ScriptExecution type or a IO + type. Required. :type script_execution: ~azure.mgmt.avs.models.ScriptExecution or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -631,7 +624,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -691,8 +686,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}" @@ -702,16 +702,14 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements def begin_delete( self, resource_group_name: str, private_cloud_name: str, script_execution_name: str, **kwargs: Any ) -> LROPoller[None]: - """Cancel a ScriptExecution in a private cloud. - - Cancel a ScriptExecution in a private cloud. + """Delete a ScriptExecution. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_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. @@ -751,7 +749,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -787,7 +787,7 @@ def get_execution_logs( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str :param script_output_stream_type: Name of the desired output stream to return. If not provided, will return all. An empty array will return nothing. Default value is None. @@ -819,7 +819,7 @@ def get_execution_logs( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str :param script_output_stream_type: Name of the desired output stream to return. If not provided, will return all. An empty array will return nothing. Default value is None. @@ -849,7 +849,7 @@ def get_execution_logs( :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_execution_name: Name of the user-invoked script execution resource. Required. + :param script_execution_name: Name of the script cmdlet. Required. :type script_execution_name: str :param script_output_stream_type: Name of the desired output stream to return. If not provided, will return all. An empty array will return nothing. Is either a [Union[str, diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py index 04a89fc138ab..0b0ddbf58772 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py @@ -42,7 +42,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +128,7 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> Iterable["_models.ScriptPackage"]: - """List script packages available to run on the private cloud. + """List ScriptPackage resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -144,7 +144,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ScriptPackagesList] = kwargs.pop("cls", None) + cls: ClsType[_models.ScriptPackageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -188,7 +188,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ScriptPackagesList", pipeline_response) + deserialized = self._deserialize("ScriptPackageListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -220,14 +220,14 @@ def get_next(next_link=None): def get( self, resource_group_name: str, private_cloud_name: str, script_package_name: str, **kwargs: Any ) -> _models.ScriptPackage: - """Get a script package available to run on a private cloud. + """Get a ScriptPackage. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param script_package_name: Name of the script package in the private cloud. Required. + :param script_package_name: Name of the script package. Required. :type script_package_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ScriptPackage or the result of cls(response) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py index 8105422455ca..911bf403498a 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py @@ -45,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -84,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_get_request( ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), - "virtualMachineId": _SERIALIZER.url("virtual_machine_id", virtual_machine_id, "str"), + "virtualMachineId": _SERIALIZER.url("virtual_machine_id", virtual_machine_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -124,7 +124,7 @@ def build_restrict_movement_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -140,7 +140,7 @@ def build_restrict_movement_request( ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str", pattern=r"^[-\w\._]+$"), - "virtualMachineId": _SERIALIZER.url("virtual_machine_id", virtual_machine_id, "str"), + "virtualMachineId": _SERIALIZER.url("virtual_machine_id", virtual_machine_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -179,16 +179,14 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, private_cloud_name: str, cluster_name: str, **kwargs: Any ) -> Iterable["_models.VirtualMachine"]: - """List of virtual machines in a private cloud cluster. - - List of virtual machines in a private cloud cluster. + """List VirtualMachine resources by Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VirtualMachine or the result of cls(response) @@ -199,7 +197,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VirtualMachinesList] = kwargs.pop("cls", None) + cls: ClsType[_models.VirtualMachineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -244,7 +242,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualMachinesList", pipeline_response) + deserialized = self._deserialize("VirtualMachineListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -281,18 +279,16 @@ def get( virtual_machine_id: str, **kwargs: Any ) -> _models.VirtualMachine: - """Get a virtual machine by id in a private cloud cluster. - - Get a virtual machine by id in a private cloud cluster. + """Get a VirtualMachine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param virtual_machine_id: Virtual Machine identifier. Required. + :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: VirtualMachine or the result of cls(response) @@ -411,8 +407,12 @@ def _restrict_movement_initial( # pylint: disable=inconsistent-return-statement error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _restrict_movement_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement" @@ -432,19 +432,16 @@ def begin_restrict_movement( ) -> LROPoller[None]: """Enable or disable DRS-driven VM movement restriction. - Enable or disable DRS-driven VM movement restriction. - :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param virtual_machine_id: Virtual Machine identifier. Required. + :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: Whether VM DRS-driven movement is restricted (Enabled) or not - (Disabled). Required. + :param restrict_movement: The body type of the operation request. Required. :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -476,19 +473,16 @@ def begin_restrict_movement( ) -> LROPoller[None]: """Enable or disable DRS-driven VM movement restriction. - Enable or disable DRS-driven VM movement restriction. - :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param virtual_machine_id: Virtual Machine identifier. Required. + :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: Whether VM DRS-driven movement is restricted (Enabled) or not - (Disabled). Required. + :param restrict_movement: The body type of the operation request. Required. :type restrict_movement: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -518,19 +512,17 @@ def begin_restrict_movement( ) -> LROPoller[None]: """Enable or disable DRS-driven VM movement restriction. - Enable or disable DRS-driven VM movement restriction. - :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param cluster_name: Name of the cluster in the private cloud. Required. + :param cluster_name: Name of the cluster. Required. :type cluster_name: str - :param virtual_machine_id: Virtual Machine identifier. Required. + :param virtual_machine_id: ID of the virtual machine. Required. :type virtual_machine_id: str - :param restrict_movement: Whether VM DRS-driven movement is restricted (Enabled) or not - (Disabled). Is either a VirtualMachineRestrictMovement type or a IO type. Required. + :param restrict_movement: The body type of the operation request. Is either a + VirtualMachineRestrictMovement type or a IO type. Required. :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -577,7 +569,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py index b13c4a90b99b..a1124aaa4531 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py @@ -39,23 +39,19 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - private_cloud_name: str, - workload_network_name: Union[str, _models.WorkloadNetworkName], - subscription_id: str, - **kwargs: Any +def build_list_request( + resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -63,7 +59,6 @@ def build_get_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "workloadNetworkName": _SERIALIZER.url("workload_network_name", workload_network_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -77,19 +72,19 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_request( +def build_get_request( resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -110,19 +105,19 @@ def build_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_segments_request( +def build_list_dhcp_request( resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -143,27 +138,27 @@ def build_list_segments_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_segment_request( - resource_group_name: str, private_cloud_name: str, segment_id: str, subscription_id: str, **kwargs: Any +def build_get_dhcp_request( + resource_group_name: str, dhcp_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), + "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str", pattern=r"^[-\w\._]+$"), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "segmentId": _SERIALIZER.url("segment_id", segment_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -177,20 +172,20 @@ def build_get_segment_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_segments_request( - resource_group_name: str, private_cloud_name: str, segment_id: str, subscription_id: str, **kwargs: Any +def build_create_dhcp_request( + resource_group_name: str, private_cloud_name: str, dhcp_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -198,7 +193,7 @@ def build_create_segments_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "segmentId": _SERIALIZER.url("segment_id", segment_id, "str"), + "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -214,20 +209,20 @@ def build_create_segments_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_segments_request( - resource_group_name: str, private_cloud_name: str, segment_id: str, subscription_id: str, **kwargs: Any +def build_update_dhcp_request( + resource_group_name: str, private_cloud_name: str, dhcp_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -235,7 +230,7 @@ def build_update_segments_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "segmentId": _SERIALIZER.url("segment_id", segment_id, "str"), + "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -251,19 +246,19 @@ def build_update_segments_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_segment_request( - resource_group_name: str, private_cloud_name: str, segment_id: str, subscription_id: str, **kwargs: Any +def build_delete_dhcp_request( + resource_group_name: str, private_cloud_name: str, dhcp_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -271,7 +266,7 @@ def build_delete_segment_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "segmentId": _SERIALIZER.url("segment_id", segment_id, "str"), + "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -285,19 +280,19 @@ def build_delete_segment_request( return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_dhcp_request( +def build_list_dns_services_request( resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -318,27 +313,27 @@ def build_list_dhcp_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_dhcp_request( - resource_group_name: str, dhcp_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +def build_get_dns_service_request( + resource_group_name: str, private_cloud_name: str, dns_service_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str"), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -352,20 +347,20 @@ def build_get_dhcp_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_dhcp_request( - resource_group_name: str, private_cloud_name: str, dhcp_id: str, subscription_id: str, **kwargs: Any +def build_create_dns_service_request( + resource_group_name: str, private_cloud_name: str, dns_service_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -373,7 +368,7 @@ def build_create_dhcp_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str"), + "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -389,20 +384,20 @@ def build_create_dhcp_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_dhcp_request( - resource_group_name: str, private_cloud_name: str, dhcp_id: str, subscription_id: str, **kwargs: Any +def build_update_dns_service_request( + resource_group_name: str, private_cloud_name: str, dns_service_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -410,7 +405,7 @@ def build_update_dhcp_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str"), + "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -426,27 +421,27 @@ def build_update_dhcp_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_dhcp_request( - resource_group_name: str, private_cloud_name: str, dhcp_id: str, subscription_id: str, **kwargs: Any +def build_delete_dns_service_request( + resource_group_name: str, dns_service_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), + "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str", pattern=r"^[-\w\._]+$"), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "dhcpId": _SERIALIZER.url("dhcp_id", dhcp_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -460,19 +455,19 @@ def build_delete_dhcp_request( return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_gateways_request( +def build_list_dns_zones_request( resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -493,19 +488,19 @@ def build_list_gateways_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_gateway_request( - resource_group_name: str, private_cloud_name: str, gateway_id: str, subscription_id: str, **kwargs: Any +def build_get_dns_zone_request( + resource_group_name: str, private_cloud_name: str, dns_zone_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -513,7 +508,7 @@ def build_get_gateway_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "gatewayId": _SERIALIZER.url("gateway_id", gateway_id, "str"), + "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -527,19 +522,20 @@ def build_get_gateway_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_port_mirroring_request( - resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +def build_create_dns_zone_request( + resource_group_name: str, private_cloud_name: str, dns_zone_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -547,6 +543,7 @@ def build_list_port_mirroring_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -555,24 +552,27 @@ def build_list_port_mirroring_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_port_mirroring_request( - resource_group_name: str, private_cloud_name: str, port_mirroring_id: str, subscription_id: str, **kwargs: Any +def build_update_dns_zone_request( + resource_group_name: str, private_cloud_name: str, dns_zone_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -580,7 +580,7 @@ def build_get_port_mirroring_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str"), + "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -589,33 +589,34 @@ def build_get_port_mirroring_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_port_mirroring_request( - resource_group_name: str, private_cloud_name: str, port_mirroring_id: str, subscription_id: str, **kwargs: Any +def build_delete_dns_zone_request( + resource_group_name: str, dns_zone_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), + "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str", pattern=r"^[-\w\._]+$"), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -624,27 +625,24 @@ def build_create_port_mirroring_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_port_mirroring_request( - resource_group_name: str, private_cloud_name: str, port_mirroring_id: str, subscription_id: str, **kwargs: Any +def build_list_gateways_request( + resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -652,7 +650,6 @@ def build_update_port_mirroring_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -661,34 +658,32 @@ def build_update_port_mirroring_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_port_mirroring_request( - resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +def build_get_gateway_request( + resource_group_name: str, private_cloud_name: str, gateway_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str"), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "gatewayId": _SERIALIZER.url("gateway_id", gateway_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -699,22 +694,22 @@ def build_delete_port_mirroring_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_vm_groups_request( +def build_list_port_mirroring_request( resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -735,19 +730,19 @@ def build_list_vm_groups_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_vm_group_request( - resource_group_name: str, private_cloud_name: str, vm_group_id: str, subscription_id: str, **kwargs: Any +def build_get_port_mirroring_request( + resource_group_name: str, private_cloud_name: str, port_mirroring_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -755,7 +750,7 @@ def build_get_vm_group_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str"), + "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -769,20 +764,20 @@ def build_get_vm_group_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_vm_group_request( - resource_group_name: str, private_cloud_name: str, vm_group_id: str, subscription_id: str, **kwargs: Any +def build_create_port_mirroring_request( + resource_group_name: str, private_cloud_name: str, port_mirroring_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -790,7 +785,7 @@ def build_create_vm_group_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str"), + "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -806,20 +801,20 @@ def build_create_vm_group_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_vm_group_request( - resource_group_name: str, private_cloud_name: str, vm_group_id: str, subscription_id: str, **kwargs: Any +def build_update_port_mirroring_request( + resource_group_name: str, private_cloud_name: str, port_mirroring_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -827,7 +822,7 @@ def build_update_vm_group_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str"), + "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -843,26 +838,26 @@ def build_update_vm_group_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_vm_group_request( - resource_group_name: str, vm_group_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +def build_delete_port_mirroring_request( + resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str"), + "portMirroringId": _SERIALIZER.url("port_mirroring_id", port_mirroring_id, "str", pattern=r"^[-\w\._]+$"), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } @@ -877,19 +872,19 @@ def build_delete_vm_group_request( return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_virtual_machines_request( +def build_list_public_i_ps_request( resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -910,19 +905,19 @@ def build_list_virtual_machines_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_virtual_machine_request( - resource_group_name: str, private_cloud_name: str, virtual_machine_id: str, subscription_id: str, **kwargs: Any +def build_get_public_ip_request( + resource_group_name: str, private_cloud_name: str, public_ip_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -930,7 +925,7 @@ def build_get_virtual_machine_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "virtualMachineId": _SERIALIZER.url("virtual_machine_id", virtual_machine_id, "str"), + "publicIPId": _SERIALIZER.url("public_ip_id", public_ip_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -944,19 +939,20 @@ def build_get_virtual_machine_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_dns_services_request( - resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +def build_create_public_ip_request( + resource_group_name: str, private_cloud_name: str, public_ip_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -964,6 +960,7 @@ def build_list_dns_services_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "publicIPId": _SERIALIZER.url("public_ip_id", public_ip_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -972,32 +969,34 @@ def build_list_dns_services_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_dns_service_request( - resource_group_name: str, private_cloud_name: str, dns_service_id: str, subscription_id: str, **kwargs: Any +def build_delete_public_ip_request( + resource_group_name: str, public_ip_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), + "publicIPId": _SERIALIZER.url("public_ip_id", public_ip_id, "str", pattern=r"^[-\w\._]+$"), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1008,23 +1007,22 @@ def build_get_dns_service_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_dns_service_request( - resource_group_name: str, private_cloud_name: str, dns_service_id: str, subscription_id: str, **kwargs: Any +def build_list_segments_request( + resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1032,7 +1030,6 @@ def build_create_dns_service_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1041,27 +1038,24 @@ def build_create_dns_service_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_dns_service_request( - resource_group_name: str, private_cloud_name: str, dns_service_id: str, subscription_id: str, **kwargs: Any +def build_get_segment_request( + resource_group_name: str, private_cloud_name: str, segment_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1069,7 +1063,7 @@ def build_update_dns_service_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str"), + "segmentId": _SERIALIZER.url("segment_id", segment_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1078,34 +1072,33 @@ def build_update_dns_service_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_dns_service_request( - resource_group_name: str, dns_service_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +def build_create_segments_request( + resource_group_name: str, private_cloud_name: str, segment_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "dnsServiceId": _SERIALIZER.url("dns_service_id", dns_service_id, "str"), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "segmentId": _SERIALIZER.url("segment_id", segment_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1114,24 +1107,27 @@ def build_delete_dns_service_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_dns_zones_request( - resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +def build_update_segments_request( + resource_group_name: str, private_cloud_name: str, segment_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1139,6 +1135,7 @@ def build_list_dns_zones_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "segmentId": _SERIALIZER.url("segment_id", segment_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1147,24 +1144,26 @@ def build_list_dns_zones_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_dns_zone_request( - resource_group_name: str, private_cloud_name: str, dns_zone_id: str, subscription_id: str, **kwargs: Any +def build_delete_segment_request( + resource_group_name: str, private_cloud_name: str, segment_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1172,7 +1171,7 @@ def build_get_dns_zone_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str"), + "segmentId": _SERIALIZER.url("segment_id", segment_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1183,23 +1182,22 @@ def build_get_dns_zone_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_dns_zone_request( - resource_group_name: str, private_cloud_name: str, dns_zone_id: str, subscription_id: str, **kwargs: Any +def build_list_virtual_machines_request( + resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1207,7 +1205,6 @@ def build_create_dns_zone_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1216,27 +1213,24 @@ def build_create_dns_zone_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_dns_zone_request( - resource_group_name: str, private_cloud_name: str, dns_zone_id: str, subscription_id: str, **kwargs: Any +def build_get_virtual_machine_request( + resource_group_name: str, private_cloud_name: str, virtual_machine_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1244,7 +1238,7 @@ def build_update_dns_zone_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str"), + "virtualMachineId": _SERIALIZER.url("virtual_machine_id", virtual_machine_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1253,33 +1247,30 @@ def build_update_dns_zone_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_dns_zone_request( - resource_group_name: str, dns_zone_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +def build_list_vm_groups_request( + resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "dnsZoneId": _SERIALIZER.url("dns_zone_id", dns_zone_id, "str"), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } @@ -1291,22 +1282,22 @@ def build_delete_dns_zone_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_public_i_ps_request( - resource_group_name: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +def build_get_vm_group_request( + resource_group_name: str, private_cloud_name: str, vm_group_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1314,6 +1305,7 @@ def build_list_public_i_ps_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), + "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1327,19 +1319,20 @@ def build_list_public_i_ps_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_public_ip_request( - resource_group_name: str, private_cloud_name: str, public_ip_id: str, subscription_id: str, **kwargs: Any +def build_create_vm_group_request( + resource_group_name: str, private_cloud_name: str, vm_group_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1347,7 +1340,7 @@ def build_get_public_ip_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "publicIPId": _SERIALIZER.url("public_ip_id", public_ip_id, "str"), + "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1356,25 +1349,27 @@ def build_get_public_ip_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_public_ip_request( - resource_group_name: str, private_cloud_name: str, public_ip_id: str, subscription_id: str, **kwargs: Any +def build_update_vm_group_request( + resource_group_name: str, private_cloud_name: str, vm_group_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1382,7 +1377,7 @@ def build_create_public_ip_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), - "publicIPId": _SERIALIZER.url("public_ip_id", public_ip_id, "str"), + "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1395,29 +1390,29 @@ def build_create_public_ip_request( _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_public_ip_request( - resource_group_name: str, public_ip_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any +def build_delete_vm_group_request( + resource_group_name: str, vm_group_id: str, private_cloud_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "publicIPId": _SERIALIZER.url("public_ip_id", public_ip_id, "str"), + "vmGroupId": _SERIALIZER.url("vm_group_id", vm_group_id, "str", pattern=r"^[-\w\._]+$"), "privateCloudName": _SERIALIZER.url("private_cloud_name", private_cloud_name, "str", pattern=r"^[-\w\._]+$"), } @@ -1451,88 +1446,11 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def get( - self, - resource_group_name: str, - private_cloud_name: str, - workload_network_name: Union[str, _models.WorkloadNetworkName], - **kwargs: Any - ) -> _models.WorkloadNetwork: - """Get a private cloud workload network. - - Get a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param workload_network_name: Name for the workload network in the private cloud. "default" - Required. - :type workload_network_name: str or ~azure.mgmt.avs.models.WorkloadNetworkName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetwork or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetwork - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetwork] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - workload_network_name=workload_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkloadNetwork", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}" - } - @distributed_trace def list( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any ) -> Iterable["_models.WorkloadNetwork"]: - """List of workload networks in a private cloud. - - List of workload networks in a private cloud. + """List WorkloadNetwork resources by PrivateCloud. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1548,7 +1466,7 @@ def list( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1592,7 +1510,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -1621,12 +1539,73 @@ def get_next(next_link=None): } @distributed_trace - def list_segments( - self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> Iterable["_models.WorkloadNetworkSegment"]: - """List of segments in a private cloud workload network. + def get(self, resource_group_name: str, private_cloud_name: str, **kwargs: Any) -> _models.WorkloadNetwork: + """Get a WorkloadNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkloadNetwork or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetwork] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WorkloadNetwork", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized - List of segments in a private cloud workload network. + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default" + } + + @distributed_trace + def list_dhcp( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> Iterable["_models.WorkloadNetworkDhcp"]: + """List WorkloadNetworkDhcp resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1634,16 +1613,15 @@ def list_segments( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkSegment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :return: An iterator like instance of either WorkloadNetworkDhcp or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkSegmentsList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDhcpListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1656,12 +1634,12 @@ def list_segments( def prepare_request(next_link=None): if not next_link: - request = build_list_segments_request( + request = build_list_dhcp_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_segments.metadata["url"], + template_url=self.list_dhcp.metadata["url"], headers=_headers, params=_params, ) @@ -1687,7 +1665,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkSegmentsList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcpListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -1711,29 +1689,26 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_segments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments" + list_dhcp.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations" } @distributed_trace - def get_segment( - self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkSegment: - """Get a segment by id in a private cloud workload network. - - Get a segment by id in a private cloud workload network. + def get_dhcp( + self, resource_group_name: str, dhcp_id: str, private_cloud_name: str, **kwargs: Any + ) -> _models.WorkloadNetworkDhcp: + """Get a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkSegment + :return: WorkloadNetworkDhcp or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDhcp :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -1748,15 +1723,15 @@ def get_segment( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) - request = build_get_segment_request( + request = build_get_dhcp_request( resource_group_name=resource_group_name, + dhcp_id=dhcp_id, private_cloud_name=private_cloud_name, - segment_id=segment_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_segment.metadata["url"], + template_url=self.get_dhcp.metadata["url"], headers=_headers, params=_params, ) @@ -1775,25 +1750,25 @@ def get_segment( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_segment.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + get_dhcp.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } - def _create_segments_initial( + def _create_dhcp_initial( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], + dhcp_id: str, + workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], **kwargs: Any - ) -> _models.WorkloadNetworkSegment: + ) -> _models.WorkloadNetworkDhcp: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1807,26 +1782,26 @@ def _create_segments_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_segment, (IOBase, bytes)): - _content = workload_network_segment + if isinstance(workload_network_dhcp, (IOBase, bytes)): + _content = workload_network_dhcp else: - _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegment") + _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcp") - request = build_create_segments_request( + request = build_create_dhcp_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, + dhcp_id=dhcp_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._create_segments_initial.metadata["url"], + template_url=self._create_dhcp_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1845,47 +1820,47 @@ def _create_segments_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_segments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + _create_dhcp_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } @overload - def begin_create_segments( + def begin_create_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: _models.WorkloadNetworkSegment, + dhcp_id: str, + workload_network_dhcp: _models.WorkloadNetworkDhcp, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkSegment]: - """Create a segment by id in a private cloud workload network. - - Create a segment by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDhcp]: + """Create a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Required. - :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: Resource create parameters. Required. + :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -1896,37 +1871,34 @@ def begin_create_segments( :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 WorkloadNetworkSegment or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkDhcp or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_segments( + def begin_create_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: IO, + dhcp_id: str, + workload_network_dhcp: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkSegment]: - """Create a segment by id in a private cloud workload network. - - Create a segment by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDhcp]: + """Create a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Required. - :type workload_network_segment: IO + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: Resource create parameters. Required. + :type workload_network_dhcp: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1938,36 +1910,33 @@ def begin_create_segments( :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 WorkloadNetworkSegment or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkDhcp or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_segments( + def begin_create_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], + dhcp_id: str, + workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkSegment]: - """Create a segment by id in a private cloud workload network. - - Create a segment by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDhcp]: + """Create a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Is either a WorkloadNetworkSegment type or a IO - type. Required. - :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment or IO + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: Resource create parameters. Is either a WorkloadNetworkDhcp type + or a IO type. Required. + :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1979,9 +1948,9 @@ def begin_create_segments( :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 WorkloadNetworkSegment or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkDhcp or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1989,16 +1958,16 @@ def begin_create_segments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_segments_initial( + raw_result = self._create_dhcp_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, - workload_network_segment=workload_network_segment, + dhcp_id=dhcp_id, + workload_network_dhcp=workload_network_dhcp, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -2009,13 +1978,15 @@ def begin_create_segments( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2029,18 +2000,18 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_segments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + begin_create_dhcp.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } - def _update_segments_initial( + def _update_dhcp_initial( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], + dhcp_id: str, + workload_network_dhcp: Union[_models.WorkloadNetworkDhcpUpdate, IO], **kwargs: Any - ) -> Optional[_models.WorkloadNetworkSegment]: + ) -> Optional[_models.WorkloadNetworkDhcp]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2054,26 +2025,26 @@ def _update_segments_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkSegment]] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkDhcp]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_segment, (IOBase, bytes)): - _content = workload_network_segment + if isinstance(workload_network_dhcp, (IOBase, bytes)): + _content = workload_network_dhcp else: - _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegment") + _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcpUpdate") - request = build_update_segments_request( + request = build_update_dhcp_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, + dhcp_id=dhcp_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._update_segments_initial.metadata["url"], + template_url=self._update_dhcp_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2093,43 +2064,45 @@ def _update_segments_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_segments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + _update_dhcp_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } @overload - def begin_update_segments( + def begin_update_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: _models.WorkloadNetworkSegment, + dhcp_id: str, + workload_network_dhcp: _models.WorkloadNetworkDhcpUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkSegment]: - """Create or update a segment by id in a private cloud workload network. - - Create or update a segment by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDhcp]: + """Update a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Required. - :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: The resource properties to be updated. Required. + :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcpUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2141,37 +2114,34 @@ def begin_update_segments( :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 WorkloadNetworkSegment or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkDhcp or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_segments( + def begin_update_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: IO, + dhcp_id: str, + workload_network_dhcp: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkSegment]: - """Create or update a segment by id in a private cloud workload network. - - Create or update a segment by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDhcp]: + """Update a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Required. - :type workload_network_segment: IO + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: The resource properties to be updated. Required. + :type workload_network_dhcp: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2183,36 +2153,33 @@ def begin_update_segments( :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 WorkloadNetworkSegment or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkDhcp or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update_segments( + def begin_update_dhcp( self, resource_group_name: str, private_cloud_name: str, - segment_id: str, - workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], + dhcp_id: str, + workload_network_dhcp: Union[_models.WorkloadNetworkDhcpUpdate, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkSegment]: - """Create or update a segment by id in a private cloud workload network. - - Create or update a segment by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDhcp]: + """Update a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str - :param workload_network_segment: NSX Segment. Is either a WorkloadNetworkSegment type or a IO - type. Required. - :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment or IO + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: str + :param workload_network_dhcp: The resource properties to be updated. Is either a + WorkloadNetworkDhcpUpdate type or a IO type. Required. + :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcpUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -2224,9 +2191,9 @@ def begin_update_segments( :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 WorkloadNetworkSegment or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkDhcp or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2234,16 +2201,16 @@ def begin_update_segments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_segments_initial( + raw_result = self._update_dhcp_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, - workload_network_segment=workload_network_segment, + dhcp_id=dhcp_id, + workload_network_dhcp=workload_network_dhcp, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -2254,13 +2221,15 @@ def begin_update_segments( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2274,12 +2243,12 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_segments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + begin_update_dhcp.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } - def _delete_segment_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any + def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_cloud_name: str, dhcp_id: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2295,13 +2264,13 @@ def _delete_segment_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_segment_request( + request = build_delete_dhcp_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, + dhcp_id=dhcp_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_segment_initial.metadata["url"], + template_url=self._delete_dhcp_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2320,29 +2289,31 @@ def _delete_segment_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_segment_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + _delete_dhcp_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } @distributed_trace - def begin_delete_segment( - self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any + def begin_delete_dhcp( + self, resource_group_name: str, private_cloud_name: str, dhcp_id: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a segment by id in a private cloud workload network. - - Delete a segment by id in a private cloud workload network. + """Delete a WorkloadNetworkDhcp. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param segment_id: NSX Segment identifier. Generally the same as the Segment's display name. - Required. - :type segment_id: str + :param dhcp_id: The ID of the DHCP configuration. Required. + :type dhcp_id: 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: By default, your polling method will be ARMPolling. Pass in False for this @@ -2364,10 +2335,10 @@ def begin_delete_segment( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_segment_initial( # type: ignore + raw_result = self._delete_dhcp_initial( # type: ignore resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - segment_id=segment_id, + dhcp_id=dhcp_id, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -2381,7 +2352,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2395,17 +2368,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_segment.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + begin_delete_dhcp.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" } @distributed_trace - def list_dhcp( + def list_dns_services( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> Iterable["_models.WorkloadNetworkDhcp"]: - """List dhcp in a private cloud workload network. - - List dhcp in a private cloud workload network. + ) -> Iterable["_models.WorkloadNetworkDnsService"]: + """List WorkloadNetworkDnsService resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2413,15 +2384,16 @@ def list_dhcp( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkDhcp or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An iterator like instance of either WorkloadNetworkDnsService or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDhcpList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsServiceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2434,12 +2406,12 @@ def list_dhcp( def prepare_request(next_link=None): if not next_link: - request = build_list_dhcp_request( + request = build_list_dns_services_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_dhcp.metadata["url"], + template_url=self.list_dns_services.metadata["url"], headers=_headers, params=_params, ) @@ -2465,7 +2437,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDhcpList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsServiceListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -2489,28 +2461,26 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_dhcp.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations" + list_dns_services.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices" } @distributed_trace - def get_dhcp( - self, resource_group_name: str, dhcp_id: str, private_cloud_name: str, **kwargs: Any - ) -> _models.WorkloadNetworkDhcp: - """Get dhcp by id in a private cloud workload network. - - Get dhcp by id in a private cloud workload network. + def get_dns_service( + self, resource_group_name: str, private_cloud_name: str, dns_service_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkDnsService: + """Get a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkDhcp or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDhcp + :return: WorkloadNetworkDnsService or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsService :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -2525,15 +2495,15 @@ def get_dhcp( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) - request = build_get_dhcp_request( + request = build_get_dns_service_request( resource_group_name=resource_group_name, - dhcp_id=dhcp_id, private_cloud_name=private_cloud_name, + dns_service_id=dns_service_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_dhcp.metadata["url"], + template_url=self.get_dns_service.metadata["url"], headers=_headers, params=_params, ) @@ -2552,25 +2522,25 @@ def get_dhcp( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dhcp.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + get_dns_service.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } - def _create_dhcp_initial( + def _create_dns_service_initial( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], + dns_service_id: str, + workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], **kwargs: Any - ) -> _models.WorkloadNetworkDhcp: + ) -> _models.WorkloadNetworkDnsService: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2584,26 +2554,26 @@ def _create_dhcp_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dhcp, (IOBase, bytes)): - _content = workload_network_dhcp + if isinstance(workload_network_dns_service, (IOBase, bytes)): + _content = workload_network_dns_service else: - _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcp") + _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsService") - request = build_create_dhcp_request( + request = build_create_dns_service_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, + dns_service_id=dns_service_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._create_dhcp_initial.metadata["url"], + template_url=self._create_dns_service_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2622,45 +2592,46 @@ def _create_dhcp_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_dhcp_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + _create_dns_service_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } @overload - def begin_create_dhcp( + def begin_create_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: _models.WorkloadNetworkDhcp, + dns_service_id: str, + workload_network_dns_service: _models.WorkloadNetworkDnsService, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDhcp]: - """Create dhcp by id in a private cloud workload network. - - Create dhcp by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsService]: + """Create a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Required. - :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: Resource create parameters. Required. + :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2672,36 +2643,34 @@ def begin_create_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsService or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_dhcp( + def begin_create_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: IO, + dns_service_id: str, + workload_network_dns_service: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDhcp]: - """Create dhcp by id in a private cloud workload network. - - Create dhcp by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsService]: + """Create a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Required. - :type workload_network_dhcp: IO + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: Resource create parameters. Required. + :type workload_network_dns_service: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2713,35 +2682,33 @@ def begin_create_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsService or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_dhcp( + def begin_create_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], + dns_service_id: str, + workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDhcp]: - """Create dhcp by id in a private cloud workload network. - - Create dhcp by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsService]: + """Create a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Is either a WorkloadNetworkDhcp type or a IO type. - Required. - :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or IO + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: Resource create parameters. Is either a + WorkloadNetworkDnsService type or a IO type. Required. + :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -2753,9 +2720,9 @@ def begin_create_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsService or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2763,16 +2730,16 @@ def begin_create_dhcp( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_dhcp_initial( + raw_result = self._create_dns_service_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, - workload_network_dhcp=workload_network_dhcp, + dns_service_id=dns_service_id, + workload_network_dns_service=workload_network_dns_service, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -2783,13 +2750,15 @@ def begin_create_dhcp( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2803,18 +2772,18 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_dhcp.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + begin_create_dns_service.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } - def _update_dhcp_initial( + def _update_dns_service_initial( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], + dns_service_id: str, + workload_network_dns_service: Union[_models.WorkloadNetworkDnsServiceUpdate, IO], **kwargs: Any - ) -> Optional[_models.WorkloadNetworkDhcp]: + ) -> Optional[_models.WorkloadNetworkDnsService]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2828,26 +2797,26 @@ def _update_dhcp_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkDhcp]] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkDnsService]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dhcp, (IOBase, bytes)): - _content = workload_network_dhcp + if isinstance(workload_network_dns_service, (IOBase, bytes)): + _content = workload_network_dns_service else: - _json = self._serialize.body(workload_network_dhcp, "WorkloadNetworkDhcp") + _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsServiceUpdate") - request = build_update_dhcp_request( + request = build_update_dns_service_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, + dns_service_id=dns_service_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._update_dhcp_initial.metadata["url"], + template_url=self._update_dns_service_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2867,42 +2836,45 @@ def _update_dhcp_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) + + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_dhcp_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + _update_dns_service_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } @overload - def begin_update_dhcp( + def begin_update_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: _models.WorkloadNetworkDhcp, + dns_service_id: str, + workload_network_dns_service: _models.WorkloadNetworkDnsServiceUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDhcp]: - """Create or update dhcp by id in a private cloud workload network. - - Create or update dhcp by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsService]: + """Update a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Required. - :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: The resource properties to be updated. Required. + :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsServiceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2914,36 +2886,34 @@ def begin_update_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsService or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_dhcp( + def begin_update_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: IO, + dns_service_id: str, + workload_network_dns_service: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDhcp]: - """Create or update dhcp by id in a private cloud workload network. - - Create or update dhcp by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsService]: + """Update a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Required. - :type workload_network_dhcp: IO + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: The resource properties to be updated. Required. + :type workload_network_dns_service: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2955,35 +2925,34 @@ def begin_update_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsService or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update_dhcp( + def begin_update_dns_service( self, resource_group_name: str, private_cloud_name: str, - dhcp_id: str, - workload_network_dhcp: Union[_models.WorkloadNetworkDhcp, IO], + dns_service_id: str, + workload_network_dns_service: Union[_models.WorkloadNetworkDnsServiceUpdate, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDhcp]: - """Create or update dhcp by id in a private cloud workload network. - - Create or update dhcp by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsService]: + """Update a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: str - :param workload_network_dhcp: NSX DHCP. Is either a WorkloadNetworkDhcp type or a IO type. - Required. - :type workload_network_dhcp: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or IO + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str + :param workload_network_dns_service: The resource properties to be updated. Is either a + WorkloadNetworkDnsServiceUpdate type or a IO type. Required. + :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsServiceUpdate or + IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -2995,9 +2964,9 @@ def begin_update_dhcp( :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 WorkloadNetworkDhcp or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsService or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3005,16 +2974,16 @@ def begin_update_dhcp( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDhcp] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_dhcp_initial( + raw_result = self._update_dns_service_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, - workload_network_dhcp=workload_network_dhcp, + dns_service_id=dns_service_id, + workload_network_dns_service=workload_network_dns_service, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3025,13 +2994,15 @@ def begin_update_dhcp( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDhcp", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3045,12 +3016,12 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_dhcp.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + begin_update_dns_service.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } - def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, private_cloud_name: str, dhcp_id: str, **kwargs: Any + def _delete_dns_service_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, dns_service_id: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -3066,13 +3037,13 @@ def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_dhcp_request( + request = build_delete_dns_service_request( resource_group_name=resource_group_name, + dns_service_id=dns_service_id, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_dhcp_initial.metadata["url"], + template_url=self._delete_dns_service_initial.metadata["url"], headers=_headers, params=_params, ) @@ -3091,28 +3062,31 @@ def _delete_dhcp_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_dhcp_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + _delete_dns_service_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } @distributed_trace - def begin_delete_dhcp( - self, resource_group_name: str, private_cloud_name: str, dhcp_id: str, **kwargs: Any + def begin_delete_dns_service( + self, resource_group_name: str, dns_service_id: str, private_cloud_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete dhcp by id in a private cloud workload network. - - Delete dhcp by id in a private cloud workload network. + """Delete a WorkloadNetworkDnsService. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str + :param dns_service_id: ID of the DNS service. Required. + :type dns_service_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP display name. Required. - :type dhcp_id: 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: By default, your polling method will be ARMPolling. Pass in False for this @@ -3134,10 +3108,10 @@ def begin_delete_dhcp( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_dhcp_initial( # type: ignore + raw_result = self._delete_dns_service_initial( # type: ignore resource_group_name=resource_group_name, + dns_service_id=dns_service_id, private_cloud_name=private_cloud_name, - dhcp_id=dhcp_id, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -3151,7 +3125,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3165,17 +3141,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_dhcp.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + begin_delete_dns_service.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" } @distributed_trace - def list_gateways( + def list_dns_zones( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> Iterable["_models.WorkloadNetworkGateway"]: - """List of gateways in a private cloud workload network. - - List of gateways in a private cloud workload network. + ) -> Iterable["_models.WorkloadNetworkDnsZone"]: + """List WorkloadNetworkDnsZone resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3183,16 +3157,16 @@ def list_gateways( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkGateway or the result of + :return: An iterator like instance of either WorkloadNetworkDnsZone or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkGateway] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkGatewayList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsZoneListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -3205,12 +3179,12 @@ def list_gateways( def prepare_request(next_link=None): if not next_link: - request = build_list_gateways_request( + request = build_list_dns_zones_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_gateways.metadata["url"], + template_url=self.list_dns_zones.metadata["url"], headers=_headers, params=_params, ) @@ -3236,7 +3210,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkGatewayList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZoneListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -3260,29 +3234,26 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_gateways.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways" + list_dns_zones.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones" } @distributed_trace - def get_gateway( - self, resource_group_name: str, private_cloud_name: str, gateway_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkGateway: - """Get a gateway by id in a private cloud workload network. - - Get a gateway by id in a private cloud workload network. + def get_dns_zone( + self, resource_group_name: str, private_cloud_name: str, dns_zone_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkDnsZone: + """Get a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param gateway_id: NSX Gateway identifier. Generally the same as the Gateway's display name. - Required. - :type gateway_id: str + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkGateway or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkGateway + :return: WorkloadNetworkDnsZone or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -3297,15 +3268,15 @@ def get_gateway( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkGateway] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) - request = build_get_gateway_request( + request = build_get_dns_zone_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - gateway_id=gateway_id, + dns_zone_id=dns_zone_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_gateway.metadata["url"], + template_url=self.get_dns_zone.metadata["url"], headers=_headers, params=_params, ) @@ -3324,191 +3295,25 @@ def get_gateway( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkGateway", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_gateway.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}" + get_dns_zone.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } - @distributed_trace - def list_port_mirroring( - self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> Iterable["_models.WorkloadNetworkPortMirroring"]: - """List of port mirroring profiles in a private cloud workload network. - - List of port mirroring profiles in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkPortMirroring or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkPortMirroringList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_port_mirroring_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_port_mirroring.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkPortMirroringList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_port_mirroring.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles" - } - - @distributed_trace - def get_port_mirroring( - self, resource_group_name: str, private_cloud_name: str, port_mirroring_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkPortMirroring: - """Get a port mirroring profile by id in a private cloud workload network. - - Get a port mirroring profile by id in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkPortMirroring or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) - - request = build_get_port_mirroring_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - port_mirroring_id=port_mirroring_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_port_mirroring.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_port_mirroring.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" - } - - def _create_port_mirroring_initial( + def _create_dns_zone_initial( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], + dns_zone_id: str, + workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], **kwargs: Any - ) -> _models.WorkloadNetworkPortMirroring: + ) -> _models.WorkloadNetworkDnsZone: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3522,26 +3327,26 @@ def _create_port_mirroring_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_port_mirroring, (IOBase, bytes)): - _content = workload_network_port_mirroring + if isinstance(workload_network_dns_zone, (IOBase, bytes)): + _content = workload_network_dns_zone else: - _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroring") + _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZone") - request = build_create_port_mirroring_request( + request = build_create_dns_zone_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - port_mirroring_id=port_mirroring_id, + dns_zone_id=dns_zone_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._create_port_mirroring_initial.metadata["url"], + template_url=self._create_dns_zone_initial.metadata["url"], headers=_headers, params=_params, ) @@ -3560,46 +3365,46 @@ def _create_port_mirroring_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_port_mirroring_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + _create_dns_zone_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } @overload - def begin_create_port_mirroring( + def begin_create_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: _models.WorkloadNetworkPortMirroring, + dns_zone_id: str, + workload_network_dns_zone: _models.WorkloadNetworkDnsZone, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: - """Create a port mirroring profile by id in a private cloud workload network. - - Create a port mirroring profile by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsZone]: + """Create a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Required. - :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: Resource create parameters. Required. + :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3611,37 +3416,34 @@ def begin_create_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsZone or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_port_mirroring( + def begin_create_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: IO, + dns_zone_id: str, + workload_network_dns_zone: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: - """Create a port mirroring profile by id in a private cloud workload network. - - Create a port mirroring profile by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsZone]: + """Create a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Required. - :type workload_network_port_mirroring: IO + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: Resource create parameters. Required. + :type workload_network_dns_zone: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -3653,37 +3455,33 @@ def begin_create_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsZone or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_port_mirroring( + def begin_create_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], + dns_zone_id: str, + workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: - """Create a port mirroring profile by id in a private cloud workload network. - - Create a port mirroring profile by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsZone]: + """Create a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Is either a - WorkloadNetworkPortMirroring type or a IO type. Required. - :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or - IO + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: Resource create parameters. Is either a + WorkloadNetworkDnsZone type or a IO type. Required. + :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -3695,9 +3493,9 @@ def begin_create_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsZone or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3705,16 +3503,16 @@ def begin_create_port_mirroring( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_port_mirroring_initial( + raw_result = self._create_dns_zone_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - port_mirroring_id=port_mirroring_id, - workload_network_port_mirroring=workload_network_port_mirroring, + dns_zone_id=dns_zone_id, + workload_network_dns_zone=workload_network_dns_zone, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3725,13 +3523,15 @@ def begin_create_port_mirroring( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3745,18 +3545,18 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_port_mirroring.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" - } + begin_create_dns_zone.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + } - def _update_port_mirroring_initial( + def _update_dns_zone_initial( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], + dns_zone_id: str, + workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZoneUpdate, IO], **kwargs: Any - ) -> Optional[_models.WorkloadNetworkPortMirroring]: + ) -> Optional[_models.WorkloadNetworkDnsZone]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3770,26 +3570,26 @@ def _update_port_mirroring_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkPortMirroring]] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkDnsZone]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_port_mirroring, (IOBase, bytes)): - _content = workload_network_port_mirroring + if isinstance(workload_network_dns_zone, (IOBase, bytes)): + _content = workload_network_dns_zone else: - _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroring") + _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZoneUpdate") - request = build_update_port_mirroring_request( + request = build_update_dns_zone_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - port_mirroring_id=port_mirroring_id, + dns_zone_id=dns_zone_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._update_port_mirroring_initial.metadata["url"], + template_url=self._update_dns_zone_initial.metadata["url"], headers=_headers, params=_params, ) @@ -3809,43 +3609,45 @@ def _update_port_mirroring_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_port_mirroring_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + _update_dns_zone_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } @overload - def begin_update_port_mirroring( + def begin_update_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: _models.WorkloadNetworkPortMirroring, + dns_zone_id: str, + workload_network_dns_zone: _models.WorkloadNetworkDnsZoneUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: - """Create or update a port mirroring profile by id in a private cloud workload network. - - Create or update a port mirroring profile by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsZone]: + """Update a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Required. - :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: The resource properties to be updated. Required. + :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZoneUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3857,37 +3659,34 @@ def begin_update_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsZone or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_port_mirroring( + def begin_update_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: IO, + dns_zone_id: str, + workload_network_dns_zone: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: - """Create or update a port mirroring profile by id in a private cloud workload network. - - Create or update a port mirroring profile by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsZone]: + """Update a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Required. - :type workload_network_port_mirroring: IO + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: The resource properties to be updated. Required. + :type workload_network_dns_zone: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -3899,37 +3698,33 @@ def begin_update_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsZone or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update_port_mirroring( + def begin_update_dns_zone( self, resource_group_name: str, private_cloud_name: str, - port_mirroring_id: str, - workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], + dns_zone_id: str, + workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZoneUpdate, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: - """Create or update a port mirroring profile by id in a private cloud workload network. - - Create or update a port mirroring profile by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkDnsZone]: + """Update a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str - :param workload_network_port_mirroring: NSX port mirroring. Is either a - WorkloadNetworkPortMirroring type or a IO type. Required. - :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or - IO + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str + :param workload_network_dns_zone: The resource properties to be updated. Is either a + WorkloadNetworkDnsZoneUpdate type or a IO type. Required. + :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZoneUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -3941,9 +3736,9 @@ def begin_update_port_mirroring( :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 WorkloadNetworkPortMirroring or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :return: An instance of LROPoller that returns either WorkloadNetworkDnsZone or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3951,16 +3746,16 @@ def begin_update_port_mirroring( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_port_mirroring_initial( + raw_result = self._update_dns_zone_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - port_mirroring_id=port_mirroring_id, - workload_network_port_mirroring=workload_network_port_mirroring, + dns_zone_id=dns_zone_id, + workload_network_dns_zone=workload_network_dns_zone, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3971,13 +3766,15 @@ def begin_update_port_mirroring( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3991,12 +3788,12 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_port_mirroring.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + begin_update_dns_zone.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } - def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, **kwargs: Any + def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, dns_zone_id: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -4012,13 +3809,13 @@ def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return-state api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_port_mirroring_request( + request = build_delete_dns_zone_request( resource_group_name=resource_group_name, - port_mirroring_id=port_mirroring_id, + dns_zone_id=dns_zone_id, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_port_mirroring_initial.metadata["url"], + template_url=self._delete_dns_zone_initial.metadata["url"], headers=_headers, params=_params, ) @@ -4037,27 +3834,29 @@ def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return-state error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_port_mirroring_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + _delete_dns_zone_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } @distributed_trace - def begin_delete_port_mirroring( - self, resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, **kwargs: Any + def begin_delete_dns_zone( + self, resource_group_name: str, dns_zone_id: str, private_cloud_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a port mirroring profile by id in a private cloud workload network. - - Delete a port mirroring profile by id in a private cloud workload network. + """Delete a WorkloadNetworkDnsZone. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param port_mirroring_id: NSX Port Mirroring identifier. Generally the same as the Port - Mirroring display name. Required. - :type port_mirroring_id: str + :param dns_zone_id: ID of the DNS zone. Required. + :type dns_zone_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -4081,9 +3880,9 @@ def begin_delete_port_mirroring( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_port_mirroring_initial( # type: ignore + raw_result = self._delete_dns_zone_initial( # type: ignore resource_group_name=resource_group_name, - port_mirroring_id=port_mirroring_id, + dns_zone_id=dns_zone_id, private_cloud_name=private_cloud_name, api_version=api_version, cls=lambda x, y, z: x, @@ -4098,7 +3897,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4112,17 +3913,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_port_mirroring.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + begin_delete_dns_zone.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" } @distributed_trace - def list_vm_groups( + def list_gateways( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> Iterable["_models.WorkloadNetworkVMGroup"]: - """List of vm groups in a private cloud workload network. - - List of vm groups in a private cloud workload network. + ) -> Iterable["_models.WorkloadNetworkGateway"]: + """List WorkloadNetworkGateway resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4130,16 +3929,16 @@ def list_vm_groups( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkVMGroup or the result of + :return: An iterator like instance of either WorkloadNetworkGateway or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkVMGroupsList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkGatewayListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4152,12 +3951,12 @@ def list_vm_groups( def prepare_request(next_link=None): if not next_link: - request = build_list_vm_groups_request( + request = build_list_gateways_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_vm_groups.metadata["url"], + template_url=self.list_gateways.metadata["url"], headers=_headers, params=_params, ) @@ -4183,7 +3982,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkVMGroupsList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkGatewayListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -4207,29 +4006,26 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_vm_groups.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups" + list_gateways.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways" } @distributed_trace - def get_vm_group( - self, resource_group_name: str, private_cloud_name: str, vm_group_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkVMGroup: - """Get a vm group by id in a private cloud workload network. - - Get a vm group by id in a private cloud workload network. + def get_gateway( + self, resource_group_name: str, private_cloud_name: str, gateway_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkGateway: + """Get a WorkloadNetworkGateway. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str + :param gateway_id: The ID of the NSX Gateway. Required. + :type gateway_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkVMGroup or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :return: WorkloadNetworkGateway or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkGateway :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -4244,15 +4040,15 @@ def get_vm_group( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkGateway] = kwargs.pop("cls", None) - request = build_get_vm_group_request( + request = build_get_gateway_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - vm_group_id=vm_group_id, + gateway_id=gateway_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_vm_group.metadata["url"], + template_url=self.get_gateway.metadata["url"], headers=_headers, params=_params, ) @@ -4271,25 +4067,40 @@ def get_vm_group( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkGateway", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_vm_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + get_gateway.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}" } - def _create_vm_group_initial( - self, - resource_group_name: str, - private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], - **kwargs: Any - ) -> _models.WorkloadNetworkVMGroup: + @distributed_trace + def list_port_mirroring( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> Iterable["_models.WorkloadNetworkPortMirroring"]: + """List WorkloadNetworkPortMirroring resources by WorkloadNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkloadNetworkPortMirroring or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetworkPortMirroringListResult] = kwargs.pop("cls", None) + error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4298,31 +4109,177 @@ def _create_vm_group_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + request = build_list_port_mirroring_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_port_mirroring.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(workload_network_vm_group, (IOBase, bytes)): - _content = workload_network_vm_group - else: - _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroup") + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request - request = build_create_vm_group_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - vm_group_id=vm_group_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, + def extract_data(pipeline_response): + deserialized = self._deserialize("WorkloadNetworkPortMirroringListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_port_mirroring.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles" + } + + @distributed_trace + def get_port_mirroring( + self, resource_group_name: str, private_cloud_name: str, port_mirroring_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkPortMirroring: + """Get a WorkloadNetworkPortMirroring. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkloadNetworkPortMirroring or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) + + request = build_get_port_mirroring_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + port_mirroring_id=port_mirroring_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_port_mirroring.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_port_mirroring.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + } + + def _create_port_mirroring_initial( + self, + resource_group_name: str, + private_cloud_name: str, + port_mirroring_id: str, + workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], + **kwargs: Any + ) -> _models.WorkloadNetworkPortMirroring: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(workload_network_port_mirroring, (IOBase, bytes)): + _content = workload_network_port_mirroring + else: + _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroring") + + request = build_create_port_mirroring_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + port_mirroring_id=port_mirroring_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, content=_content, - template_url=self._create_vm_group_initial.metadata["url"], + template_url=self._create_port_mirroring_initial.metadata["url"], headers=_headers, params=_params, ) @@ -4341,46 +4298,46 @@ def _create_vm_group_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_vm_group_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + _create_port_mirroring_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } @overload - def begin_create_vm_group( + def begin_create_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: _models.WorkloadNetworkVMGroup, + port_mirroring_id: str, + workload_network_port_mirroring: _models.WorkloadNetworkPortMirroring, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkVMGroup]: - """Create a vm group by id in a private cloud workload network. - - Create a vm group by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: + """Create a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Required. - :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: Resource create parameters. Required. + :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4392,37 +4349,34 @@ def begin_create_vm_group( :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 WorkloadNetworkVMGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of LROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_vm_group( + def begin_create_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: IO, + port_mirroring_id: str, + workload_network_port_mirroring: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkVMGroup]: - """Create a vm group by id in a private cloud workload network. - - Create a vm group by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: + """Create a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Required. - :type workload_network_vm_group: IO + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: Resource create parameters. Required. + :type workload_network_port_mirroring: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -4434,36 +4388,34 @@ def begin_create_vm_group( :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 WorkloadNetworkVMGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of LROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_vm_group( + def begin_create_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], + port_mirroring_id: str, + workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroring, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkVMGroup]: - """Create a vm group by id in a private cloud workload network. - - Create a vm group by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: + """Create a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Is either a WorkloadNetworkVMGroup type or a IO - type. Required. - :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or IO + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: Resource create parameters. Is either a + WorkloadNetworkPortMirroring type or a IO type. Required. + :type workload_network_port_mirroring: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or + IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -4475,9 +4427,9 @@ def begin_create_vm_group( :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 WorkloadNetworkVMGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of LROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4485,16 +4437,16 @@ def begin_create_vm_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_vm_group_initial( + raw_result = self._create_port_mirroring_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - vm_group_id=vm_group_id, - workload_network_vm_group=workload_network_vm_group, + port_mirroring_id=port_mirroring_id, + workload_network_port_mirroring=workload_network_port_mirroring, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -4505,13 +4457,15 @@ def begin_create_vm_group( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4525,18 +4479,18 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_vm_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + begin_create_port_mirroring.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } - def _update_vm_group_initial( + def _update_port_mirroring_initial( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], + port_mirroring_id: str, + workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroringUpdate, IO], **kwargs: Any - ) -> Optional[_models.WorkloadNetworkVMGroup]: + ) -> Optional[_models.WorkloadNetworkPortMirroring]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4550,26 +4504,26 @@ def _update_vm_group_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkVMGroup]] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkPortMirroring]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_vm_group, (IOBase, bytes)): - _content = workload_network_vm_group + if isinstance(workload_network_port_mirroring, (IOBase, bytes)): + _content = workload_network_port_mirroring else: - _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroup") + _json = self._serialize.body(workload_network_port_mirroring, "WorkloadNetworkPortMirroringUpdate") - request = build_update_vm_group_request( + request = build_update_port_mirroring_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - vm_group_id=vm_group_id, + port_mirroring_id=port_mirroring_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._update_vm_group_initial.metadata["url"], + template_url=self._update_port_mirroring_initial.metadata["url"], headers=_headers, params=_params, ) @@ -4589,43 +4543,46 @@ def _update_vm_group_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) + + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_vm_group_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + _update_port_mirroring_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } @overload - def begin_update_vm_group( + def begin_update_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: _models.WorkloadNetworkVMGroup, + port_mirroring_id: str, + workload_network_port_mirroring: _models.WorkloadNetworkPortMirroringUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkVMGroup]: - """Create or update a vm group by id in a private cloud workload network. - - Create or update a vm group by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: + """Update a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Required. - :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: The resource properties to be updated. Required. + :type workload_network_port_mirroring: + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4637,37 +4594,34 @@ def begin_update_vm_group( :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 WorkloadNetworkVMGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of LROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_vm_group( + def begin_update_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: IO, + port_mirroring_id: str, + workload_network_port_mirroring: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkVMGroup]: - """Create or update a vm group by id in a private cloud workload network. - - Create or update a vm group by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: + """Update a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Required. - :type workload_network_vm_group: IO + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: The resource properties to be updated. Required. + :type workload_network_port_mirroring: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -4679,36 +4633,34 @@ def begin_update_vm_group( :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 WorkloadNetworkVMGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of LROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update_vm_group( + def begin_update_port_mirroring( self, resource_group_name: str, private_cloud_name: str, - vm_group_id: str, - workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], + port_mirroring_id: str, + workload_network_port_mirroring: Union[_models.WorkloadNetworkPortMirroringUpdate, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkVMGroup]: - """Create or update a vm group by id in a private cloud workload network. - - Create or update a vm group by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkPortMirroring]: + """Update a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str - :param workload_network_vm_group: NSX VM Group. Is either a WorkloadNetworkVMGroup type or a IO - type. Required. - :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or IO + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str + :param workload_network_port_mirroring: The resource properties to be updated. Is either a + WorkloadNetworkPortMirroringUpdate type or a IO type. Required. + :type workload_network_port_mirroring: + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -4720,9 +4672,9 @@ def begin_update_vm_group( :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 WorkloadNetworkVMGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :return: An instance of LROPoller that returns either WorkloadNetworkPortMirroring or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4730,16 +4682,16 @@ def begin_update_vm_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkPortMirroring] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_vm_group_initial( + raw_result = self._update_port_mirroring_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - vm_group_id=vm_group_id, - workload_network_vm_group=workload_network_vm_group, + port_mirroring_id=port_mirroring_id, + workload_network_port_mirroring=workload_network_port_mirroring, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -4750,13 +4702,15 @@ def begin_update_vm_group( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPortMirroring", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4770,12 +4724,12 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_vm_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + begin_update_port_mirroring.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } - def _delete_vm_group_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, vm_group_id: str, private_cloud_name: str, **kwargs: Any + def _delete_port_mirroring_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -4791,13 +4745,13 @@ def _delete_vm_group_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_vm_group_request( + request = build_delete_port_mirroring_request( resource_group_name=resource_group_name, - vm_group_id=vm_group_id, + port_mirroring_id=port_mirroring_id, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_vm_group_initial.metadata["url"], + template_url=self._delete_port_mirroring_initial.metadata["url"], headers=_headers, params=_params, ) @@ -4816,27 +4770,29 @@ def _delete_vm_group_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_vm_group_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + _delete_port_mirroring_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } @distributed_trace - def begin_delete_vm_group( - self, resource_group_name: str, vm_group_id: str, private_cloud_name: str, **kwargs: Any + def begin_delete_port_mirroring( + self, resource_group_name: str, port_mirroring_id: str, private_cloud_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a vm group by id in a private cloud workload network. - - Delete a vm group by id in a private cloud workload network. + """Delete a WorkloadNetworkPortMirroring. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param vm_group_id: NSX VM Group identifier. Generally the same as the VM Group's display name. - Required. - :type vm_group_id: str + :param port_mirroring_id: ID of the NSX port mirroring profile. Required. + :type port_mirroring_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -4860,9 +4816,9 @@ def begin_delete_vm_group( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_vm_group_initial( # type: ignore + raw_result = self._delete_port_mirroring_initial( # type: ignore resource_group_name=resource_group_name, - vm_group_id=vm_group_id, + port_mirroring_id=port_mirroring_id, private_cloud_name=private_cloud_name, api_version=api_version, cls=lambda x, y, z: x, @@ -4877,7 +4833,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4891,17 +4849,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_vm_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + begin_delete_port_mirroring.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" } @distributed_trace - def list_virtual_machines( + def list_public_i_ps( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> Iterable["_models.WorkloadNetworkVirtualMachine"]: - """List of virtual machines in a private cloud workload network. - - List of virtual machines in a private cloud workload network. + ) -> Iterable["_models.WorkloadNetworkPublicIP"]: + """List WorkloadNetworkPublicIP resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4909,16 +4865,16 @@ def list_virtual_machines( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkVirtualMachine or the result of + :return: An iterator like instance of either WorkloadNetworkPublicIP or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkVirtualMachinesList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkPublicIPListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4931,12 +4887,12 @@ def list_virtual_machines( def prepare_request(next_link=None): if not next_link: - request = build_list_virtual_machines_request( + request = build_list_public_i_ps_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_virtual_machines.metadata["url"], + template_url=self.list_public_i_ps.metadata["url"], headers=_headers, params=_params, ) @@ -4962,7 +4918,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkVirtualMachinesList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPublicIPListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -4986,28 +4942,26 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_virtual_machines.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines" + list_public_i_ps.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs" } @distributed_trace - def get_virtual_machine( - self, resource_group_name: str, private_cloud_name: str, virtual_machine_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkVirtualMachine: - """Get a virtual machine by id in a private cloud workload network. - - Get a virtual machine by id in a private cloud workload network. + def get_public_ip( + self, resource_group_name: str, private_cloud_name: str, public_ip_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkPublicIP: + """Get a WorkloadNetworkPublicIP. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param virtual_machine_id: Virtual Machine identifier. Required. - :type virtual_machine_id: str + :param public_ip_id: ID of the DNS zone. Required. + :type public_ip_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkVirtualMachine or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine + :return: WorkloadNetworkPublicIP or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -5022,15 +4976,15 @@ def get_virtual_machine( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkVirtualMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) - request = build_get_virtual_machine_request( + request = build_get_public_ip_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - virtual_machine_id=virtual_machine_id, + public_ip_id=public_ip_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_virtual_machine.metadata["url"], + template_url=self.get_public_ip.metadata["url"], headers=_headers, params=_params, ) @@ -5049,42 +5003,25 @@ def get_virtual_machine( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkVirtualMachine", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_virtual_machine.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}" + get_public_ip.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" } - @distributed_trace - def list_dns_services( - self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> Iterable["_models.WorkloadNetworkDnsService"]: - """List of DNS services in a private cloud workload network. - - List of DNS services in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkDnsService or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDnsService] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDnsServicesList] = kwargs.pop("cls", None) - + def _create_public_ip_initial( + self, + resource_group_name: str, + private_cloud_name: str, + public_ip_id: str, + workload_network_public_ip: Union[_models.WorkloadNetworkPublicIP, IO], + **kwargs: Any + ) -> _models.WorkloadNetworkPublicIP: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5093,238 +5030,89 @@ def list_dns_services( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - request = build_list_dns_services_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_dns_services.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(workload_network_public_ip, (IOBase, bytes)): + _content = workload_network_public_ip + else: + _json = self._serialize.body(workload_network_public_ip, "WorkloadNetworkPublicIP") - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsServicesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + request = build_create_public_ip_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + public_ip_id=public_ip_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_public_ip_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - def get_next(next_link=None): - request = prepare_request(next_link) + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_dns_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices" - } - - @distributed_trace - def get_dns_service( - self, resource_group_name: str, private_cloud_name: str, dns_service_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkDnsService: - """Get a DNS service by id in a private cloud workload network. - - Get a DNS service by id in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkDnsService or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsService - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) - - request = build_get_dns_service_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - dns_service_id=dns_service_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_dns_service.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_dns_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" - } - - def _create_dns_service_initial( - self, - resource_group_name: str, - private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], - **kwargs: Any - ) -> _models.WorkloadNetworkDnsService: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(workload_network_dns_service, (IOBase, bytes)): - _content = workload_network_dns_service - else: - _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsService") - - request = build_create_dns_service_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - dns_service_id=dns_service_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_dns_service_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_dns_service_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + _create_public_ip_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" } @overload - def begin_create_dns_service( + def begin_create_public_ip( self, resource_group_name: str, private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: _models.WorkloadNetworkDnsService, + public_ip_id: str, + workload_network_public_ip: _models.WorkloadNetworkPublicIP, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsService]: - """Create a DNS service by id in a private cloud workload network. - - Create a DNS service by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkPublicIP]: + """Create a WorkloadNetworkPublicIP. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Required. - :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService + :param public_ip_id: ID of the DNS zone. Required. + :type public_ip_id: str + :param workload_network_public_ip: Resource create parameters. Required. + :type workload_network_public_ip: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5336,37 +5124,34 @@ def begin_create_dns_service( :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 WorkloadNetworkDnsService or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] + :return: An instance of LROPoller that returns either WorkloadNetworkPublicIP or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_dns_service( + def begin_create_public_ip( self, resource_group_name: str, private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: IO, + public_ip_id: str, + workload_network_public_ip: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsService]: - """Create a DNS service by id in a private cloud workload network. - - Create a DNS service by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkPublicIP]: + """Create a WorkloadNetworkPublicIP. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Required. - :type workload_network_dns_service: IO + :param public_ip_id: ID of the DNS zone. Required. + :type public_ip_id: str + :param workload_network_public_ip: Resource create parameters. Required. + :type workload_network_public_ip: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5378,36 +5163,33 @@ def begin_create_dns_service( :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 WorkloadNetworkDnsService or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] + :return: An instance of LROPoller that returns either WorkloadNetworkPublicIP or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_dns_service( + def begin_create_public_ip( self, resource_group_name: str, private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], + public_ip_id: str, + workload_network_public_ip: Union[_models.WorkloadNetworkPublicIP, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsService]: - """Create a DNS service by id in a private cloud workload network. - - Create a DNS service by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkPublicIP]: + """Create a WorkloadNetworkPublicIP. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Is either a WorkloadNetworkDnsService - type or a IO type. Required. - :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or IO + :param public_ip_id: ID of the DNS zone. Required. + :type public_ip_id: str + :param workload_network_public_ip: Resource create parameters. Is either a + WorkloadNetworkPublicIP type or a IO type. Required. + :type workload_network_public_ip: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -5419,9 +5201,9 @@ def begin_create_dns_service( :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 WorkloadNetworkDnsService or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] + :return: An instance of LROPoller that returns either WorkloadNetworkPublicIP or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5429,16 +5211,16 @@ def begin_create_dns_service( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_dns_service_initial( + raw_result = self._create_public_ip_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_service_id=dns_service_id, - workload_network_dns_service=workload_network_dns_service, + public_ip_id=public_ip_id, + workload_network_public_ip=workload_network_public_ip, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -5449,13 +5231,15 @@ def begin_create_dns_service( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5469,18 +5253,13 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_dns_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + begin_create_public_ip.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" } - def _update_dns_service_initial( - self, - resource_group_name: str, - private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], - **kwargs: Any - ) -> Optional[_models.WorkloadNetworkDnsService]: + def _delete_public_ip_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, public_ip_id: str, private_cloud_name: str, **kwargs: Any + ) -> None: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5489,31 +5268,19 @@ def _update_dns_service_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkDnsService]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(workload_network_dns_service, (IOBase, bytes)): - _content = workload_network_dns_service - else: - _json = self._serialize.body(workload_network_dns_service, "WorkloadNetworkDnsService") + cls: ClsType[None] = kwargs.pop("cls", None) - request = build_update_dns_service_request( + request = build_delete_public_ip_request( resource_group_name=resource_group_name, + public_ip_id=public_ip_id, private_cloud_name=private_cloud_name, - dns_service_id=dns_service_id, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_dns_service_initial.metadata["url"], + template_url=self._delete_public_ip_initial.metadata["url"], headers=_headers, params=_params, ) @@ -5527,260 +5294,34 @@ def _update_dns_service_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, None, response_headers) - _update_dns_service_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" - } - - @overload - def begin_update_dns_service( - self, - resource_group_name: str, - private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: _models.WorkloadNetworkDnsService, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsService]: - """Create or update a DNS service by id in a private cloud workload network. - - Create or update a DNS service by id in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Required. - :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: 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: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either WorkloadNetworkDnsService or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_dns_service( - self, - resource_group_name: str, - private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsService]: - """Create or update a DNS service by id in a private cloud workload network. - - Create or update a DNS service by id in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Required. - :type workload_network_dns_service: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: 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: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either WorkloadNetworkDnsService or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_dns_service( - self, - resource_group_name: str, - private_cloud_name: str, - dns_service_id: str, - workload_network_dns_service: Union[_models.WorkloadNetworkDnsService, IO], - **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsService]: - """Create or update a DNS service by id in a private cloud workload network. - - Create or update a DNS service by id in a private cloud workload network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_cloud_name: Name of the private cloud. Required. - :type private_cloud_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str - :param workload_network_dns_service: NSX DNS Service. Is either a WorkloadNetworkDnsService - type or a IO type. Required. - :type workload_network_dns_service: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either WorkloadNetworkDnsService or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsService] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_dns_service_initial( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - dns_service_id=dns_service_id, - workload_network_dns_service=workload_network_dns_service, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsService", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, 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, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_dns_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" - } - - def _delete_dns_service_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, dns_service_id: str, private_cloud_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_dns_service_request( - resource_group_name=resource_group_name, - dns_service_id=dns_service_id, - private_cloud_name=private_cloud_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_dns_service_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_dns_service_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + _delete_public_ip_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" } @distributed_trace - def begin_delete_dns_service( - self, resource_group_name: str, dns_service_id: str, private_cloud_name: str, **kwargs: Any + def begin_delete_public_ip( + self, resource_group_name: str, public_ip_id: str, private_cloud_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a DNS service by id in a private cloud workload network. - - Delete a DNS service by id in a private cloud workload network. + """Delete a WorkloadNetworkPublicIP. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param dns_service_id: NSX DNS Service identifier. Generally the same as the DNS Service's - display name. Required. - :type dns_service_id: str + :param public_ip_id: ID of the DNS zone. Required. + :type public_ip_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -5804,9 +5345,9 @@ def begin_delete_dns_service( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_dns_service_initial( # type: ignore + raw_result = self._delete_public_ip_initial( # type: ignore resource_group_name=resource_group_name, - dns_service_id=dns_service_id, + public_ip_id=public_ip_id, private_cloud_name=private_cloud_name, api_version=api_version, cls=lambda x, y, z: x, @@ -5821,7 +5362,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5835,17 +5378,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_dns_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + begin_delete_public_ip.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" } @distributed_trace - def list_dns_zones( + def list_segments( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> Iterable["_models.WorkloadNetworkDnsZone"]: - """List of DNS zones in a private cloud workload network. - - List of DNS zones in a private cloud workload network. + ) -> Iterable["_models.WorkloadNetworkSegment"]: + """List WorkloadNetworkSegment resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5853,16 +5394,16 @@ def list_dns_zones( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkDnsZone or the result of + :return: An iterator like instance of either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDnsZonesList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkSegmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -5875,12 +5416,12 @@ def list_dns_zones( def prepare_request(next_link=None): if not next_link: - request = build_list_dns_zones_request( + request = build_list_segments_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_dns_zones.metadata["url"], + template_url=self.list_segments.metadata["url"], headers=_headers, params=_params, ) @@ -5906,7 +5447,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsZonesList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegmentListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -5930,29 +5471,26 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_dns_zones.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones" + list_segments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments" } @distributed_trace - def get_dns_zone( - self, resource_group_name: str, private_cloud_name: str, dns_zone_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkDnsZone: - """Get a DNS zone by id in a private cloud workload network. - - Get a DNS zone by id in a private cloud workload network. + def get_segment( + self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkSegment: + """Get a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkDnsZone or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone + :return: WorkloadNetworkSegment or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkSegment :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -5967,15 +5505,15 @@ def get_dns_zone( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) - request = build_get_dns_zone_request( + request = build_get_segment_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_zone_id=dns_zone_id, + segment_id=segment_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_dns_zone.metadata["url"], + template_url=self.get_segment.metadata["url"], headers=_headers, params=_params, ) @@ -5994,25 +5532,25 @@ def get_dns_zone( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dns_zone.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + get_segment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } - def _create_dns_zone_initial( + def _create_segments_initial( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], + segment_id: str, + workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], **kwargs: Any - ) -> _models.WorkloadNetworkDnsZone: + ) -> _models.WorkloadNetworkSegment: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6026,26 +5564,26 @@ def _create_dns_zone_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_zone, (IOBase, bytes)): - _content = workload_network_dns_zone + if isinstance(workload_network_segment, (IOBase, bytes)): + _content = workload_network_segment else: - _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZone") + _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegment") - request = build_create_dns_zone_request( + request = build_create_segments_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_zone_id=dns_zone_id, + segment_id=segment_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._create_dns_zone_initial.metadata["url"], + template_url=self._create_segments_initial.metadata["url"], headers=_headers, params=_params, ) @@ -6064,46 +5602,46 @@ def _create_dns_zone_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - _create_dns_zone_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + _create_segments_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } @overload - def begin_create_dns_zone( + def begin_create_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: _models.WorkloadNetworkDnsZone, + segment_id: str, + workload_network_segment: _models.WorkloadNetworkSegment, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsZone]: - """Create a DNS zone by id in a private cloud workload network. - - Create a DNS zone by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkSegment]: + """Create a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Required. - :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: Resource create parameters. Required. + :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6115,37 +5653,34 @@ def begin_create_dns_zone( :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 WorkloadNetworkDnsZone or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_dns_zone( + def begin_create_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: IO, + segment_id: str, + workload_network_segment: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsZone]: - """Create a DNS zone by id in a private cloud workload network. - - Create a DNS zone by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkSegment]: + """Create a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Required. - :type workload_network_dns_zone: IO + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: Resource create parameters. Required. + :type workload_network_segment: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6157,36 +5692,33 @@ def begin_create_dns_zone( :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 WorkloadNetworkDnsZone or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_dns_zone( + def begin_create_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], + segment_id: str, + workload_network_segment: Union[_models.WorkloadNetworkSegment, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsZone]: - """Create a DNS zone by id in a private cloud workload network. - - Create a DNS zone by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkSegment]: + """Create a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Is either a WorkloadNetworkDnsZone type or a IO - type. Required. - :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or IO + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: Resource create parameters. Is either a WorkloadNetworkSegment + type or a IO type. Required. + :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegment or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -6198,9 +5730,9 @@ def begin_create_dns_zone( :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 WorkloadNetworkDnsZone or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6208,16 +5740,16 @@ def begin_create_dns_zone( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_dns_zone_initial( + raw_result = self._create_segments_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_zone_id=dns_zone_id, - workload_network_dns_zone=workload_network_dns_zone, + segment_id=segment_id, + workload_network_segment=workload_network_segment, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -6228,13 +5760,15 @@ def begin_create_dns_zone( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6248,18 +5782,18 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_dns_zone.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + begin_create_segments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } - def _update_dns_zone_initial( + def _update_segments_initial( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], + segment_id: str, + workload_network_segment: Union[_models.WorkloadNetworkSegmentUpdate, IO], **kwargs: Any - ) -> Optional[_models.WorkloadNetworkDnsZone]: + ) -> Optional[_models.WorkloadNetworkSegment]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6273,26 +5807,26 @@ def _update_dns_zone_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.WorkloadNetworkDnsZone]] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkSegment]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_dns_zone, (IOBase, bytes)): - _content = workload_network_dns_zone + if isinstance(workload_network_segment, (IOBase, bytes)): + _content = workload_network_segment else: - _json = self._serialize.body(workload_network_dns_zone, "WorkloadNetworkDnsZone") + _json = self._serialize.body(workload_network_segment, "WorkloadNetworkSegmentUpdate") - request = build_update_dns_zone_request( + request = build_update_segments_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_zone_id=dns_zone_id, + segment_id=segment_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._update_dns_zone_initial.metadata["url"], + template_url=self._update_segments_initial.metadata["url"], headers=_headers, params=_params, ) @@ -6312,43 +5846,45 @@ def _update_dns_zone_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) + + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_dns_zone_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + _update_segments_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } @overload - def begin_update_dns_zone( + def begin_update_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: _models.WorkloadNetworkDnsZone, + segment_id: str, + workload_network_segment: _models.WorkloadNetworkSegmentUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsZone]: - """Create or update a DNS zone by id in a private cloud workload network. - - Create or update a DNS zone by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkSegment]: + """Update a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Required. - :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: The resource properties to be updated. Required. + :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegmentUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6360,37 +5896,34 @@ def begin_update_dns_zone( :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 WorkloadNetworkDnsZone or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_dns_zone( + def begin_update_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: IO, + segment_id: str, + workload_network_segment: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsZone]: - """Create or update a DNS zone by id in a private cloud workload network. - - Create or update a DNS zone by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkSegment]: + """Update a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Required. - :type workload_network_dns_zone: IO + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: The resource properties to be updated. Required. + :type workload_network_segment: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6402,36 +5935,33 @@ def begin_update_dns_zone( :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 WorkloadNetworkDnsZone or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update_dns_zone( + def begin_update_segments( self, resource_group_name: str, private_cloud_name: str, - dns_zone_id: str, - workload_network_dns_zone: Union[_models.WorkloadNetworkDnsZone, IO], + segment_id: str, + workload_network_segment: Union[_models.WorkloadNetworkSegmentUpdate, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkDnsZone]: - """Create or update a DNS zone by id in a private cloud workload network. - - Create or update a DNS zone by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkSegment]: + """Update a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str - :param workload_network_dns_zone: NSX DNS Zone. Is either a WorkloadNetworkDnsZone type or a IO - type. Required. - :type workload_network_dns_zone: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or IO + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: str + :param workload_network_segment: The resource properties to be updated. Is either a + WorkloadNetworkSegmentUpdate type or a IO type. Required. + :type workload_network_segment: ~azure.mgmt.avs.models.WorkloadNetworkSegmentUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -6443,9 +5973,9 @@ def begin_update_dns_zone( :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 WorkloadNetworkDnsZone or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkSegment or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6453,16 +5983,16 @@ def begin_update_dns_zone( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkDnsZone] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkSegment] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_dns_zone_initial( + raw_result = self._update_segments_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - dns_zone_id=dns_zone_id, - workload_network_dns_zone=workload_network_dns_zone, + segment_id=segment_id, + workload_network_segment=workload_network_segment, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -6473,13 +6003,15 @@ def begin_update_dns_zone( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkDnsZone", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkSegment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6493,12 +6025,12 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_dns_zone.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + begin_update_segments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } - def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, dns_zone_id: str, private_cloud_name: str, **kwargs: Any + def _delete_segment_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -6514,13 +6046,13 @@ def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_dns_zone_request( + request = build_delete_segment_request( resource_group_name=resource_group_name, - dns_zone_id=dns_zone_id, private_cloud_name=private_cloud_name, + segment_id=segment_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_dns_zone_initial.metadata["url"], + template_url=self._delete_segment_initial.metadata["url"], headers=_headers, params=_params, ) @@ -6539,29 +6071,31 @@ def _delete_dns_zone_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_dns_zone_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + _delete_segment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } @distributed_trace - def begin_delete_dns_zone( - self, resource_group_name: str, dns_zone_id: str, private_cloud_name: str, **kwargs: Any + def begin_delete_segment( + self, resource_group_name: str, private_cloud_name: str, segment_id: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a DNS zone by id in a private cloud workload network. - - Delete a DNS zone by id in a private cloud workload network. + """Delete a WorkloadNetworkSegment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param dns_zone_id: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. - Required. - :type dns_zone_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str + :param segment_id: The ID of the NSX Segment. Required. + :type segment_id: 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: By default, your polling method will be ARMPolling. Pass in False for this @@ -6583,10 +6117,10 @@ def begin_delete_dns_zone( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_dns_zone_initial( # type: ignore + raw_result = self._delete_segment_initial( # type: ignore resource_group_name=resource_group_name, - dns_zone_id=dns_zone_id, private_cloud_name=private_cloud_name, + segment_id=segment_id, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -6600,7 +6134,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6614,17 +6150,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_dns_zone.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + begin_delete_segment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" } @distributed_trace - def list_public_i_ps( + def list_virtual_machines( self, resource_group_name: str, private_cloud_name: str, **kwargs: Any - ) -> Iterable["_models.WorkloadNetworkPublicIP"]: - """List of Public IP Blocks in a private cloud workload network. - - List of Public IP Blocks in a private cloud workload network. + ) -> Iterable["_models.WorkloadNetworkVirtualMachine"]: + """List WorkloadNetworkVirtualMachine resources by WorkloadNetwork. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -6632,16 +6166,16 @@ def list_public_i_ps( :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkloadNetworkPublicIP or the result of + :return: An iterator like instance of either WorkloadNetworkVirtualMachine or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkPublicIPsList] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkVirtualMachineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -6654,12 +6188,12 @@ def list_public_i_ps( def prepare_request(next_link=None): if not next_link: - request = build_list_public_i_ps_request( + request = build_list_virtual_machines_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_public_i_ps.metadata["url"], + template_url=self.list_virtual_machines.metadata["url"], headers=_headers, params=_params, ) @@ -6685,7 +6219,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkPublicIPsList", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkVirtualMachineListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -6709,89 +6243,490 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_public_i_ps.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs" + list_virtual_machines.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines" } @distributed_trace - def get_public_ip( - self, resource_group_name: str, private_cloud_name: str, public_ip_id: str, **kwargs: Any - ) -> _models.WorkloadNetworkPublicIP: - """Get a Public IP Block by id in a private cloud workload network. - - Get a Public IP Block by id in a private cloud workload network. + def get_virtual_machine( + self, resource_group_name: str, private_cloud_name: str, virtual_machine_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkVirtualMachine: + """Get a WorkloadNetworkVirtualMachine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param virtual_machine_id: ID of the virtual machine. Required. + :type virtual_machine_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkloadNetworkVirtualMachine or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetworkVirtualMachine] = kwargs.pop("cls", None) + + request = build_get_virtual_machine_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + virtual_machine_id=virtual_machine_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_virtual_machine.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WorkloadNetworkVirtualMachine", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_virtual_machine.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}" + } + + @distributed_trace + def list_vm_groups( + self, resource_group_name: str, private_cloud_name: str, **kwargs: Any + ) -> Iterable["_models.WorkloadNetworkVMGroup"]: + """List WorkloadNetworkVMGroup resources by WorkloadNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkloadNetworkVMGroup or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetworkVMGroupListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_vm_groups_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_vm_groups.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("WorkloadNetworkVMGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_vm_groups.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups" + } + + @distributed_trace + def get_vm_group( + self, resource_group_name: str, private_cloud_name: str, vm_group_id: str, **kwargs: Any + ) -> _models.WorkloadNetworkVMGroup: + """Get a WorkloadNetworkVMGroup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkloadNetworkVMGroup or the result of cls(response) + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + + request = build_get_vm_group_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + vm_group_id=vm_group_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_vm_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_vm_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + } + + def _create_vm_group_initial( + self, + resource_group_name: str, + private_cloud_name: str, + vm_group_id: str, + workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], + **kwargs: Any + ) -> _models.WorkloadNetworkVMGroup: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(workload_network_vm_group, (IOBase, bytes)): + _content = workload_network_vm_group + else: + _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroup") + + request = build_create_vm_group_request( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + vm_group_id=vm_group_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_vm_group_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + _create_vm_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + } + + @overload + def begin_create_vm_group( + self, + resource_group_name: str, + private_cloud_name: str, + vm_group_id: str, + workload_network_vm_group: _models.WorkloadNetworkVMGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.WorkloadNetworkVMGroup]: + """Create a WorkloadNetworkVMGroup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: Resource create parameters. Required. + :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: 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: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either WorkloadNetworkVMGroup or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_vm_group( + self, + resource_group_name: str, + private_cloud_name: str, + vm_group_id: str, + workload_network_vm_group: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.WorkloadNetworkVMGroup]: + """Create a WorkloadNetworkVMGroup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. Required. + :type private_cloud_name: str + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: Resource create parameters. Required. + :type workload_network_vm_group: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: 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: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either WorkloadNetworkVMGroup or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_vm_group( + self, + resource_group_name: str, + private_cloud_name: str, + vm_group_id: str, + workload_network_vm_group: Union[_models.WorkloadNetworkVMGroup, IO], + **kwargs: Any + ) -> LROPoller[_models.WorkloadNetworkVMGroup]: + """Create a WorkloadNetworkVMGroup. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP - Block's display name. Required. - :type public_ip_id: str + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: Resource create parameters. Is either a + WorkloadNetworkVMGroup type or a IO type. Required. + :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkloadNetworkPublicIP or the result of cls(response) - :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either WorkloadNetworkVMGroup or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) - - request = build_get_public_ip_request( - resource_group_name=resource_group_name, - private_cloud_name=private_cloud_name, - public_ip_id=public_ip_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_public_ip.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_vm_group_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + vm_group_id=vm_group_id, + workload_network_vm_group=workload_network_vm_group, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) - if cls: - return cls(pipeline_response, deserialized, {}) + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized - return deserialized + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - get_public_ip.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + begin_create_vm_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" } - def _create_public_ip_initial( + def _update_vm_group_initial( self, resource_group_name: str, private_cloud_name: str, - public_ip_id: str, - workload_network_public_ip: Union[_models.WorkloadNetworkPublicIP, IO], + vm_group_id: str, + workload_network_vm_group: Union[_models.WorkloadNetworkVMGroupUpdate, IO], **kwargs: Any - ) -> _models.WorkloadNetworkPublicIP: + ) -> Optional[_models.WorkloadNetworkVMGroup]: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6805,26 +6740,26 @@ def _create_public_ip_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.WorkloadNetworkVMGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workload_network_public_ip, (IOBase, bytes)): - _content = workload_network_public_ip + if isinstance(workload_network_vm_group, (IOBase, bytes)): + _content = workload_network_vm_group else: - _json = self._serialize.body(workload_network_public_ip, "WorkloadNetworkPublicIP") + _json = self._serialize.body(workload_network_vm_group, "WorkloadNetworkVMGroupUpdate") - request = build_create_public_ip_request( + request = build_update_vm_group_request( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - public_ip_id=public_ip_id, + vm_group_id=vm_group_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self._create_public_ip_initial.metadata["url"], + template_url=self._update_vm_group_initial.metadata["url"], headers=_headers, params=_params, ) @@ -6838,51 +6773,51 @@ def _create_public_ip_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) - if response.status_code == 201: - deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) - return deserialized # type: ignore + return deserialized - _create_public_ip_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + _update_vm_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" } @overload - def begin_create_public_ip( + def begin_update_vm_group( self, resource_group_name: str, private_cloud_name: str, - public_ip_id: str, - workload_network_public_ip: _models.WorkloadNetworkPublicIP, + vm_group_id: str, + workload_network_vm_group: _models.WorkloadNetworkVMGroupUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkPublicIP]: - """Create a Public IP Block by id in a private cloud workload network. - - Create a Public IP Block by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkVMGroup]: + """Update a WorkloadNetworkVMGroup. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP - Block's display name. Required. - :type public_ip_id: str - :param workload_network_public_ip: NSX Public IP Block. Required. - :type workload_network_public_ip: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: The resource properties to be updated. Required. + :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroupUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6894,37 +6829,34 @@ def begin_create_public_ip( :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 WorkloadNetworkPublicIP or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkVMGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_public_ip( + def begin_update_vm_group( self, resource_group_name: str, private_cloud_name: str, - public_ip_id: str, - workload_network_public_ip: IO, + vm_group_id: str, + workload_network_vm_group: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkPublicIP]: - """Create a Public IP Block by id in a private cloud workload network. - - Create a Public IP Block by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkVMGroup]: + """Update a WorkloadNetworkVMGroup. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP - Block's display name. Required. - :type public_ip_id: str - :param workload_network_public_ip: NSX Public IP Block. Required. - :type workload_network_public_ip: IO + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: The resource properties to be updated. Required. + :type workload_network_vm_group: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6936,36 +6868,33 @@ def begin_create_public_ip( :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 WorkloadNetworkPublicIP or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkVMGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_public_ip( + def begin_update_vm_group( self, resource_group_name: str, private_cloud_name: str, - public_ip_id: str, - workload_network_public_ip: Union[_models.WorkloadNetworkPublicIP, IO], + vm_group_id: str, + workload_network_vm_group: Union[_models.WorkloadNetworkVMGroupUpdate, IO], **kwargs: Any - ) -> LROPoller[_models.WorkloadNetworkPublicIP]: - """Create a Public IP Block by id in a private cloud workload network. - - Create a Public IP Block by id in a private cloud workload network. + ) -> LROPoller[_models.WorkloadNetworkVMGroup]: + """Update a WorkloadNetworkVMGroup. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str - :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP - Block's display name. Required. - :type public_ip_id: str - :param workload_network_public_ip: NSX Public IP Block. Is either a WorkloadNetworkPublicIP - type or a IO type. Required. - :type workload_network_public_ip: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP or IO + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str + :param workload_network_vm_group: The resource properties to be updated. Is either a + WorkloadNetworkVMGroupUpdate type or a IO type. Required. + :type workload_network_vm_group: ~azure.mgmt.avs.models.WorkloadNetworkVMGroupUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -6977,9 +6906,9 @@ def begin_create_public_ip( :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 WorkloadNetworkPublicIP or the result of + :return: An instance of LROPoller that returns either WorkloadNetworkVMGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6987,16 +6916,16 @@ def begin_create_public_ip( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadNetworkPublicIP] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkloadNetworkVMGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_public_ip_initial( + raw_result = self._update_vm_group_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - public_ip_id=public_ip_id, - workload_network_public_ip=workload_network_public_ip, + vm_group_id=vm_group_id, + workload_network_vm_group=workload_network_vm_group, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -7007,13 +6936,15 @@ def begin_create_public_ip( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadNetworkPublicIP", pipeline_response) + deserialized = self._deserialize("WorkloadNetworkVMGroup", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -7027,12 +6958,12 @@ def get_long_running_output(pipeline_response): ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_public_ip.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + begin_update_vm_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" } - def _delete_public_ip_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, public_ip_id: str, private_cloud_name: str, **kwargs: Any + def _delete_vm_group_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, vm_group_id: str, private_cloud_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -7048,13 +6979,13 @@ def _delete_public_ip_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_public_ip_request( + request = build_delete_vm_group_request( resource_group_name=resource_group_name, - public_ip_id=public_ip_id, + vm_group_id=vm_group_id, private_cloud_name=private_cloud_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_public_ip_initial.metadata["url"], + template_url=self._delete_vm_group_initial.metadata["url"], headers=_headers, params=_params, ) @@ -7073,27 +7004,29 @@ def _delete_public_ip_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - _delete_public_ip_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + _delete_vm_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" } @distributed_trace - def begin_delete_public_ip( - self, resource_group_name: str, public_ip_id: str, private_cloud_name: str, **kwargs: Any + def begin_delete_vm_group( + self, resource_group_name: str, vm_group_id: str, private_cloud_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a Public IP Block by id in a private cloud workload network. - - Delete a Public IP Block by id in a private cloud workload network. + """Delete a WorkloadNetworkVMGroup. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param public_ip_id: NSX Public IP Block identifier. Generally the same as the Public IP - Block's display name. Required. - :type public_ip_id: str + :param vm_group_id: ID of the VM group. Required. + :type vm_group_id: str :param private_cloud_name: Name of the private cloud. Required. :type private_cloud_name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -7117,9 +7050,9 @@ def begin_delete_public_ip( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_public_ip_initial( # type: ignore + raw_result = self._delete_vm_group_initial( # type: ignore resource_group_name=resource_group_name, - public_ip_id=public_ip_id, + vm_group_id=vm_group_id, private_cloud_name=private_cloud_name, api_version=api_version, cls=lambda x, y, z: x, @@ -7134,7 +7067,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -7148,6 +7083,6 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_public_ip.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + begin_delete_vm_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" } diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py index 3f9a9dae8f25..4f933d95f65b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_arc_reg.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_ArcReg.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_ArcReg.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py index a5b3efa36e7b..630afac266aa 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_hcx.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_HCX.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_HCX.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py index cd4d7867a856..8ad63115eb6e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_srm.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_SRM.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_SRM.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py index dad255dffa65..12daccb00758 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_create_or_update_vr.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_VR.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_VR.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py index 7ffff0eabeb3..c688bc9824b6 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py index 71fbac432c15..0e844cd3aab8 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_arc_reg.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_ArcReg.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_ArcReg.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py index 98d89aeb1a48..db74aa9b9acd 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_hcx.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_HCX.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_HCX.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py index bfda9f69266e..a28bbfdaae4c 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_srm.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_SRM.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_SRM.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py index a151b43acb11..41859c908b5b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_get_vr.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_VR.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_VR.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py index eea6094762dd..d0638e995f51 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/addons_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py index 583598a6514c..b9794ace5a77 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Authorizations_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py index f1ac08eb888c..25bb80290e39 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Authorizations_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py index 1fb518c92152..d423e5ac26ed 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/authorizations_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Authorizations_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py index 8f7987fce884..d3cce4509365 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_create_or_update.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py index 28a16d80be2f..dd4ca09c9493 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py index 2a5d24083fd3..d529efa0ebd4 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py index e5f1a46deed4..fcafa5767be7 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/cloud_links_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py index 121e47d60426..75b1a24764e3 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py index d93c34a7aa5b..62d8322b0006 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py index 2f615c9ee17f..f4e81abe9089 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py index befc375cd66d..b3748133181b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py index 1cbdc61e74e1..874a49fb2717 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_ListZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_ListZones.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py index d2310f861b44..07e52d0fd72f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_list_zones_stretched.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_ListZones_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_ListZones_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py index fa0a1af04342..49f4f2f0c45e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/clusters_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_Update.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Update.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py index 9fa167c87668..8a6dbe250aaf 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_create_or_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py index 522e25448fb8..a4f4cfc6d950 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py index 58180a226483..8dc795b8b280 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py index 70195e098e9b..7f2f9da5fc84 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/datastores_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py index e9690072c9c8..07bdab6b0f0c 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_create_or_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py index ad04cecf90ce..9296de0290dd 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py index a2639a316106..48d4f42fd892 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py index 7d9a3af24bb0..7cbefa328d54 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/global_reach_connections_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py index 77e55eac556b..2e82b450cc4b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_delete.py @@ -36,6 +36,6 @@ def main(): ) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/HcxEnterpriseSites_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py index 2b2c0c790ab2..54b0b5ac564d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/HcxEnterpriseSites_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py index b9f2d84f9d11..4e59a8c763ac 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/hcx_enterprise_sites_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/HcxEnterpriseSites_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_create_or_update.py new file mode 100644 index 000000000000..e5ff40133cfc --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_create_or_update.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python iscsi_paths_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.iscsi_paths.begin_create_or_update( + resource_group_name="group1", + private_cloud_name="cloud1", + resource={"properties": {"networkBlock": "192.168.0.0/24"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_delete.py new file mode 100644 index 000000000000..8c622fa4d1cc --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_delete.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python iscsi_paths_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.iscsi_paths.begin_delete( + resource_group_name="group1", + private_cloud_name="cloud1", + ).result() + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_get.py new file mode 100644 index 000000000000..919a4c7ab19c --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python iscsi_paths_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.iscsi_paths.get( + resource_group_name="group1", + private_cloud_name="cloud1", + ) + print(response) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_list.py new file mode 100644 index 000000000000..5d98a8aed08f --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/generated_samples/iscsi_paths_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.avs import AVSClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-avs +# USAGE + python iscsi_paths_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AVSClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.iscsi_paths.list_by_private_cloud( + resource_group_name="group1", + private_cloud_name="cloud1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_List.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py index 8f495af97d4f..25a542bc27ce 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_quota_availability.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Locations_CheckQuotaAvailability.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Locations_CheckQuotaAvailability.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py index 18fee98caa3d..baba32bf6e2f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Locations_CheckTrialAvailability.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Locations_CheckTrialAvailability.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py index 3dd1f0430730..a73f50912f94 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/locations_check_trial_availability_with_sku.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Locations_CheckTrialAvailabilityWithSku.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Locations_CheckTrialAvailabilityWithSku.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py index 9814ccd278ae..7d86cab1cba2 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/operations_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Operations_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py index 18ba649d6aeb..c1c3f2ac0667 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_create_or_update.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py index 222427577cbe..16d10c3931ad 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py index 5f958fa4eed2..4cf329f4b0ef 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py index 339327280b50..10e0648e1919 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py index 285880596e5b..8b4f5ef51362 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/placement_policies_update.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_Update.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Update.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py index 20dd3c7a1761..1a095abf6c40 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py index e3d66ec9cdad..b6a23f0474ab 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_create_or_update_stretched.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_CreateOrUpdate_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_CreateOrUpdate_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py index 64bcf10bd1e4..3c705a8d0cc0 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_delete.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py index 5c4756c3ca13..b4c741905880 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py index d5e74608fcf4..56c665e3acc5 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_get_stretched.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Get_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Get_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py index 1742d81a3def..fa808b3306d8 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py index c73f573f9420..c53ddeae00ea 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_admin_credentials.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_ListAdminCredentials.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListAdminCredentials.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py index 329f5550247b..06d37157f0a0 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_ListInSubscription.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListInSubscription.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py index 959b9247b337..779735219829 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_in_subscription_stretched.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_ListInSubscription_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListInSubscription_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py index 018e9bb4c740..502568eaccd8 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_list_stretched.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_List_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_List_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py index 8e5a0130bcc3..0b5db0bd6fd6 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_nsxt_password.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_RotateNsxtPassword.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_RotateNsxtPassword.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py index c0e85efaa0ca..ac8a7bd2ca40 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_rotate_vcenter_password.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_RotateVcenterPassword.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_RotateVcenterPassword.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py index 34fe1acfa655..ac66d1d75bb1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Update.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Update.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py index d26f07fafe35..0b66df112012 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/private_clouds_update_stretched.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Update_Stretched.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Update_Stretched.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py index 87fd60f87eb1..e645ef815fc2 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptCmdlets_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptCmdlets_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py index 2647a8ad06d4..99e7b4b32fff 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_cmdlets_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptCmdlets_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptCmdlets_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py index f29bcf9fd981..9781b51af583 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_create_or_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_CreateOrUpdate.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py index 352e15cd1e8a..b0706475c47b 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_Delete.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_Delete.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py index 85abfb249bef..3fa7aefdcbe9 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py index 7aa338029cdd..180aeead8f8e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_get_execution_logs.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_GetExecutionLogs.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_GetExecutionLogs.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py index c8f2debf19d1..361d0c83b20d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_executions_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py index 5a84f40dbd95..d3cedade9743 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptPackages_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptPackages_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py index acb15bbdc8e7..b6fd64a07e7d 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/script_packages_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptPackages_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptPackages_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py index dbde0e93189f..1f0710fc612e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/VirtualMachines_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py index 7d20d2ff75cd..60b26da3cac2 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/VirtualMachines_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py index 46b7f6095b12..5f822a7dc7bc 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/virtual_machines_restrict_movement.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/VirtualMachines_RestrictMovement.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_RestrictMovement.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp_configurations.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp.py similarity index 92% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp_configurations.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp.py index e64fc5e63a2c..eef9cf548d6e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp_configurations.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dhcp.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_create_dhcp_configurations.py + python workload_networks_create_dhcp.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateDhcpConfigurations.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDhcp.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_service.py similarity index 93% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_services.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_service.py index 66241173c64c..394b187deaae 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_service.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_create_dns_services.py + python workload_networks_create_dns_service.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDnsService.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zone.py similarity index 93% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zones.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zone.py index 6bf48554d91d..51115d7fb30f 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_dns_zone.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_create_dns_zones.py + python workload_networks_create_dns_zone.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDnsZone.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring_profiles.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring.py similarity index 92% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring_profiles.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring.py index e7a677b0c6dd..7e23b6cfe7c4 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring_profiles.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_port_mirroring.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_create_port_mirroring_profiles.py + python workload_networks_create_port_mirroring.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreatePortMirroringProfiles.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreatePortMirroring.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py index a5533302bdb8..2ea3c212e9f6 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_segments.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_vm_groups.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_vm_group.py similarity index 93% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_vm_groups.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_vm_group.py index 97ec4a11354a..62ed218c1c95 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_vm_groups.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_create_vm_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_create_vm_groups.py + python workload_networks_create_vm_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateVMGroups.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateVMGroup.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp_configurations.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp.py similarity index 90% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp_configurations.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp.py index e609dad697aa..bbeabf571400 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp_configurations.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dhcp.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_delete_dhcp_configurations.py + python workload_networks_delete_dhcp.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteDhcpConfigurations.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDhcp.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_service.py similarity index 91% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_services.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_service.py index b02f950ed69b..815766138845 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_service.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_delete_dns_services.py + python workload_networks_delete_dns_service.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDnsService.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zone.py similarity index 92% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zones.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zone.py index e7bbfe237915..b572792f5607 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_dns_zone.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_delete_dns_zones.py + python workload_networks_delete_dns_zone.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDnsZone.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring_profiles.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring.py similarity index 90% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring_profiles.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring.py index ef77220dfe28..bb59f9f501e1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring_profiles.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_port_mirroring.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_delete_port_mirroring_profiles.py + python workload_networks_delete_port_mirroring.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeletePortMirroringProfiles.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeletePortMirroring.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segment.py similarity index 92% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segments.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segment.py index bb3144e51b7e..ac548d07c3f1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_segment.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_delete_segments.py + python workload_networks_delete_segment.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteSegment.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_groups.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_group.py similarity index 92% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_groups.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_group.py index 360f811ab43d..be86ad7c6e96 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_groups.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_delete_vm_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_delete_vm_groups.py + python workload_networks_delete_vm_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteVMGroups.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteVMGroup.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py index d4bee508c162..263a164f7275 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get.py @@ -32,11 +32,10 @@ def main(): response = client.workload_networks.get( resource_group_name="group1", private_cloud_name="cloud1", - workload_network_name="default", ) print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_Get.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_Get.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp_configurations.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp.py similarity index 91% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp_configurations.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp.py index e053eb758a03..5f1ad9fd56f3 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp_configurations.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dhcp.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_get_dhcp_configurations.py + python workload_networks_get_dhcp.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetDhcpConfigurations.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDhcp.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_service.py similarity index 92% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_services.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_service.py index 865877e3f1c0..fce9391c87e1 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_service.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_get_dns_services.py + python workload_networks_get_dns_service.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDnsService.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zone.py similarity index 92% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zones.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zone.py index 9c3d86c26187..696a28a64cc3 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_dns_zone.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_get_dns_zones.py + python workload_networks_get_dns_zone.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDnsZone.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py index 8831a501a995..091b6004debf 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_gateway.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetGateway.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetGateway.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring_profiles.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring.py similarity index 91% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring_profiles.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring.py index 8d496c2438e1..9a9579be3201 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring_profiles.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_port_mirroring.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_get_port_mirroring_profiles.py + python workload_networks_get_port_mirroring.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetPortMirroringProfiles.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetPortMirroring.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segment.py similarity index 92% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segments.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segment.py index 61099130bd5f..e52567c9ff23 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_segment.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_get_segments.py + python workload_networks_get_segment.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetSegment.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py index d8ff8718d1ef..ee3b22984420 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_virtual_machine.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetVirtualMachine.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetVirtualMachine.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_groups.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_group.py similarity index 92% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_groups.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_group.py index afffc7ce7a84..4251a3862a21 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_groups.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_get_vm_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_get_vm_groups.py + python workload_networks_get_vm_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetVMGroups.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetVMGroup.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py index bc563948f204..f8310fc4d869 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_List.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_List.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp_configurations.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp.py similarity index 91% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp_configurations.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp.py index b83e642c70f4..48ff9373088a 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp_configurations.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dhcp.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_list_dhcp_configurations.py + python workload_networks_list_dhcp.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListDhcpConfigurations.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDhcp.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py index e92222ba29d8..0b9d1556dc86 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_services.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDnsServices.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py index 58293e5eda62..5fd78b559184 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_dns_zones.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDnsZones.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py index 1928d16fb290..6f773d605f4e 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_gateways.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListGateways.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListGateways.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring_profiles.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring.py similarity index 90% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring_profiles.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring.py index b8ddb568a4f7..6e635cbbbb43 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring_profiles.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_port_mirroring.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_list_port_mirroring_profiles.py + python workload_networks_list_port_mirroring.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListPortMirroringProfiles.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListPortMirroring.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py index fb3af3f5691b..b6927fa5e403 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_public_ips.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListPublicIPs.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListPublicIPs.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py index 0604b151accf..94fc02ad0b17 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_segments.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py index f34f1e20a8a7..3274c8ed50e6 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_virtual_machines.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListVirtualMachines.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListVirtualMachines.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py index 8c5d7ce91fbb..06f3c2561fc5 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_list_vm_groups.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListVMGroups.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListVMGroups.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp_configurations.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp.py similarity index 91% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp_configurations.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp.py index 8e4a93b5ab0e..4cc5a429d33c 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp_configurations.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dhcp.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_update_dhcp_configurations.py + python workload_networks_update_dhcp.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateDhcpConfigurations.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDhcp.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_services.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_service.py similarity index 93% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_services.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_service.py index 8e1a57120a5f..41e4496e6e80 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_services.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_service.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_update_dns_services.py + python workload_networks_update_dns_service.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateDnsServices.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDnsService.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zones.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zone.py similarity index 93% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zones.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zone.py index b6eee6037b5c..c2a32a1b2ee9 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zones.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_dns_zone.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_update_dns_zones.py + python workload_networks_update_dns_zone.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateDnsZones.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDnsZone.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring_profiles.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring.py similarity index 91% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring_profiles.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring.py index 2b061f61e1d0..2675673bf9e8 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring_profiles.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_port_mirroring.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_update_port_mirroring_profiles.py + python workload_networks_update_port_mirroring.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdatePortMirroringProfiles.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdatePortMirroring.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py index 40851c0f9d7e..01595f9f5866 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_segments.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateSegments.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateSegments.json if __name__ == "__main__": main() diff --git a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_vm_groups.py b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_vm_group.py similarity index 92% rename from sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_vm_groups.py rename to sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_vm_group.py index f203352c5a2c..502048e95f94 100644 --- a/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_vm_groups.py +++ b/sdk/compute/azure-mgmt-avs/generated_samples/workload_networks_update_vm_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-avs # USAGE - python workload_networks_update_vm_groups.py + python workload_networks_update_vm_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateVMGroups.json +# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateVMGroup.json if __name__ == "__main__": main()