diff --git a/sdk/compute/azure-mgmt-avs/_meta.json b/sdk/compute/azure-mgmt-avs/_meta.json index b325856a4a38..75c27aca5c9d 100644 --- a/sdk/compute/azure-mgmt-avs/_meta.json +++ b/sdk/compute/azure-mgmt-avs/_meta.json @@ -1,11 +1,11 @@ { "autorest": "3.4.5", "use": [ - "@autorest/python@5.8.3", + "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "b91af17cf7e5d480dec66f50fa96b2e2f13a83f0", + "commit": "cec8ffe4ec5ab6f8c18371a8b8af4b5ec4159bf2", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/vmware/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.3 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "autorest_command": "autorest specification/vmware/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "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 60ff0e7759ad..26d2b7070316 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 @@ -30,6 +30,8 @@ from .operations import WorkloadNetworksOperations from .operations import CloudLinksOperations from .operations import AddonsOperations +from .operations import VirtualMachinesOperations +from .operations import PlacementPoliciesOperations from .operations import ScriptPackagesOperations from .operations import ScriptCmdletsOperations from .operations import ScriptExecutionsOperations @@ -61,6 +63,10 @@ class AVSClient(object): :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 placement_policies: PlacementPoliciesOperations operations + :vartype placement_policies: azure.mgmt.avs.operations.PlacementPoliciesOperations :ivar script_packages: ScriptPackagesOperations operations :vartype script_packages: azure.mgmt.avs.operations.ScriptPackagesOperations :ivar script_cmdlets: ScriptCmdletsOperations operations @@ -115,6 +121,10 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.addons = AddonsOperations( self._client, self._config, self._serialize, self._deserialize) + self.virtual_machines = VirtualMachinesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.placement_policies = PlacementPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) self.script_packages = ScriptPackagesOperations( self._client, self._config, self._serialize, self._deserialize) self.script_cmdlets = ScriptCmdletsOperations( 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 345b679841e1..89bb55be8f92 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-avs/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_metadata.json b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_metadata.json index d9558b9e4d7b..06d19041cc08 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_metadata.json +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2021-06-01", - "total_api_version_list": ["2021-06-01"], + "chosen_version": "2021-12-01", + "total_api_version_list": ["2021-12-01"], "client": { "name": "AVSClient", "filename": "_avs_client", @@ -109,6 +109,8 @@ "workload_networks": "WorkloadNetworksOperations", "cloud_links": "CloudLinksOperations", "addons": "AddonsOperations", + "virtual_machines": "VirtualMachinesOperations", + "placement_policies": "PlacementPoliciesOperations", "script_packages": "ScriptPackagesOperations", "script_cmdlets": "ScriptCmdletsOperations", "script_executions": "ScriptExecutionsOperations" 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 efe7276fe05f..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 = "7.0.0b1" +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 f1bfa9858a3e..05eb5e11d5ee 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 @@ -28,6 +28,8 @@ from .operations import WorkloadNetworksOperations from .operations import CloudLinksOperations from .operations import AddonsOperations +from .operations import VirtualMachinesOperations +from .operations import PlacementPoliciesOperations from .operations import ScriptPackagesOperations from .operations import ScriptCmdletsOperations from .operations import ScriptExecutionsOperations @@ -59,6 +61,10 @@ class AVSClient(object): :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 script_packages: ScriptPackagesOperations operations :vartype script_packages: azure.mgmt.avs.aio.operations.ScriptPackagesOperations :ivar script_cmdlets: ScriptCmdletsOperations operations @@ -112,6 +118,10 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.addons = AddonsOperations( self._client, self._config, self._serialize, self._deserialize) + self.virtual_machines = VirtualMachinesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.placement_policies = PlacementPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) self.script_packages = ScriptPackagesOperations( self._client, self._config, self._serialize, self._deserialize) self.script_cmdlets = ScriptCmdletsOperations( 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 09d731cb67d0..7337376a2a03 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 @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-avs/{}'.format(VERSION)) self._configure(**kwargs) 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 1e3c208eb0fd..d60908801950 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 @@ -17,6 +17,8 @@ from ._workload_networks_operations import WorkloadNetworksOperations from ._cloud_links_operations import CloudLinksOperations from ._addons_operations import AddonsOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._placement_policies_operations import PlacementPoliciesOperations from ._script_packages_operations import ScriptPackagesOperations from ._script_cmdlets_operations import ScriptCmdletsOperations from ._script_executions_operations import ScriptExecutionsOperations @@ -33,6 +35,8 @@ 'WorkloadNetworksOperations', 'CloudLinksOperations', 'AddonsOperations', + 'VirtualMachinesOperations', + 'PlacementPoliciesOperations', 'ScriptPackagesOperations', 'ScriptCmdletsOperations', 'ScriptExecutionsOperations', 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 b3eaa90e1d57..e28ecff2dc74 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 @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -332,7 +332,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 311015cbd555..c4a94c95e750 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 @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -332,7 +332,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 0d2f8e306586..42f494bd9cbe 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 @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -332,7 +332,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 0336fd404ecf..07eb94fe5269 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,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -333,7 +333,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -469,7 +469,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 1cd53a810f81..45419a8075ca 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 @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -153,7 +153,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -205,7 +205,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -348,7 +348,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 62ce3f6e96d7..901567d59c4a 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 @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -332,7 +332,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 6f81584264cc..3b651916242e 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 @@ -65,7 +65,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -144,7 +144,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -211,7 +211,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -284,7 +284,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 5c986b562a41..74aba316ee8e 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 @@ -59,7 +59,7 @@ async def check_trial_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -113,7 +113,7 @@ async def check_quota_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 145fb53b90b6..40f77ebfb3e7 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 @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): 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 new file mode 100644 index 000000000000..aa54a3b239f0 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_placement_policies_operations.py @@ -0,0 +1,608 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PlacementPoliciesOperations: + """PlacementPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.avs.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PlacementPoliciesList"]: + """List placement policies in a private cloud cluster. + + List placement policies in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :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 PlacementPoliciesList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.PlacementPoliciesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPoliciesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PlacementPoliciesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies'} # type: ignore + + async def get( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + 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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) + placement policy. + :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) + :rtype: ~azure.mgmt.avs.models.PlacementPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + placement_policy_name: str, + placement_policy: "_models.PlacementPolicy", + **kwargs: Any + ) -> "_models.PlacementPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(placement_policy, 'PlacementPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + placement_policy_name: str, + placement_policy: "_models.PlacementPolicy", + **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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) + placement policy. + :type placement_policy_name: str + :param placement_policy: A placement policy in the private cloud cluster. + :type placement_policy: ~azure.mgmt.avs.models.PlacementPolicy + :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 PlacementPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.PlacementPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + placement_policy_name=placement_policy_name, + placement_policy=placement_policy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + placement_policy_name: str, + placement_policy_update: "_models.PlacementPolicyUpdate", + **kwargs: Any + ) -> "_models.PlacementPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(placement_policy_update, 'PlacementPolicyUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + placement_policy_name: str, + placement_policy_update: "_models.PlacementPolicyUpdate", + **kwargs: Any + ) -> AsyncLROPoller["_models.PlacementPolicy"]: + """Update a placement policy in a private cloud cluster. + + Update a placement policy in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) + placement policy. + :type placement_policy_name: str + :param placement_policy_update: The placement policy properties that may be updated. + :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate + :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 PlacementPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.avs.models.PlacementPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + placement_policy_name=placement_policy_name, + placement_policy_update=placement_policy_update, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + placement_policy_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + 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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) + placement policy. + :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. + :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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + placement_policy_name=placement_policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore 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 bae1a2dc123c..ba1ad880549f 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 @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -133,7 +133,7 @@ def list_in_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -207,7 +207,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -255,7 +255,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -385,7 +385,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -514,7 +514,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -624,7 +624,7 @@ async def _rotate_vcenter_password_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -734,7 +734,7 @@ async def _rotate_nsxt_password_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -857,7 +857,7 @@ async def list_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 ae5ac31e9c2e..77dd7139bf2b 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 @@ -48,8 +48,8 @@ def list( script_package_name: str, **kwargs: Any ) -> AsyncIterable["_models.ScriptCmdletsList"]: - """Return script cmdlet resources available for a private cloud to create a script execution - resource on their Private Cloud. + """List script cmdlet resources available for a private cloud to create a script execution + resource on a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -149,7 +149,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 d932b084aed5..1b309004b286 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 @@ -49,9 +49,9 @@ def list( private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.ScriptExecutionsList"]: - """Get an script execution resource by name in a private cloud. + """List script executions in a private cloud. - Get an script execution resource by name in a private cloud. + List script executions in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -126,9 +126,9 @@ async def get( script_execution_name: str, **kwargs: Any ) -> "_models.ScriptExecution": - """Get an script execution resource by name in a private cloud. + """Get an script execution by name in a private cloud. - Get an script execution resource by name in a private cloud. + Get an script execution by name in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -146,7 +146,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -250,9 +250,9 @@ async def begin_create_or_update( script_execution: "_models.ScriptExecution", **kwargs: Any ) -> AsyncLROPoller["_models.ScriptExecution"]: - """Create or update a script execution resource in a private cloud. + """Create or update a script execution in a private cloud. - Create or update a script execution resource in a private cloud. + Create or update a script execution in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -332,7 +332,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -466,7 +466,7 @@ async def get_execution_logs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" 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 899811dc9ab0..375eeb676519 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 @@ -47,7 +47,7 @@ def list( private_cloud_name: str, **kwargs: Any ) -> AsyncIterable["_models.ScriptPackagesList"]: - """Return script packages available for a private cloud to run on their Private Cloud. + """List script packages available to run on the private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -63,7 +63,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -122,7 +122,7 @@ async def get( script_package_name: str, **kwargs: Any ) -> "_models.ScriptPackage": - """Return script package available to run on an Private Cloud. + """Get a script package available to run on a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -140,7 +140,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 new file mode 100644 index 000000000000..f61947d9bef8 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/aio/operations/_virtual_machines_operations.py @@ -0,0 +1,327 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachinesOperations: + """VirtualMachinesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.avs.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.VirtualMachinesList"]: + """List of virtual machines in a private cloud cluster. + + List of virtual machines in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :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 VirtualMachinesList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.avs.models.VirtualMachinesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachinesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualMachinesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines'} # type: ignore + + async def get( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + 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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param virtual_machine_id: Virtual Machine identifier. + :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) + :rtype: ~azure.mgmt.avs.models.VirtualMachine + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'virtualMachineId': self._serialize.url("virtual_machine_id", virtual_machine_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}'} # type: ignore + + async def _restrict_movement_initial( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + virtual_machine_id: str, + restrict_movement: "_models.VirtualMachineRestrictMovement", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restrict_movement_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'virtualMachineId': self._serialize.url("virtual_machine_id", virtual_machine_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restrict_movement, 'VirtualMachineRestrictMovement') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restrict_movement_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement'} # type: ignore + + async def begin_restrict_movement( + self, + resource_group_name: str, + private_cloud_name: str, + cluster_name: str, + virtual_machine_id: str, + restrict_movement: "_models.VirtualMachineRestrictMovement", + **kwargs: Any + ) -> 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. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param virtual_machine_id: Virtual Machine identifier. + :type virtual_machine_id: str + :param restrict_movement: Whether VM DRS-driven movement is restricted (Enabled) or not + (Disabled). + :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement + :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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restrict_movement_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + virtual_machine_id=virtual_machine_id, + restrict_movement=restrict_movement, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'virtualMachineId': self._serialize.url("virtual_machine_id", virtual_machine_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restrict_movement.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement'} # type: ignore 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 72af28577588..82b59135d38c 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 @@ -67,7 +67,7 @@ def list_segments( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ async def get_segment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def _create_segments_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -333,7 +333,7 @@ async def _update_segments_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -467,7 +467,7 @@ async def _delete_segment_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -596,7 +596,7 @@ def list_dhcp( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -675,7 +675,7 @@ async def get_dhcp( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -725,7 +725,7 @@ async def _create_dhcp_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -862,7 +862,7 @@ async def _update_dhcp_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -996,7 +996,7 @@ async def _delete_dhcp_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -1125,7 +1125,7 @@ def list_gateways( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -1204,7 +1204,7 @@ async def get_gateway( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -1265,7 +1265,7 @@ def list_port_mirroring( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -1345,7 +1345,7 @@ async def get_port_mirroring( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -1395,7 +1395,7 @@ async def _create_port_mirroring_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1533,7 +1533,7 @@ async def _update_port_mirroring_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1668,7 +1668,7 @@ async def _delete_port_mirroring_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -1798,7 +1798,7 @@ def list_vm_groups( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -1877,7 +1877,7 @@ async def get_vm_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -1927,7 +1927,7 @@ async def _create_vm_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2064,7 +2064,7 @@ async def _update_vm_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2198,7 +2198,7 @@ async def _delete_vm_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -2327,7 +2327,7 @@ def list_virtual_machines( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -2406,7 +2406,7 @@ async def get_virtual_machine( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -2467,7 +2467,7 @@ def list_dns_services( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -2547,7 +2547,7 @@ async def get_dns_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -2597,7 +2597,7 @@ async def _create_dns_service_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2735,7 +2735,7 @@ async def _update_dns_service_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2870,7 +2870,7 @@ async def _delete_dns_service_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -3000,7 +3000,7 @@ def list_dns_zones( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -3079,7 +3079,7 @@ async def get_dns_zone( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -3129,7 +3129,7 @@ async def _create_dns_zone_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -3266,7 +3266,7 @@ async def _update_dns_zone_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -3400,7 +3400,7 @@ async def _delete_dns_zone_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -3529,7 +3529,7 @@ def list_public_i_ps( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -3609,7 +3609,7 @@ async def get_public_ip( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -3659,7 +3659,7 @@ async def _create_public_ip_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -3796,7 +3796,7 @@ async def _delete_public_ip_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 819b169fecff..7ec2a63b7e5b 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 @@ -14,6 +14,7 @@ from ._models_py3 import AddonSrmProperties from ._models_py3 import AddonVrProperties from ._models_py3 import AdminCredentials + from ._models_py3 import AvailabilityProperties from ._models_py3 import Circuit from ._models_py3 import CloudLink from ._models_py3 import CloudLinkList @@ -25,6 +26,8 @@ from ._models_py3 import Datastore from ._models_py3 import DatastoreList from ._models_py3 import DiskPoolVolume + from ._models_py3 import Encryption + from ._models_py3 import EncryptionKeyVaultProperties from ._models_py3 import Endpoints from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorResponse @@ -45,7 +48,12 @@ from ._models_py3 import OperationList from ._models_py3 import OperationProperties from ._models_py3 import PSCredentialExecutionParameter + from ._models_py3 import PlacementPoliciesList + from ._models_py3 import PlacementPolicy + 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 PrivateCloudUpdate @@ -67,6 +75,11 @@ from ._models_py3 import Sku from ._models_py3 import TrackedResource from ._models_py3 import Trial + from ._models_py3 import VirtualMachine + from ._models_py3 import VirtualMachineRestrictMovement + from ._models_py3 import VirtualMachinesList + from ._models_py3 import VmHostPlacementPolicyProperties + from ._models_py3 import VmPlacementPolicyProperties from ._models_py3 import WorkloadNetworkDhcp from ._models_py3 import WorkloadNetworkDhcpEntity from ._models_py3 import WorkloadNetworkDhcpList @@ -98,6 +111,7 @@ from ._models import AddonSrmProperties # type: ignore from ._models import AddonVrProperties # type: ignore from ._models import AdminCredentials # type: ignore + from ._models import AvailabilityProperties # type: ignore from ._models import Circuit # type: ignore from ._models import CloudLink # type: ignore from ._models import CloudLinkList # type: ignore @@ -109,6 +123,8 @@ from ._models import Datastore # type: ignore from ._models import DatastoreList # type: ignore from ._models import DiskPoolVolume # type: ignore + from ._models import Encryption # type: ignore + from ._models import EncryptionKeyVaultProperties # type: ignore from ._models import Endpoints # type: ignore from ._models import ErrorAdditionalInfo # type: ignore from ._models import ErrorResponse # type: ignore @@ -129,7 +145,12 @@ from ._models import OperationList # type: ignore from ._models import OperationProperties # type: ignore from ._models import PSCredentialExecutionParameter # type: ignore + from ._models import PlacementPoliciesList # type: ignore + from ._models import PlacementPolicy # type: ignore + from ._models import PlacementPolicyProperties # type: ignore + from ._models import PlacementPolicyUpdate # type: ignore from ._models import PrivateCloud # type: ignore + from ._models import PrivateCloudIdentity # type: ignore from ._models import PrivateCloudList # type: ignore from ._models import PrivateCloudProperties # type: ignore from ._models import PrivateCloudUpdate # type: ignore @@ -151,6 +172,11 @@ from ._models import Sku # type: ignore from ._models import TrackedResource # type: ignore from ._models import Trial # type: ignore + from ._models import VirtualMachine # type: ignore + from ._models import VirtualMachineRestrictMovement # type: ignore + from ._models import VirtualMachinesList # type: ignore + from ._models import VmHostPlacementPolicyProperties # type: ignore + from ._models import VmPlacementPolicyProperties # type: ignore from ._models import WorkloadNetworkDhcp # type: ignore from ._models import WorkloadNetworkDhcpEntity # type: ignore from ._models import WorkloadNetworkDhcpList # type: ignore @@ -178,12 +204,18 @@ from ._avs_client_enums import ( AddonProvisioningState, AddonType, + AffinityType, + AvailabilityStrategy, CloudLinkStatus, ClusterProvisioningState, DatastoreProvisioningState, + DatastoreStatus, DhcpTypeEnum, DnsServiceLogLevelEnum, DnsServiceStatusEnum, + EncryptionKeyStatus, + EncryptionState, + EncryptionVersionType, ExpressRouteAuthorizationProvisioningState, GlobalReachConnectionProvisioningState, GlobalReachConnectionStatus, @@ -191,10 +223,14 @@ InternetEnum, MountOptionEnum, OptionalParamEnum, + PlacementPolicyProvisioningState, + PlacementPolicyState, + PlacementPolicyType, PortMirroringDirectionEnum, PortMirroringStatusEnum, PrivateCloudProvisioningState, QuotaEnabled, + ResourceIdentityType, ScriptExecutionParameterType, ScriptExecutionProvisioningState, ScriptOutputStreamType, @@ -204,6 +240,7 @@ TrialStatus, VMGroupStatusEnum, VMTypeEnum, + VirtualMachineRestrictMovementState, VisibilityParameterEnum, WorkloadNetworkDhcpProvisioningState, WorkloadNetworkDnsServiceProvisioningState, @@ -222,6 +259,7 @@ 'AddonSrmProperties', 'AddonVrProperties', 'AdminCredentials', + 'AvailabilityProperties', 'Circuit', 'CloudLink', 'CloudLinkList', @@ -233,6 +271,8 @@ 'Datastore', 'DatastoreList', 'DiskPoolVolume', + 'Encryption', + 'EncryptionKeyVaultProperties', 'Endpoints', 'ErrorAdditionalInfo', 'ErrorResponse', @@ -253,7 +293,12 @@ 'OperationList', 'OperationProperties', 'PSCredentialExecutionParameter', + 'PlacementPoliciesList', + 'PlacementPolicy', + 'PlacementPolicyProperties', + 'PlacementPolicyUpdate', 'PrivateCloud', + 'PrivateCloudIdentity', 'PrivateCloudList', 'PrivateCloudProperties', 'PrivateCloudUpdate', @@ -275,6 +320,11 @@ 'Sku', 'TrackedResource', 'Trial', + 'VirtualMachine', + 'VirtualMachineRestrictMovement', + 'VirtualMachinesList', + 'VmHostPlacementPolicyProperties', + 'VmPlacementPolicyProperties', 'WorkloadNetworkDhcp', 'WorkloadNetworkDhcpEntity', 'WorkloadNetworkDhcpList', @@ -300,12 +350,18 @@ 'WorkloadNetworkVirtualMachinesList', 'AddonProvisioningState', 'AddonType', + 'AffinityType', + 'AvailabilityStrategy', 'CloudLinkStatus', 'ClusterProvisioningState', 'DatastoreProvisioningState', + 'DatastoreStatus', 'DhcpTypeEnum', 'DnsServiceLogLevelEnum', 'DnsServiceStatusEnum', + 'EncryptionKeyStatus', + 'EncryptionState', + 'EncryptionVersionType', 'ExpressRouteAuthorizationProvisioningState', 'GlobalReachConnectionProvisioningState', 'GlobalReachConnectionStatus', @@ -313,10 +369,14 @@ 'InternetEnum', 'MountOptionEnum', 'OptionalParamEnum', + 'PlacementPolicyProvisioningState', + 'PlacementPolicyState', + 'PlacementPolicyType', 'PortMirroringDirectionEnum', 'PortMirroringStatusEnum', 'PrivateCloudProvisioningState', 'QuotaEnabled', + 'ResourceIdentityType', 'ScriptExecutionParameterType', 'ScriptExecutionProvisioningState', 'ScriptOutputStreamType', @@ -326,6 +386,7 @@ 'TrialStatus', 'VMGroupStatusEnum', 'VMTypeEnum', + 'VirtualMachineRestrictMovementState', 'VisibilityParameterEnum', 'WorkloadNetworkDhcpProvisioningState', 'WorkloadNetworkDnsServiceProvisioningState', 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 f0a7e9e57cd3..8ce01af77eca 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 @@ -45,6 +45,20 @@ class AddonType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VR = "VR" HCX = "HCX" +class AffinityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Placement policy affinity type + """ + + AFFINITY = "Affinity" + ANTI_AFFINITY = "AntiAffinity" + +class AvailabilityStrategy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The availability strategy for the private cloud + """ + + SINGLE_ZONE = "SingleZone" + DUAL_ZONE = "DualZone" + class CloudLinkStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The state of the cloud link. """ @@ -77,6 +91,18 @@ class DatastoreProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, E UPDATING = "Updating" DELETING = "Deleting" +class DatastoreStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operational status of the datastore + """ + + UNKNOWN = "Unknown" + ACCESSIBLE = "Accessible" + INACCESSIBLE = "Inaccessible" + ATTACHED = "Attached" + DETACHED = "Detached" + LOST_COMMUNICATION = "LostCommunication" + DEAD_OR_ERROR = "DeadOrError" + class DhcpTypeEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Type of DHCP: SERVER or RELAY. """ @@ -101,6 +127,27 @@ class DnsServiceStatusEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SUCCESS = "SUCCESS" FAILURE = "FAILURE" +class EncryptionKeyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The state of key provided + """ + + CONNECTED = "Connected" + ACCESS_DENIED = "AccessDenied" + +class EncryptionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of customer managed encryption key + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class EncryptionVersionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Property of the key if user provided or auto detected + """ + + FIXED = "Fixed" + AUTO_DETECTED = "AutoDetected" + class ExpressRouteAuthorizationProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The state of the ExpressRoute Circuit Authorization provisioning """ @@ -155,17 +202,44 @@ class OptionalParamEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): OPTIONAL = "Optional" REQUIRED = "Required" +class PlacementPolicyProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The provisioning state + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + BUILDING = "Building" + DELETING = "Deleting" + UPDATING = "Updating" + +class PlacementPolicyState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether the placement policy is enabled or disabled + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class PlacementPolicyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """placement policy type + """ + + VM_VM = "VmVm" + VM_HOST = "VmHost" + class PortMirroringDirectionEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Direction of port mirroring profile. """ - INGRESS_EGRESS_BIDIRECTIONAL = "INGRESS, EGRESS, BIDIRECTIONAL" + INGRESS = "INGRESS" + EGRESS = "EGRESS" + BIDIRECTIONAL = "BIDIRECTIONAL" class PortMirroringStatusEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Port Mirroring Status. """ - SUCCESS_FAILURE = "SUCCESS, FAILURE" + SUCCESS = "SUCCESS" + FAILURE = "FAILURE" class PrivateCloudProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state @@ -186,6 +260,14 @@ class QuotaEnabled(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ENABLED = "Enabled" DISABLED = "Disabled" +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """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. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" + class ScriptExecutionParameterType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of execution parameter """ @@ -228,7 +310,8 @@ class SegmentStatusEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Segment status. """ - SUCCESS_FAILURE = "SUCCESS, FAILURE" + SUCCESS = "SUCCESS" + FAILURE = "FAILURE" class SslEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Protect LDAP communication using SSL certificate (LDAPS) @@ -245,6 +328,13 @@ class TrialStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): TRIAL_USED = "TrialUsed" TRIAL_DISABLED = "TrialDisabled" +class VirtualMachineRestrictMovementState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether VM DRS-driven movement is restricted (enabled) or not (disabled) + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + class VisibilityParameterEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Should this parameter be visible to arm and passed in the parameters argument when executing """ @@ -256,13 +346,16 @@ class VMGroupStatusEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """VM Group status. """ - SUCCESS_FAILURE = "SUCCESS, FAILURE" + SUCCESS = "SUCCESS" + FAILURE = "FAILURE" class VMTypeEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Virtual machine type. """ - REGULAR_EDGE_SERVICE = "REGULAR, EDGE, SERVICE" + REGULAR = "REGULAR" + EDGE = "EDGE" + SERVICE = "SERVICE" class WorkloadNetworkDhcpProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py index f3f816b35a72..d5a57dcf7e33 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py @@ -202,14 +202,13 @@ class AddonSrmProperties(AddonProperties): :ivar provisioning_state: The state of the addon provisioning. Possible values include: "Succeeded", "Failed", "Cancelled", "Building", "Deleting", "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.AddonProvisioningState - :param license_key: Required. The Site Recovery Manager (SRM) license. + :param license_key: The Site Recovery Manager (SRM) license. :type license_key: str """ _validation = { 'addon_type': {'required': True}, 'provisioning_state': {'readonly': True}, - 'license_key': {'required': True}, } _attribute_map = { @@ -224,7 +223,7 @@ def __init__( ): super(AddonSrmProperties, self).__init__(**kwargs) self.addon_type = 'SRM' # type: str - self.license_key = kwargs['license_key'] + self.license_key = kwargs.get('license_key', None) class AddonVrProperties(AddonProperties): @@ -305,6 +304,34 @@ def __init__( self.vcenter_password = None +class AvailabilityProperties(msrest.serialization.Model): + """The properties describing private cloud availability zone distribution. + + :param strategy: The availability strategy for the private cloud. Possible values include: + "SingleZone", "DualZone". + :type strategy: str or ~azure.mgmt.avs.models.AvailabilityStrategy + :param zone: The primary availability zone for the private cloud. + :type zone: int + :param secondary_zone: The secondary availability zone for the private cloud. + :type secondary_zone: int + """ + + _attribute_map = { + 'strategy': {'key': 'strategy', 'type': 'str'}, + 'zone': {'key': 'zone', 'type': 'int'}, + 'secondary_zone': {'key': 'secondaryZone', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailabilityProperties, self).__init__(**kwargs) + self.strategy = kwargs.get('strategy', None) + self.zone = kwargs.get('zone', None) + self.secondary_zone = kwargs.get('secondary_zone', None) + + class Circuit(msrest.serialization.Model): """An ExpressRoute Circuit. @@ -439,8 +466,8 @@ class Cluster(Resource): :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] + :param hosts: The hosts. + :type hosts: list[str] """ _validation = { @@ -450,7 +477,6 @@ class Cluster(Resource): 'sku': {'required': True}, 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -473,7 +499,7 @@ def __init__( self.cluster_size = kwargs.get('cluster_size', None) self.provisioning_state = None self.cluster_id = None - self.hosts = None + self.hosts = kwargs.get('hosts', None) class ClusterList(msrest.serialization.Model): @@ -518,14 +544,13 @@ class CommonClusterProperties(msrest.serialization.Model): :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] + :param hosts: The hosts. + :type hosts: list[str] """ _validation = { 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -543,7 +568,7 @@ def __init__( self.cluster_size = kwargs.get('cluster_size', None) self.provisioning_state = None self.cluster_id = None - self.hosts = None + self.hosts = kwargs.get('hosts', None) class ClusterProperties(CommonClusterProperties): @@ -558,14 +583,13 @@ class ClusterProperties(CommonClusterProperties): :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] + :param hosts: The hosts. + :type hosts: list[str] """ _validation = { 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -587,10 +611,13 @@ class ClusterUpdate(msrest.serialization.Model): :param cluster_size: The cluster size. :type cluster_size: int + :param hosts: The hosts. + :type hosts: list[str] """ _attribute_map = { 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[str]'}, } def __init__( @@ -599,6 +626,7 @@ def __init__( ): super(ClusterUpdate, self).__init__(**kwargs) self.cluster_size = kwargs.get('cluster_size', None) + self.hosts = kwargs.get('hosts', None) class Datastore(Resource): @@ -619,6 +647,9 @@ class Datastore(Resource): :type net_app_volume: ~azure.mgmt.avs.models.NetAppVolume :param disk_pool_volume: An iSCSI volume. :type disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume + :ivar status: The operational status of the datastore. Possible values include: "Unknown", + "Accessible", "Inaccessible", "Attached", "Detached", "LostCommunication", "DeadOrError". + :vartype status: str or ~azure.mgmt.avs.models.DatastoreStatus """ _validation = { @@ -626,6 +657,7 @@ class Datastore(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { @@ -635,6 +667,7 @@ class Datastore(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'net_app_volume': {'key': 'properties.netAppVolume', 'type': 'NetAppVolume'}, 'disk_pool_volume': {'key': 'properties.diskPoolVolume', 'type': 'DiskPoolVolume'}, + 'status': {'key': 'properties.status', 'type': 'str'}, } def __init__( @@ -645,6 +678,7 @@ def __init__( self.provisioning_state = None self.net_app_volume = kwargs.get('net_app_volume', None) self.disk_pool_volume = kwargs.get('disk_pool_volume', None) + self.status = None class DatastoreList(msrest.serialization.Model): @@ -719,6 +753,74 @@ def __init__( self.path = None +class Encryption(msrest.serialization.Model): + """The properties of customer managed encryption key. + + :param status: Status of customer managed encryption key. Possible values include: "Enabled", + "Disabled". + :type status: str or ~azure.mgmt.avs.models.EncryptionState + :param key_vault_properties: The key vault where the encryption key is stored. + :type key_vault_properties: ~azure.mgmt.avs.models.EncryptionKeyVaultProperties + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionKeyVaultProperties(msrest.serialization.Model): + """An Encryption Key. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_name: The name of the key. + :type key_name: str + :param key_version: The version of the key. + :type key_version: str + :param key_vault_url: The URL of the vault. + :type key_vault_url: str + :ivar key_state: The state of key provided. Possible values include: "Connected", + "AccessDenied". + :vartype key_state: str or ~azure.mgmt.avs.models.EncryptionKeyStatus + :ivar version_type: Property of the key if user provided or auto detected. Possible values + include: "Fixed", "AutoDetected". + :vartype version_type: str or ~azure.mgmt.avs.models.EncryptionVersionType + """ + + _validation = { + 'key_state': {'readonly': True}, + 'version_type': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + 'key_vault_url': {'key': 'keyVaultUrl', 'type': 'str'}, + 'key_state': {'key': 'keyState', 'type': 'str'}, + 'version_type': {'key': 'versionType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionKeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_url = kwargs.get('key_vault_url', None) + self.key_state = None + self.version_type = None + + class Endpoints(msrest.serialization.Model): """Endpoint addresses. @@ -848,6 +950,8 @@ class ExpressRouteAuthorization(Resource): :vartype express_route_authorization_id: str :ivar express_route_authorization_key: The key of the ExpressRoute Circuit Authorization. :vartype express_route_authorization_key: str + :param express_route_id: The ID of the ExpressRoute Circuit. + :type express_route_id: str """ _validation = { @@ -866,6 +970,7 @@ class ExpressRouteAuthorization(Resource): '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'}, + 'express_route_id': {'key': 'properties.expressRouteId', 'type': 'str'}, } def __init__( @@ -876,6 +981,7 @@ def __init__( self.provisioning_state = None self.express_route_authorization_id = None self.express_route_authorization_key = None + self.express_route_id = kwargs.get('express_route_id', None) class ExpressRouteAuthorizationList(msrest.serialization.Model): @@ -935,6 +1041,9 @@ class GlobalReachConnection(Resource): :param peer_express_route_circuit: Identifier of the ExpressRoute Circuit to peer with in the global reach connection. :type peer_express_route_circuit: str + :param express_route_id: The ID of the Private Cloud's ExpressRoute Circuit that is + participating in the global reach connection. + :type express_route_id: str """ _validation = { @@ -955,6 +1064,7 @@ class GlobalReachConnection(Resource): 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, 'peer_express_route_circuit': {'key': 'properties.peerExpressRouteCircuit', 'type': 'str'}, + 'express_route_id': {'key': 'properties.expressRouteId', 'type': 'str'}, } def __init__( @@ -967,6 +1077,7 @@ def __init__( self.authorization_key = kwargs.get('authorization_key', None) self.circuit_connection_status = None self.peer_express_route_circuit = kwargs.get('peer_express_route_circuit', None) + self.express_route_id = kwargs.get('express_route_id', None) class GlobalReachConnectionList(msrest.serialization.Model): @@ -1169,14 +1280,13 @@ class ManagementCluster(CommonClusterProperties): :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] + :param hosts: The hosts. + :type hosts: list[str] """ _validation = { 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -1452,6 +1562,150 @@ def __init__( self.service_specification = kwargs.get('service_specification', None) +class PlacementPoliciesList(msrest.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 + ): + super(PlacementPoliciesList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PlacementPolicy(Resource): + """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. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param properties: placement policy properties. + :type properties: ~azure.mgmt.avs.models.PlacementPolicyProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'PlacementPolicyProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(PlacementPolicy, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class PlacementPolicyProperties(msrest.serialization.Model): + """Abstract placement policy properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VmHostPlacementPolicyProperties, VmPlacementPolicyProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. placement policy type.Constant filled by server. Possible values + include: "VmVm", "VmHost". + :type type: str or ~azure.mgmt.avs.models.PlacementPolicyType + :param state: Whether the placement policy is enabled or disabled. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy. + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", + "Failed", "Building", "Deleting", "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + """ + + _validation = { + 'type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'VmHost': 'VmHostPlacementPolicyProperties', 'VmVm': 'VmPlacementPolicyProperties'} + } + + def __init__( + self, + **kwargs + ): + super(PlacementPolicyProperties, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.state = kwargs.get('state', None) + self.display_name = kwargs.get('display_name', None) + self.provisioning_state = None + + +class PlacementPolicyUpdate(msrest.serialization.Model): + """An update of a DRS placement policy resource. + + :param state: Whether the placement policy is enabled or disabled. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param vm_members: Virtual machine members list. + :type vm_members: list[str] + :param host_members: Host members list. + :type host_members: list[str] + """ + + _attribute_map = { + 'state': {'key': 'properties.state', 'type': 'str'}, + 'vm_members': {'key': 'properties.vmMembers', 'type': '[str]'}, + 'host_members': {'key': 'properties.hostMembers', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PlacementPolicyUpdate, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.vm_members = kwargs.get('vm_members', None) + self.host_members = kwargs.get('host_members', None) + + class TrackedResource(Resource): """The resource model definition for a ARM tracked top level resource. @@ -1511,6 +1765,8 @@ class PrivateCloud(TrackedResource): :type tags: dict[str, str] :param sku: Required. The private cloud SKU. :type sku: ~azure.mgmt.avs.models.Sku + :param identity: The identity of the private cloud, if configured. + :type identity: ~azure.mgmt.avs.models.PrivateCloudIdentity :param management_cluster: The default cluster used for management. :type management_cluster: ~azure.mgmt.avs.models.ManagementCluster :param internet: Connectivity to internet is enabled or disabled. Possible values include: @@ -1518,6 +1774,11 @@ class PrivateCloud(TrackedResource): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources. :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed across availability + zones. + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or disabled. + :type encryption: ~azure.mgmt.avs.models.Encryption :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", "Failed", "Cancelled", "Pending", "Building", "Deleting", "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.PrivateCloudProvisioningState @@ -1548,6 +1809,9 @@ class PrivateCloud(TrackedResource): :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] + :param secondary_circuit: A secondary expressRoute circuit from a separate AZ. Only present in + a stretched private cloud. + :type secondary_circuit: ~azure.mgmt.avs.models.Circuit """ _validation = { @@ -1572,9 +1836,12 @@ class PrivateCloud(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + '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'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, @@ -1587,6 +1854,7 @@ class PrivateCloud(TrackedResource): 'vcenter_certificate_thumbprint': {'key': 'properties.vcenterCertificateThumbprint', 'type': 'str'}, 'nsxt_certificate_thumbprint': {'key': 'properties.nsxtCertificateThumbprint', 'type': 'str'}, 'external_cloud_links': {'key': 'properties.externalCloudLinks', 'type': '[str]'}, + 'secondary_circuit': {'key': 'properties.secondaryCircuit', 'type': 'Circuit'}, } def __init__( @@ -1595,9 +1863,12 @@ def __init__( ): super(PrivateCloud, self).__init__(**kwargs) self.sku = kwargs['sku'] + self.identity = kwargs.get('identity', None) self.management_cluster = kwargs.get('management_cluster', None) self.internet = kwargs.get('internet', "Disabled") self.identity_sources = kwargs.get('identity_sources', None) + self.availability = kwargs.get('availability', None) + self.encryption = kwargs.get('encryption', None) self.provisioning_state = None self.circuit = kwargs.get('circuit', None) self.endpoints = None @@ -1610,6 +1881,45 @@ def __init__( self.vcenter_certificate_thumbprint = None self.nsxt_certificate_thumbprint = None self.external_cloud_links = None + self.secondary_circuit = kwargs.get('secondary_circuit', None) + + +class PrivateCloudIdentity(msrest.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 + :param 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. Possible values include: "SystemAssigned", "None". + :type 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, + **kwargs + ): + super(PrivateCloudIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) class PrivateCloudList(msrest.serialization.Model): @@ -1652,12 +1962,19 @@ class PrivateCloudUpdateProperties(msrest.serialization.Model): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources. :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed across availability + zones. + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or disabled. + :type encryption: ~azure.mgmt.avs.models.Encryption """ _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'}, } def __init__( @@ -1668,6 +1985,8 @@ def __init__( self.management_cluster = kwargs.get('management_cluster', None) self.internet = kwargs.get('internet', "Disabled") self.identity_sources = kwargs.get('identity_sources', None) + self.availability = kwargs.get('availability', None) + self.encryption = kwargs.get('encryption', None) class PrivateCloudProperties(PrivateCloudUpdateProperties): @@ -1684,6 +2003,11 @@ class PrivateCloudProperties(PrivateCloudUpdateProperties): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources. :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed across availability + zones. + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or disabled. + :type encryption: ~azure.mgmt.avs.models.Encryption :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", "Failed", "Cancelled", "Pending", "Building", "Deleting", "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.PrivateCloudProvisioningState @@ -1714,6 +2038,9 @@ class PrivateCloudProperties(PrivateCloudUpdateProperties): :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] + :param secondary_circuit: A secondary expressRoute circuit from a separate AZ. Only present in + a stretched private cloud. + :type secondary_circuit: ~azure.mgmt.avs.models.Circuit """ _validation = { @@ -1732,6 +2059,8 @@ class PrivateCloudProperties(PrivateCloudUpdateProperties): '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'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'circuit': {'key': 'circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'endpoints', 'type': 'Endpoints'}, @@ -1744,6 +2073,7 @@ class PrivateCloudProperties(PrivateCloudUpdateProperties): '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'}, } def __init__( @@ -1763,6 +2093,7 @@ def __init__( self.vcenter_certificate_thumbprint = None self.nsxt_certificate_thumbprint = None self.external_cloud_links = None + self.secondary_circuit = kwargs.get('secondary_circuit', None) class PrivateCloudUpdate(msrest.serialization.Model): @@ -1770,6 +2101,8 @@ class PrivateCloudUpdate(msrest.serialization.Model): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] + :param identity: The identity of the private cloud, if configured. + :type identity: ~azure.mgmt.avs.models.PrivateCloudIdentity :param management_cluster: The default cluster used for management. :type management_cluster: ~azure.mgmt.avs.models.ManagementCluster :param internet: Connectivity to internet is enabled or disabled. Possible values include: @@ -1777,13 +2110,21 @@ class PrivateCloudUpdate(msrest.serialization.Model): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources. :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed across availability + zones. + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or disabled. + :type encryption: ~azure.mgmt.avs.models.Encryption """ _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'}, } def __init__( @@ -1792,9 +2133,12 @@ def __init__( ): super(PrivateCloudUpdate, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) self.management_cluster = kwargs.get('management_cluster', None) self.internet = kwargs.get('internet', "Disabled") self.identity_sources = kwargs.get('identity_sources', None) + self.availability = kwargs.get('availability', None) + self.encryption = kwargs.get('encryption', None) class ProxyResource(Resource): @@ -2414,6 +2758,217 @@ def __init__( self.available_hosts = None +class VirtualMachine(ProxyResource): + """Virtual Machine. + + 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 VM. + :vartype display_name: str + :ivar mo_ref_id: Virtual machine managed object reference id. + :vartype mo_ref_id: str + :ivar folder_path: Path to virtual machine's folder starting from datacenter virtual machine + folder. + :vartype folder_path: str + :ivar restrict_movement: Whether VM DRS-driven movement is restricted (enabled) or not + (disabled). Possible values include: "Enabled", "Disabled". + :vartype restrict_movement: str or ~azure.mgmt.avs.models.VirtualMachineRestrictMovementState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'mo_ref_id': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'restrict_movement': {'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'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'restrict_movement': {'key': 'properties.restrictMovement', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachine, self).__init__(**kwargs) + self.display_name = None + self.mo_ref_id = None + self.folder_path = None + self.restrict_movement = None + + +class VirtualMachineRestrictMovement(msrest.serialization.Model): + """Set VM DRS-driven movement to restricted (enabled) or not (disabled). + + :param restrict_movement: Whether VM DRS-driven movement is restricted (enabled) or not + (disabled). Possible values include: "Enabled", "Disabled". + :type restrict_movement: str or ~azure.mgmt.avs.models.VirtualMachineRestrictMovementState + """ + + _attribute_map = { + 'restrict_movement': {'key': 'restrictMovement', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRestrictMovement, self).__init__(**kwargs) + self.restrict_movement = kwargs.get('restrict_movement', None) + + +class VirtualMachinesList(msrest.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 + ): + super(VirtualMachinesList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class VmHostPlacementPolicyProperties(PlacementPolicyProperties): + """VM-Host placement policy properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. placement policy type.Constant filled by server. Possible values + include: "VmVm", "VmHost". + :type type: str or ~azure.mgmt.avs.models.PlacementPolicyType + :param state: Whether the placement policy is enabled or disabled. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy. + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", + "Failed", "Building", "Deleting", "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + :param vm_members: Required. Virtual machine members list. + :type vm_members: list[str] + :param host_members: Required. Host members list. + :type host_members: list[str] + :param affinity_type: Required. placement policy affinity type. Possible values include: + "Affinity", "AntiAffinity". + :type affinity_type: str or ~azure.mgmt.avs.models.AffinityType + """ + + _validation = { + 'type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'vm_members': {'required': True}, + 'host_members': {'required': True}, + 'affinity_type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'vm_members': {'key': 'vmMembers', 'type': '[str]'}, + 'host_members': {'key': 'hostMembers', 'type': '[str]'}, + 'affinity_type': {'key': 'affinityType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VmHostPlacementPolicyProperties, self).__init__(**kwargs) + self.type = 'VmHost' # type: str + self.vm_members = kwargs['vm_members'] + self.host_members = kwargs['host_members'] + self.affinity_type = kwargs['affinity_type'] + + +class VmPlacementPolicyProperties(PlacementPolicyProperties): + """VM-VM placement policy properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. placement policy type.Constant filled by server. Possible values + include: "VmVm", "VmHost". + :type type: str or ~azure.mgmt.avs.models.PlacementPolicyType + :param state: Whether the placement policy is enabled or disabled. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy. + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", + "Failed", "Building", "Deleting", "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + :param vm_members: Required. Virtual machine members list. + :type vm_members: list[str] + :param affinity_type: Required. placement policy affinity type. Possible values include: + "Affinity", "AntiAffinity". + :type affinity_type: str or ~azure.mgmt.avs.models.AffinityType + """ + + _validation = { + 'type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'vm_members': {'required': True}, + 'affinity_type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'vm_members': {'key': 'vmMembers', 'type': '[str]'}, + 'affinity_type': {'key': 'affinityType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VmPlacementPolicyProperties, self).__init__(**kwargs) + self.type = 'VmVm' # type: str + self.vm_members = kwargs['vm_members'] + self.affinity_type = kwargs['affinity_type'] + + class WorkloadNetworkDhcp(ProxyResource): """NSX DHCP. @@ -2909,14 +3464,14 @@ class WorkloadNetworkPortMirroring(ProxyResource): :vartype type: str :param display_name: Display name of the port mirroring profile. :type display_name: str - :param direction: Direction of port mirroring profile. Possible values include: "INGRESS, - EGRESS, BIDIRECTIONAL". + :param direction: Direction of port mirroring profile. Possible values include: "INGRESS", + "EGRESS", "BIDIRECTIONAL". :type direction: str or ~azure.mgmt.avs.models.PortMirroringDirectionEnum :param source: Source VM Group. :type source: str :param destination: Destination VM Group. :type destination: str - :ivar status: Port Mirroring Status. Possible values include: "SUCCESS, FAILURE". + :ivar status: Port Mirroring Status. Possible values include: "SUCCESS", "FAILURE". :vartype status: str or ~azure.mgmt.avs.models.PortMirroringStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", "Failed", "Building", "Deleting", "Updating". @@ -3092,7 +3647,7 @@ class WorkloadNetworkSegment(ProxyResource): :type 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. Possible values include: "SUCCESS, FAILURE". + :ivar status: Segment status. Possible values include: "SUCCESS", "FAILURE". :vartype status: str or ~azure.mgmt.avs.models.SegmentStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", "Failed", "Building", "Deleting", "Updating". @@ -3223,7 +3778,7 @@ class WorkloadNetworkVirtualMachine(ProxyResource): :vartype type: str :param display_name: Display name of the VM. :type display_name: str - :ivar vm_type: Virtual machine type. Possible values include: "REGULAR, EDGE, SERVICE". + :ivar vm_type: Virtual machine type. Possible values include: "REGULAR", "EDGE", "SERVICE". :vartype vm_type: str or ~azure.mgmt.avs.models.VMTypeEnum """ @@ -3296,7 +3851,7 @@ class WorkloadNetworkVMGroup(ProxyResource): :type display_name: str :param members: Virtual machine members of this group. :type members: list[str] - :ivar status: VM Group status. Possible values include: "SUCCESS, FAILURE". + :ivar status: VM Group status. Possible values include: "SUCCESS", "FAILURE". :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", "Failed", "Building", "Deleting", "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 68f82c05b3fe..792e14146f7f 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 @@ -210,14 +210,13 @@ class AddonSrmProperties(AddonProperties): :ivar provisioning_state: The state of the addon provisioning. Possible values include: "Succeeded", "Failed", "Cancelled", "Building", "Deleting", "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.AddonProvisioningState - :param license_key: Required. The Site Recovery Manager (SRM) license. + :param license_key: The Site Recovery Manager (SRM) license. :type license_key: str """ _validation = { 'addon_type': {'required': True}, 'provisioning_state': {'readonly': True}, - 'license_key': {'required': True}, } _attribute_map = { @@ -229,7 +228,7 @@ class AddonSrmProperties(AddonProperties): def __init__( self, *, - license_key: str, + license_key: Optional[str] = None, **kwargs ): super(AddonSrmProperties, self).__init__(**kwargs) @@ -317,6 +316,38 @@ def __init__( self.vcenter_password = None +class AvailabilityProperties(msrest.serialization.Model): + """The properties describing private cloud availability zone distribution. + + :param strategy: The availability strategy for the private cloud. Possible values include: + "SingleZone", "DualZone". + :type strategy: str or ~azure.mgmt.avs.models.AvailabilityStrategy + :param zone: The primary availability zone for the private cloud. + :type zone: int + :param secondary_zone: The secondary availability zone for the private cloud. + :type secondary_zone: int + """ + + _attribute_map = { + 'strategy': {'key': 'strategy', 'type': 'str'}, + 'zone': {'key': 'zone', 'type': 'int'}, + 'secondary_zone': {'key': 'secondaryZone', 'type': 'int'}, + } + + def __init__( + self, + *, + strategy: Optional[Union[str, "AvailabilityStrategy"]] = None, + zone: Optional[int] = None, + secondary_zone: Optional[int] = None, + **kwargs + ): + super(AvailabilityProperties, self).__init__(**kwargs) + self.strategy = strategy + self.zone = zone + self.secondary_zone = secondary_zone + + class Circuit(msrest.serialization.Model): """An ExpressRoute Circuit. @@ -453,8 +484,8 @@ class Cluster(Resource): :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] + :param hosts: The hosts. + :type hosts: list[str] """ _validation = { @@ -464,7 +495,6 @@ class Cluster(Resource): 'sku': {'required': True}, 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -483,6 +513,7 @@ def __init__( *, sku: "Sku", cluster_size: Optional[int] = None, + hosts: Optional[List[str]] = None, **kwargs ): super(Cluster, self).__init__(**kwargs) @@ -490,7 +521,7 @@ def __init__( self.cluster_size = cluster_size self.provisioning_state = None self.cluster_id = None - self.hosts = None + self.hosts = hosts class ClusterList(msrest.serialization.Model): @@ -535,14 +566,13 @@ class CommonClusterProperties(msrest.serialization.Model): :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] + :param hosts: The hosts. + :type hosts: list[str] """ _validation = { 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -556,13 +586,14 @@ def __init__( self, *, cluster_size: Optional[int] = None, + hosts: Optional[List[str]] = None, **kwargs ): super(CommonClusterProperties, self).__init__(**kwargs) self.cluster_size = cluster_size self.provisioning_state = None self.cluster_id = None - self.hosts = None + self.hosts = hosts class ClusterProperties(CommonClusterProperties): @@ -577,14 +608,13 @@ class ClusterProperties(CommonClusterProperties): :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] + :param hosts: The hosts. + :type hosts: list[str] """ _validation = { 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -598,9 +628,10 @@ def __init__( self, *, cluster_size: Optional[int] = None, + hosts: Optional[List[str]] = None, **kwargs ): - super(ClusterProperties, self).__init__(cluster_size=cluster_size, **kwargs) + super(ClusterProperties, self).__init__(cluster_size=cluster_size, hosts=hosts, **kwargs) class ClusterUpdate(msrest.serialization.Model): @@ -608,20 +639,25 @@ class ClusterUpdate(msrest.serialization.Model): :param cluster_size: The cluster size. :type cluster_size: int + :param hosts: The hosts. + :type hosts: list[str] """ _attribute_map = { '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 ): super(ClusterUpdate, self).__init__(**kwargs) self.cluster_size = cluster_size + self.hosts = hosts class Datastore(Resource): @@ -642,6 +678,9 @@ class Datastore(Resource): :type net_app_volume: ~azure.mgmt.avs.models.NetAppVolume :param disk_pool_volume: An iSCSI volume. :type disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume + :ivar status: The operational status of the datastore. Possible values include: "Unknown", + "Accessible", "Inaccessible", "Attached", "Detached", "LostCommunication", "DeadOrError". + :vartype status: str or ~azure.mgmt.avs.models.DatastoreStatus """ _validation = { @@ -649,6 +688,7 @@ class Datastore(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { @@ -658,6 +698,7 @@ class Datastore(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'net_app_volume': {'key': 'properties.netAppVolume', 'type': 'NetAppVolume'}, 'disk_pool_volume': {'key': 'properties.diskPoolVolume', 'type': 'DiskPoolVolume'}, + 'status': {'key': 'properties.status', 'type': 'str'}, } def __init__( @@ -671,6 +712,7 @@ def __init__( self.provisioning_state = None self.net_app_volume = net_app_volume self.disk_pool_volume = disk_pool_volume + self.status = None class DatastoreList(msrest.serialization.Model): @@ -749,6 +791,81 @@ def __init__( self.path = None +class Encryption(msrest.serialization.Model): + """The properties of customer managed encryption key. + + :param status: Status of customer managed encryption key. Possible values include: "Enabled", + "Disabled". + :type status: str or ~azure.mgmt.avs.models.EncryptionState + :param key_vault_properties: The key vault where the encryption key is stored. + :type key_vault_properties: ~azure.mgmt.avs.models.EncryptionKeyVaultProperties + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "EncryptionState"]] = None, + key_vault_properties: Optional["EncryptionKeyVaultProperties"] = None, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.status = status + self.key_vault_properties = key_vault_properties + + +class EncryptionKeyVaultProperties(msrest.serialization.Model): + """An Encryption Key. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_name: The name of the key. + :type key_name: str + :param key_version: The version of the key. + :type key_version: str + :param key_vault_url: The URL of the vault. + :type key_vault_url: str + :ivar key_state: The state of key provided. Possible values include: "Connected", + "AccessDenied". + :vartype key_state: str or ~azure.mgmt.avs.models.EncryptionKeyStatus + :ivar version_type: Property of the key if user provided or auto detected. Possible values + include: "Fixed", "AutoDetected". + :vartype version_type: str or ~azure.mgmt.avs.models.EncryptionVersionType + """ + + _validation = { + 'key_state': {'readonly': True}, + 'version_type': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + 'key_vault_url': {'key': 'keyVaultUrl', 'type': 'str'}, + 'key_state': {'key': 'keyState', 'type': 'str'}, + 'version_type': {'key': 'versionType', 'type': 'str'}, + } + + def __init__( + self, + *, + key_name: Optional[str] = None, + key_version: Optional[str] = None, + key_vault_url: Optional[str] = None, + **kwargs + ): + super(EncryptionKeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_url = key_vault_url + self.key_state = None + self.version_type = None + + class Endpoints(msrest.serialization.Model): """Endpoint addresses. @@ -878,6 +995,8 @@ class ExpressRouteAuthorization(Resource): :vartype express_route_authorization_id: str :ivar express_route_authorization_key: The key of the ExpressRoute Circuit Authorization. :vartype express_route_authorization_key: str + :param express_route_id: The ID of the ExpressRoute Circuit. + :type express_route_id: str """ _validation = { @@ -896,16 +1015,20 @@ class ExpressRouteAuthorization(Resource): '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'}, + 'express_route_id': {'key': 'properties.expressRouteId', 'type': 'str'}, } def __init__( self, + *, + express_route_id: Optional[str] = None, **kwargs ): super(ExpressRouteAuthorization, self).__init__(**kwargs) self.provisioning_state = None self.express_route_authorization_id = None self.express_route_authorization_key = None + self.express_route_id = express_route_id class ExpressRouteAuthorizationList(msrest.serialization.Model): @@ -965,6 +1088,9 @@ class GlobalReachConnection(Resource): :param peer_express_route_circuit: Identifier of the ExpressRoute Circuit to peer with in the global reach connection. :type peer_express_route_circuit: str + :param express_route_id: The ID of the Private Cloud's ExpressRoute Circuit that is + participating in the global reach connection. + :type express_route_id: str """ _validation = { @@ -985,6 +1111,7 @@ class GlobalReachConnection(Resource): 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, 'peer_express_route_circuit': {'key': 'properties.peerExpressRouteCircuit', 'type': 'str'}, + 'express_route_id': {'key': 'properties.expressRouteId', 'type': 'str'}, } def __init__( @@ -992,6 +1119,7 @@ def __init__( *, authorization_key: Optional[str] = None, peer_express_route_circuit: Optional[str] = None, + express_route_id: Optional[str] = None, **kwargs ): super(GlobalReachConnection, self).__init__(**kwargs) @@ -1000,6 +1128,7 @@ def __init__( self.authorization_key = authorization_key self.circuit_connection_status = None self.peer_express_route_circuit = peer_express_route_circuit + self.express_route_id = express_route_id class GlobalReachConnectionList(msrest.serialization.Model): @@ -1217,14 +1346,13 @@ class ManagementCluster(CommonClusterProperties): :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] + :param hosts: The hosts. + :type hosts: list[str] """ _validation = { 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -1238,9 +1366,10 @@ def __init__( self, *, cluster_size: Optional[int] = None, + hosts: Optional[List[str]] = None, **kwargs ): - super(ManagementCluster, self).__init__(cluster_size=cluster_size, **kwargs) + super(ManagementCluster, self).__init__(cluster_size=cluster_size, hosts=hosts, **kwargs) class MetricDimension(msrest.serialization.Model): @@ -1529,6 +1658,159 @@ def __init__( self.service_specification = service_specification +class PlacementPoliciesList(msrest.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 + ): + super(PlacementPoliciesList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PlacementPolicy(Resource): + """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. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param properties: placement policy properties. + :type properties: ~azure.mgmt.avs.models.PlacementPolicyProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'PlacementPolicyProperties'}, + } + + def __init__( + self, + *, + properties: Optional["PlacementPolicyProperties"] = None, + **kwargs + ): + super(PlacementPolicy, self).__init__(**kwargs) + self.properties = properties + + +class PlacementPolicyProperties(msrest.serialization.Model): + """Abstract placement policy properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VmHostPlacementPolicyProperties, VmPlacementPolicyProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. placement policy type.Constant filled by server. Possible values + include: "VmVm", "VmHost". + :type type: str or ~azure.mgmt.avs.models.PlacementPolicyType + :param state: Whether the placement policy is enabled or disabled. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy. + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", + "Failed", "Building", "Deleting", "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + """ + + _validation = { + 'type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'VmHost': 'VmHostPlacementPolicyProperties', 'VmVm': 'VmPlacementPolicyProperties'} + } + + def __init__( + self, + *, + state: Optional[Union[str, "PlacementPolicyState"]] = None, + display_name: Optional[str] = None, + **kwargs + ): + super(PlacementPolicyProperties, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.state = state + self.display_name = display_name + self.provisioning_state = None + + +class PlacementPolicyUpdate(msrest.serialization.Model): + """An update of a DRS placement policy resource. + + :param state: Whether the placement policy is enabled or disabled. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param vm_members: Virtual machine members list. + :type vm_members: list[str] + :param host_members: Host members list. + :type host_members: list[str] + """ + + _attribute_map = { + 'state': {'key': 'properties.state', 'type': 'str'}, + 'vm_members': {'key': 'properties.vmMembers', 'type': '[str]'}, + 'host_members': {'key': 'properties.hostMembers', 'type': '[str]'}, + } + + def __init__( + self, + *, + state: Optional[Union[str, "PlacementPolicyState"]] = None, + vm_members: Optional[List[str]] = None, + host_members: Optional[List[str]] = None, + **kwargs + ): + super(PlacementPolicyUpdate, self).__init__(**kwargs) + self.state = state + self.vm_members = vm_members + self.host_members = host_members + + class TrackedResource(Resource): """The resource model definition for a ARM tracked top level resource. @@ -1591,6 +1873,8 @@ class PrivateCloud(TrackedResource): :type tags: dict[str, str] :param sku: Required. The private cloud SKU. :type sku: ~azure.mgmt.avs.models.Sku + :param identity: The identity of the private cloud, if configured. + :type identity: ~azure.mgmt.avs.models.PrivateCloudIdentity :param management_cluster: The default cluster used for management. :type management_cluster: ~azure.mgmt.avs.models.ManagementCluster :param internet: Connectivity to internet is enabled or disabled. Possible values include: @@ -1598,6 +1882,11 @@ class PrivateCloud(TrackedResource): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources. :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed across availability + zones. + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or disabled. + :type encryption: ~azure.mgmt.avs.models.Encryption :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", "Failed", "Cancelled", "Pending", "Building", "Deleting", "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.PrivateCloudProvisioningState @@ -1628,6 +1917,9 @@ class PrivateCloud(TrackedResource): :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] + :param secondary_circuit: A secondary expressRoute circuit from a separate AZ. Only present in + a stretched private cloud. + :type secondary_circuit: ~azure.mgmt.avs.models.Circuit """ _validation = { @@ -1652,9 +1944,12 @@ class PrivateCloud(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + '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'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, @@ -1667,6 +1962,7 @@ class PrivateCloud(TrackedResource): 'vcenter_certificate_thumbprint': {'key': 'properties.vcenterCertificateThumbprint', 'type': 'str'}, 'nsxt_certificate_thumbprint': {'key': 'properties.nsxtCertificateThumbprint', 'type': 'str'}, 'external_cloud_links': {'key': 'properties.externalCloudLinks', 'type': '[str]'}, + 'secondary_circuit': {'key': 'properties.secondaryCircuit', 'type': 'Circuit'}, } def __init__( @@ -1675,20 +1971,27 @@ def __init__( sku: "Sku", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["PrivateCloudIdentity"] = None, management_cluster: Optional["ManagementCluster"] = None, internet: Optional[Union[str, "InternetEnum"]] = "Disabled", identity_sources: Optional[List["IdentitySource"]] = None, + availability: Optional["AvailabilityProperties"] = None, + encryption: Optional["Encryption"] = None, circuit: Optional["Circuit"] = None, network_block: Optional[str] = None, vcenter_password: Optional[str] = None, nsxt_password: Optional[str] = None, + secondary_circuit: Optional["Circuit"] = None, **kwargs ): super(PrivateCloud, self).__init__(location=location, tags=tags, **kwargs) 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.provisioning_state = None self.circuit = circuit self.endpoints = None @@ -1701,6 +2004,47 @@ def __init__( self.vcenter_certificate_thumbprint = None self.nsxt_certificate_thumbprint = None self.external_cloud_links = None + self.secondary_circuit = secondary_circuit + + +class PrivateCloudIdentity(msrest.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 + :param 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. Possible values include: "SystemAssigned", "None". + :type 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, "ResourceIdentityType"]] = None, + **kwargs + ): + super(PrivateCloudIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type class PrivateCloudList(msrest.serialization.Model): @@ -1743,12 +2087,19 @@ class PrivateCloudUpdateProperties(msrest.serialization.Model): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources. :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed across availability + zones. + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or disabled. + :type encryption: ~azure.mgmt.avs.models.Encryption """ _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'}, } def __init__( @@ -1757,12 +2108,16 @@ def __init__( management_cluster: Optional["ManagementCluster"] = None, internet: Optional[Union[str, "InternetEnum"]] = "Disabled", identity_sources: Optional[List["IdentitySource"]] = None, + availability: Optional["AvailabilityProperties"] = None, + encryption: Optional["Encryption"] = None, **kwargs ): super(PrivateCloudUpdateProperties, self).__init__(**kwargs) self.management_cluster = management_cluster self.internet = internet self.identity_sources = identity_sources + self.availability = availability + self.encryption = encryption class PrivateCloudProperties(PrivateCloudUpdateProperties): @@ -1779,6 +2134,11 @@ class PrivateCloudProperties(PrivateCloudUpdateProperties): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources. :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed across availability + zones. + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or disabled. + :type encryption: ~azure.mgmt.avs.models.Encryption :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", "Failed", "Cancelled", "Pending", "Building", "Deleting", "Updating". :vartype provisioning_state: str or ~azure.mgmt.avs.models.PrivateCloudProvisioningState @@ -1809,6 +2169,9 @@ class PrivateCloudProperties(PrivateCloudUpdateProperties): :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] + :param secondary_circuit: A secondary expressRoute circuit from a separate AZ. Only present in + a stretched private cloud. + :type secondary_circuit: ~azure.mgmt.avs.models.Circuit """ _validation = { @@ -1827,6 +2190,8 @@ class PrivateCloudProperties(PrivateCloudUpdateProperties): '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'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'circuit': {'key': 'circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'endpoints', 'type': 'Endpoints'}, @@ -1839,6 +2204,7 @@ class PrivateCloudProperties(PrivateCloudUpdateProperties): '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'}, } def __init__( @@ -1848,12 +2214,15 @@ def __init__( management_cluster: Optional["ManagementCluster"] = None, internet: Optional[Union[str, "InternetEnum"]] = "Disabled", identity_sources: Optional[List["IdentitySource"]] = None, + availability: Optional["AvailabilityProperties"] = None, + encryption: Optional["Encryption"] = None, circuit: Optional["Circuit"] = None, vcenter_password: Optional[str] = None, nsxt_password: Optional[str] = None, + secondary_circuit: Optional["Circuit"] = None, **kwargs ): - super(PrivateCloudProperties, self).__init__(management_cluster=management_cluster, internet=internet, identity_sources=identity_sources, **kwargs) + super(PrivateCloudProperties, self).__init__(management_cluster=management_cluster, internet=internet, identity_sources=identity_sources, availability=availability, encryption=encryption, **kwargs) self.provisioning_state = None self.circuit = circuit self.endpoints = None @@ -1866,6 +2235,7 @@ def __init__( self.vcenter_certificate_thumbprint = None self.nsxt_certificate_thumbprint = None self.external_cloud_links = None + self.secondary_circuit = secondary_circuit class PrivateCloudUpdate(msrest.serialization.Model): @@ -1873,6 +2243,8 @@ class PrivateCloudUpdate(msrest.serialization.Model): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] + :param identity: The identity of the private cloud, if configured. + :type identity: ~azure.mgmt.avs.models.PrivateCloudIdentity :param management_cluster: The default cluster used for management. :type management_cluster: ~azure.mgmt.avs.models.ManagementCluster :param internet: Connectivity to internet is enabled or disabled. Possible values include: @@ -1880,29 +2252,43 @@ class PrivateCloudUpdate(msrest.serialization.Model): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources. :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed across availability + zones. + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or disabled. + :type encryption: ~azure.mgmt.avs.models.Encryption """ _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'}, } def __init__( self, *, tags: Optional[Dict[str, str]] = None, + identity: Optional["PrivateCloudIdentity"] = None, management_cluster: Optional["ManagementCluster"] = None, internet: Optional[Union[str, "InternetEnum"]] = "Disabled", identity_sources: Optional[List["IdentitySource"]] = None, + availability: Optional["AvailabilityProperties"] = None, + encryption: Optional["Encryption"] = None, **kwargs ): super(PrivateCloudUpdate, self).__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 class ProxyResource(Resource): @@ -2550,6 +2936,230 @@ def __init__( self.available_hosts = None +class VirtualMachine(ProxyResource): + """Virtual Machine. + + 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 VM. + :vartype display_name: str + :ivar mo_ref_id: Virtual machine managed object reference id. + :vartype mo_ref_id: str + :ivar folder_path: Path to virtual machine's folder starting from datacenter virtual machine + folder. + :vartype folder_path: str + :ivar restrict_movement: Whether VM DRS-driven movement is restricted (enabled) or not + (disabled). Possible values include: "Enabled", "Disabled". + :vartype restrict_movement: str or ~azure.mgmt.avs.models.VirtualMachineRestrictMovementState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'mo_ref_id': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'restrict_movement': {'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'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'restrict_movement': {'key': 'properties.restrictMovement', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachine, self).__init__(**kwargs) + self.display_name = None + self.mo_ref_id = None + self.folder_path = None + self.restrict_movement = None + + +class VirtualMachineRestrictMovement(msrest.serialization.Model): + """Set VM DRS-driven movement to restricted (enabled) or not (disabled). + + :param restrict_movement: Whether VM DRS-driven movement is restricted (enabled) or not + (disabled). Possible values include: "Enabled", "Disabled". + :type restrict_movement: str or ~azure.mgmt.avs.models.VirtualMachineRestrictMovementState + """ + + _attribute_map = { + 'restrict_movement': {'key': 'restrictMovement', 'type': 'str'}, + } + + def __init__( + self, + *, + restrict_movement: Optional[Union[str, "VirtualMachineRestrictMovementState"]] = None, + **kwargs + ): + super(VirtualMachineRestrictMovement, self).__init__(**kwargs) + self.restrict_movement = restrict_movement + + +class VirtualMachinesList(msrest.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 + ): + super(VirtualMachinesList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class VmHostPlacementPolicyProperties(PlacementPolicyProperties): + """VM-Host placement policy properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. placement policy type.Constant filled by server. Possible values + include: "VmVm", "VmHost". + :type type: str or ~azure.mgmt.avs.models.PlacementPolicyType + :param state: Whether the placement policy is enabled or disabled. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy. + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", + "Failed", "Building", "Deleting", "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + :param vm_members: Required. Virtual machine members list. + :type vm_members: list[str] + :param host_members: Required. Host members list. + :type host_members: list[str] + :param affinity_type: Required. placement policy affinity type. Possible values include: + "Affinity", "AntiAffinity". + :type affinity_type: str or ~azure.mgmt.avs.models.AffinityType + """ + + _validation = { + 'type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'vm_members': {'required': True}, + 'host_members': {'required': True}, + 'affinity_type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'vm_members': {'key': 'vmMembers', 'type': '[str]'}, + 'host_members': {'key': 'hostMembers', 'type': '[str]'}, + 'affinity_type': {'key': 'affinityType', 'type': 'str'}, + } + + def __init__( + self, + *, + vm_members: List[str], + host_members: List[str], + affinity_type: Union[str, "AffinityType"], + state: Optional[Union[str, "PlacementPolicyState"]] = None, + display_name: Optional[str] = None, + **kwargs + ): + super(VmHostPlacementPolicyProperties, self).__init__(state=state, display_name=display_name, **kwargs) + self.type = 'VmHost' # type: str + self.vm_members = vm_members + self.host_members = host_members + self.affinity_type = affinity_type + + +class VmPlacementPolicyProperties(PlacementPolicyProperties): + """VM-VM placement policy properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. placement policy type.Constant filled by server. Possible values + include: "VmVm", "VmHost". + :type type: str or ~azure.mgmt.avs.models.PlacementPolicyType + :param state: Whether the placement policy is enabled or disabled. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy. + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", + "Failed", "Building", "Deleting", "Updating". + :vartype provisioning_state: str or ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + :param vm_members: Required. Virtual machine members list. + :type vm_members: list[str] + :param affinity_type: Required. placement policy affinity type. Possible values include: + "Affinity", "AntiAffinity". + :type affinity_type: str or ~azure.mgmt.avs.models.AffinityType + """ + + _validation = { + 'type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'vm_members': {'required': True}, + 'affinity_type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'vm_members': {'key': 'vmMembers', 'type': '[str]'}, + 'affinity_type': {'key': 'affinityType', 'type': 'str'}, + } + + def __init__( + self, + *, + vm_members: List[str], + affinity_type: Union[str, "AffinityType"], + state: Optional[Union[str, "PlacementPolicyState"]] = None, + display_name: Optional[str] = None, + **kwargs + ): + super(VmPlacementPolicyProperties, self).__init__(state=state, display_name=display_name, **kwargs) + self.type = 'VmVm' # type: str + self.vm_members = vm_members + self.affinity_type = affinity_type + + class WorkloadNetworkDhcp(ProxyResource): """NSX DHCP. @@ -3075,14 +3685,14 @@ class WorkloadNetworkPortMirroring(ProxyResource): :vartype type: str :param display_name: Display name of the port mirroring profile. :type display_name: str - :param direction: Direction of port mirroring profile. Possible values include: "INGRESS, - EGRESS, BIDIRECTIONAL". + :param direction: Direction of port mirroring profile. Possible values include: "INGRESS", + "EGRESS", "BIDIRECTIONAL". :type direction: str or ~azure.mgmt.avs.models.PortMirroringDirectionEnum :param source: Source VM Group. :type source: str :param destination: Destination VM Group. :type destination: str - :ivar status: Port Mirroring Status. Possible values include: "SUCCESS, FAILURE". + :ivar status: Port Mirroring Status. Possible values include: "SUCCESS", "FAILURE". :vartype status: str or ~azure.mgmt.avs.models.PortMirroringStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", "Failed", "Building", "Deleting", "Updating". @@ -3267,7 +3877,7 @@ class WorkloadNetworkSegment(ProxyResource): :type 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. Possible values include: "SUCCESS, FAILURE". + :ivar status: Segment status. Possible values include: "SUCCESS", "FAILURE". :vartype status: str or ~azure.mgmt.avs.models.SegmentStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", "Failed", "Building", "Deleting", "Updating". @@ -3408,7 +4018,7 @@ class WorkloadNetworkVirtualMachine(ProxyResource): :vartype type: str :param display_name: Display name of the VM. :type display_name: str - :ivar vm_type: Virtual machine type. Possible values include: "REGULAR, EDGE, SERVICE". + :ivar vm_type: Virtual machine type. Possible values include: "REGULAR", "EDGE", "SERVICE". :vartype vm_type: str or ~azure.mgmt.avs.models.VMTypeEnum """ @@ -3483,7 +4093,7 @@ class WorkloadNetworkVMGroup(ProxyResource): :type display_name: str :param members: Virtual machine members of this group. :type members: list[str] - :ivar status: VM Group status. Possible values include: "SUCCESS, FAILURE". + :ivar status: VM Group status. Possible values include: "SUCCESS", "FAILURE". :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: "Succeeded", "Failed", "Building", "Deleting", "Updating". 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 1e3c208eb0fd..d60908801950 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 @@ -17,6 +17,8 @@ from ._workload_networks_operations import WorkloadNetworksOperations from ._cloud_links_operations import CloudLinksOperations from ._addons_operations import AddonsOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._placement_policies_operations import PlacementPoliciesOperations from ._script_packages_operations import ScriptPackagesOperations from ._script_cmdlets_operations import ScriptCmdletsOperations from ._script_executions_operations import ScriptExecutionsOperations @@ -33,6 +35,8 @@ 'WorkloadNetworksOperations', 'CloudLinksOperations', 'AddonsOperations', + 'VirtualMachinesOperations', + 'PlacementPoliciesOperations', 'ScriptPackagesOperations', 'ScriptCmdletsOperations', 'ScriptExecutionsOperations', 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 cbf11fb1c6b1..2611dffafbf3 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 @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -152,7 +152,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -341,7 +341,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 ef131b290e4c..87ba55b46207 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 @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -152,7 +152,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -341,7 +341,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 7f8d7c545008..36cb04a58572 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 @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -152,7 +152,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -341,7 +341,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 08a4a65e126f..c8db0db6d520 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 @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -152,7 +152,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -342,7 +342,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -480,7 +480,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 5217ec4dc6f1..d06b71646495 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 @@ -75,7 +75,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -159,7 +159,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -212,7 +212,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -357,7 +357,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 a5b6e97ce621..5174658a469d 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 @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -152,7 +152,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -341,7 +341,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 e4ff21f0d177..4d2296c144a8 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 @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -150,7 +150,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -218,7 +218,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -292,7 +292,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 b782fc85d1d5..2228c4fa769c 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 @@ -64,7 +64,7 @@ def check_trial_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -119,7 +119,7 @@ def check_quota_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 61ca34137e14..3eac2fb43b68 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 @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): 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 new file mode 100644 index 000000000000..29456e8a91cc --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py @@ -0,0 +1,620 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PlacementPoliciesOperations(object): + """PlacementPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.avs.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PlacementPoliciesList"] + """List placement policies in a private cloud cluster. + + List placement policies in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :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 PlacementPoliciesList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.PlacementPoliciesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPoliciesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PlacementPoliciesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies'} # type: ignore + + def get( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + placement_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PlacementPolicy" + """Get a placement policy by name in a private cloud cluster. + + Get a placement policy by name in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) + placement policy. + :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) + :rtype: ~azure.mgmt.avs.models.PlacementPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + placement_policy_name, # type: str + placement_policy, # type: "_models.PlacementPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.PlacementPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(placement_policy, 'PlacementPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + placement_policy_name, # type: str + placement_policy, # type: "_models.PlacementPolicy" + **kwargs # type: Any + ): + # type: (...) -> 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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) + placement policy. + :type placement_policy_name: str + :param placement_policy: A placement policy in the private cloud cluster. + :type placement_policy: ~azure.mgmt.avs.models.PlacementPolicy + :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 PlacementPolicy or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.PlacementPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + placement_policy_name=placement_policy_name, + placement_policy=placement_policy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + placement_policy_name, # type: str + placement_policy_update, # type: "_models.PlacementPolicyUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.PlacementPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(placement_policy_update, 'PlacementPolicyUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + placement_policy_name, # type: str + placement_policy_update, # type: "_models.PlacementPolicyUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PlacementPolicy"] + """Update a placement policy in a private cloud cluster. + + Update a placement policy in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) + placement policy. + :type placement_policy_name: str + :param placement_policy_update: The placement policy properties that may be updated. + :type placement_policy_update: ~azure.mgmt.avs.models.PlacementPolicyUpdate + :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 PlacementPolicy or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.avs.models.PlacementPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PlacementPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + placement_policy_name=placement_policy_name, + placement_policy_update=placement_policy_update, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PlacementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + placement_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + placement_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a placement policy in a private cloud cluster. + + Delete a placement policy in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed Resource Scheduler (DRS) + placement policy. + :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. + :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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + placement_policy_name=placement_policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} # type: ignore 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 30894a5616a9..3085e8a1d2a7 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 @@ -69,7 +69,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -139,7 +139,7 @@ def list_in_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -214,7 +214,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -263,7 +263,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -395,7 +395,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -526,7 +526,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -638,7 +638,7 @@ def _rotate_vcenter_password_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -750,7 +750,7 @@ def _rotate_nsxt_password_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -875,7 +875,7 @@ def list_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 aeffe771edf1..554fa942fbbd 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 @@ -53,8 +53,8 @@ def list( **kwargs # type: Any ): # type: (...) -> Iterable["_models.ScriptCmdletsList"] - """Return script cmdlet resources available for a private cloud to create a script execution - resource on their Private Cloud. + """List script cmdlet resources available for a private cloud to create a script execution + resource on a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -155,7 +155,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 89aaea947a75..25318db5a893 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 @@ -54,9 +54,9 @@ def list( **kwargs # type: Any ): # type: (...) -> Iterable["_models.ScriptExecutionsList"] - """Get an script execution resource by name in a private cloud. + """List script executions in a private cloud. - Get an script execution resource by name in a private cloud. + List script executions in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -132,9 +132,9 @@ def get( **kwargs # type: Any ): # type: (...) -> "_models.ScriptExecution" - """Get an script execution resource by name in a private cloud. + """Get an script execution by name in a private cloud. - Get an script execution resource by name in a private cloud. + Get an script execution by name in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -152,7 +152,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -258,9 +258,9 @@ def begin_create_or_update( **kwargs # type: Any ): # type: (...) -> LROPoller["_models.ScriptExecution"] - """Create or update a script execution resource in a private cloud. + """Create or update a script execution in a private cloud. - Create or update a script execution resource in a private cloud. + Create or update a script execution in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -341,7 +341,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -477,7 +477,7 @@ def get_execution_logs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" 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 910b857c7a36..3b6f1cc8d54b 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 @@ -52,7 +52,7 @@ def list( **kwargs # type: Any ): # type: (...) -> Iterable["_models.ScriptPackagesList"] - """Return script packages available for a private cloud to run on their Private Cloud. + """List script packages available to run on the private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -68,7 +68,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -128,7 +128,7 @@ def get( **kwargs # type: Any ): # type: (...) -> "_models.ScriptPackage" - """Return script package available to run on an Private Cloud. + """Get a script package available to run on a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -146,7 +146,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL 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 new file mode 100644 index 000000000000..3ce349e773f2 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py @@ -0,0 +1,335 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachinesOperations(object): + """VirtualMachinesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.avs.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualMachinesList"] + """List of virtual machines in a private cloud cluster. + + List of virtual machines in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :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 VirtualMachinesList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.avs.models.VirtualMachinesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachinesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualMachinesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines'} # type: ignore + + def get( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + virtual_machine_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachine" + """Get a virtual machine by id in a private cloud cluster. + + Get a virtual machine by id in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param virtual_machine_id: Virtual Machine identifier. + :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) + :rtype: ~azure.mgmt.avs.models.VirtualMachine + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'virtualMachineId': self._serialize.url("virtual_machine_id", virtual_machine_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}'} # type: ignore + + def _restrict_movement_initial( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + virtual_machine_id, # type: str + restrict_movement, # type: "_models.VirtualMachineRestrictMovement" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restrict_movement_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'virtualMachineId': self._serialize.url("virtual_machine_id", virtual_machine_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restrict_movement, 'VirtualMachineRestrictMovement') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restrict_movement_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement'} # type: ignore + + def begin_restrict_movement( + self, + resource_group_name, # type: str + private_cloud_name, # type: str + cluster_name, # type: str + virtual_machine_id, # type: str + restrict_movement, # type: "_models.VirtualMachineRestrictMovement" + **kwargs # type: Any + ): + # type: (...) -> 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. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud. + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud. + :type cluster_name: str + :param virtual_machine_id: Virtual Machine identifier. + :type virtual_machine_id: str + :param restrict_movement: Whether VM DRS-driven movement is restricted (Enabled) or not + (Disabled). + :type restrict_movement: ~azure.mgmt.avs.models.VirtualMachineRestrictMovement + :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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restrict_movement_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + virtual_machine_id=virtual_machine_id, + restrict_movement=restrict_movement, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'virtualMachineId': self._serialize.url("virtual_machine_id", virtual_machine_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restrict_movement.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement'} # type: ignore 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 5ce42cfd67e4..7e21bcbc2c7f 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 @@ -72,7 +72,7 @@ def list_segments( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -152,7 +152,7 @@ def get_segment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def _create_segments_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -342,7 +342,7 @@ def _update_segments_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -478,7 +478,7 @@ def _delete_segment_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -609,7 +609,7 @@ def list_dhcp( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -689,7 +689,7 @@ def get_dhcp( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -740,7 +740,7 @@ def _create_dhcp_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -879,7 +879,7 @@ def _update_dhcp_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1015,7 +1015,7 @@ def _delete_dhcp_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -1146,7 +1146,7 @@ def list_gateways( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -1226,7 +1226,7 @@ def get_gateway( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -1288,7 +1288,7 @@ def list_port_mirroring( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -1369,7 +1369,7 @@ def get_port_mirroring( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -1420,7 +1420,7 @@ def _create_port_mirroring_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1560,7 +1560,7 @@ def _update_port_mirroring_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1697,7 +1697,7 @@ def _delete_port_mirroring_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -1829,7 +1829,7 @@ def list_vm_groups( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -1909,7 +1909,7 @@ def get_vm_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -1960,7 +1960,7 @@ def _create_vm_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2099,7 +2099,7 @@ def _update_vm_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2235,7 +2235,7 @@ def _delete_vm_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -2366,7 +2366,7 @@ def list_virtual_machines( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -2446,7 +2446,7 @@ def get_virtual_machine( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -2508,7 +2508,7 @@ def list_dns_services( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -2589,7 +2589,7 @@ def get_dns_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -2640,7 +2640,7 @@ def _create_dns_service_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2780,7 +2780,7 @@ def _update_dns_service_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2917,7 +2917,7 @@ def _delete_dns_service_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -3049,7 +3049,7 @@ def list_dns_zones( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -3129,7 +3129,7 @@ def get_dns_zone( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -3180,7 +3180,7 @@ def _create_dns_zone_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -3319,7 +3319,7 @@ def _update_dns_zone_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -3455,7 +3455,7 @@ def _delete_dns_zone_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -3586,7 +3586,7 @@ def list_public_i_ps( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -3667,7 +3667,7 @@ def get_public_ip( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL @@ -3718,7 +3718,7 @@ def _create_public_ip_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -3857,7 +3857,7 @@ def _delete_public_ip_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" + api_version = "2021-12-01" accept = "application/json" # Construct URL