From d55f19f318d8a6622609ef3a82b4202da8b5ceb6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 28 Mar 2023 06:38:28 +0000 Subject: [PATCH] CodeGen from PR 23320 in Azure/azure-rest-api-specs Merge 9dc6c8c6dc1f87a4be8e88397c87d05f55d4f23d into 1e9b59f586be35d6f0a71d1fd4dad44a01a9061e --- .../azure-mgmt-hybridcompute/_meta.json | 6 +- .../mgmt/hybridcompute/_configuration.py | 4 +- .../_hybrid_compute_management_client.py | 16 +- .../azure/mgmt/hybridcompute/_version.py | 2 +- .../mgmt/hybridcompute/aio/_configuration.py | 4 +- .../aio/_hybrid_compute_management_client.py | 17 +- .../hybridcompute/aio/operations/__init__.py | 4 + .../_extension_metadata_operations.py | 229 +++ ...id_compute_management_client_operations.py | 19 +- .../_machine_extensions_operations.py | 55 +- .../aio/operations/_machines_operations.py | 398 +++- .../operations/_network_profile_operations.py | 122 ++ .../aio/operations/_operations.py | 5 +- ...private_endpoint_connections_operations.py | 36 +- .../_private_link_resources_operations.py | 10 +- .../_private_link_scopes_operations.py | 57 +- .../mgmt/hybridcompute/models/__init__.py | 58 +- ..._hybrid_compute_management_client_enums.py | 94 + .../mgmt/hybridcompute/models/_models_py3.py | 1675 ++++++++++++----- .../mgmt/hybridcompute/operations/__init__.py | 4 + .../_extension_metadata_operations.py | 294 +++ ...id_compute_management_client_operations.py | 25 +- .../_machine_extensions_operations.py | 85 +- .../operations/_machines_operations.py | 477 ++++- .../operations/_network_profile_operations.py | 157 ++ .../hybridcompute/operations/_operations.py | 7 +- ...private_endpoint_connections_operations.py | 44 +- .../_private_link_resources_operations.py | 14 +- .../_private_link_scopes_operations.py | 73 +- .../generated_samples/delete_extension.py | 2 +- .../extension_metadata_get.py | 43 + .../extension_metadata_list.py | 43 + .../generated_samples/extensions_upgrade.py | 2 +- .../generated_samples/get_extension.py | 2 +- .../generated_samples/get_network_profile.py | 41 + .../generated_samples/list_extension.py | 2 +- .../machine_assess_patches.py | 41 + .../machine_install_patches.py | 49 + .../generated_samples/machines_delete.py | 2 +- .../generated_samples/machines_get.py | 2 +- .../machines_list_by_resource_group.py | 2 +- .../machines_list_by_subscription.py | 2 +- .../generated_samples/operations_list.py | 2 +- .../private_endpoint_connection_delete.py | 2 +- .../private_endpoint_connection_get.py | 2 +- .../private_endpoint_connection_list.py | 2 +- .../private_endpoint_connection_update.py | 2 +- ...te_link_scope_private_link_resource_get.py | 2 +- ...nk_scope_private_link_resource_list_get.py | 2 +- .../private_link_scopes_create.py | 2 +- .../private_link_scopes_delete.py | 2 +- .../private_link_scopes_get.py | 2 +- .../private_link_scopes_get_validation.py | 2 +- ..._link_scopes_get_validation_for_machine.py | 2 +- .../private_link_scopes_list.py | 2 +- ...vate_link_scopes_list_by_resource_group.py | 2 +- .../private_link_scopes_update.py | 2 +- .../generated_samples/put_extension.py | 2 +- .../generated_samples/update_extension.py | 3 +- 59 files changed, 3534 insertions(+), 725 deletions(-) create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_profile_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension_metadata_get.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension_metadata_list.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/get_network_profile.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine_assess_patches.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine_install_patches.py diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json b/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json index b7d1fb8d7d36..7264369f50df 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json @@ -1,11 +1,11 @@ { - "commit": "270d3cd664cca3ddc8511f92d3851a715e2c61db", + "commit": "aba2fae66fa2df181d73f799b006dcf347012639", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.16", + "@autorest/python@6.4.3", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/hybridcompute/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=package-2022-03 --use=@autorest/python@6.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/hybridcompute/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.3 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/hybridcompute/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py index fde6c33ae9a6..c24af1f52af3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py @@ -35,14 +35,14 @@ class HybridComputeManagementClientConfiguration(Configuration): # pylint: disa :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-03-10". Note that overriding this + :keyword api_version: Api Version. Default value is "2022-12-27". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(HybridComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", "2022-03-10") + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", "2022-12-27") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py index 8a0077896e44..de851b1cc572 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py @@ -16,9 +16,11 @@ from ._configuration import HybridComputeManagementClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( + ExtensionMetadataOperations, HybridComputeManagementClientOperationsMixin, MachineExtensionsOperations, MachinesOperations, + NetworkProfileOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, @@ -39,8 +41,12 @@ class HybridComputeManagementClient( :vartype machines: azure.mgmt.hybridcompute.operations.MachinesOperations :ivar machine_extensions: MachineExtensionsOperations operations :vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations + :ivar extension_metadata: ExtensionMetadataOperations operations + :vartype extension_metadata: azure.mgmt.hybridcompute.operations.ExtensionMetadataOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.hybridcompute.operations.Operations + :ivar network_profile: NetworkProfileOperations operations + :vartype network_profile: azure.mgmt.hybridcompute.operations.NetworkProfileOperations :ivar private_link_scopes: PrivateLinkScopesOperations operations :vartype private_link_scopes: azure.mgmt.hybridcompute.operations.PrivateLinkScopesOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations @@ -55,7 +61,7 @@ class HybridComputeManagementClient( :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-03-10". Note that overriding this + :keyword api_version: Api Version. Default value is "2022-12-27". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -72,7 +78,7 @@ def __init__( self._config = HybridComputeManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -82,7 +88,11 @@ def __init__( self.machine_extensions = MachineExtensionsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.extension_metadata = ExtensionMetadataOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.network_profile = NetworkProfileOperations(self._client, self._config, self._serialize, self._deserialize) self.private_link_scopes = PrivateLinkScopesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -122,5 +132,5 @@ def __enter__(self) -> "HybridComputeManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py index 142a0420b39b..e5754a47ce68 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py index fb08dae516ef..7854048a8439 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py @@ -35,14 +35,14 @@ class HybridComputeManagementClientConfiguration(Configuration): # pylint: disa :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-03-10". Note that overriding this + :keyword api_version: Api Version. Default value is "2022-12-27". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(HybridComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", "2022-03-10") + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", "2022-12-27") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py index c91d02fe633f..94ea1f971f47 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py @@ -16,9 +16,11 @@ from .._serialization import Deserializer, Serializer from ._configuration import HybridComputeManagementClientConfiguration from .operations import ( + ExtensionMetadataOperations, HybridComputeManagementClientOperationsMixin, MachineExtensionsOperations, MachinesOperations, + NetworkProfileOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, @@ -40,8 +42,13 @@ class HybridComputeManagementClient( :ivar machine_extensions: MachineExtensionsOperations operations :vartype machine_extensions: azure.mgmt.hybridcompute.aio.operations.MachineExtensionsOperations + :ivar extension_metadata: ExtensionMetadataOperations operations + :vartype extension_metadata: + azure.mgmt.hybridcompute.aio.operations.ExtensionMetadataOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.hybridcompute.aio.operations.Operations + :ivar network_profile: NetworkProfileOperations operations + :vartype network_profile: azure.mgmt.hybridcompute.aio.operations.NetworkProfileOperations :ivar private_link_scopes: PrivateLinkScopesOperations operations :vartype private_link_scopes: azure.mgmt.hybridcompute.aio.operations.PrivateLinkScopesOperations @@ -57,7 +64,7 @@ class HybridComputeManagementClient( :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-03-10". Note that overriding this + :keyword api_version: Api Version. Default value is "2022-12-27". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -74,7 +81,7 @@ def __init__( self._config = HybridComputeManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -84,7 +91,11 @@ def __init__( self.machine_extensions = MachineExtensionsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.extension_metadata = ExtensionMetadataOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.network_profile = NetworkProfileOperations(self._client, self._config, self._serialize, self._deserialize) self.private_link_scopes = PrivateLinkScopesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -124,5 +135,5 @@ async def __aenter__(self) -> "HybridComputeManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py index 4709c0d6c162..309238b771c8 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py @@ -9,7 +9,9 @@ from ._machines_operations import MachinesOperations from ._machine_extensions_operations import MachineExtensionsOperations from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin +from ._extension_metadata_operations import ExtensionMetadataOperations from ._operations import Operations +from ._network_profile_operations import NetworkProfileOperations from ._private_link_scopes_operations import PrivateLinkScopesOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations @@ -22,7 +24,9 @@ "MachinesOperations", "MachineExtensionsOperations", "HybridComputeManagementClientOperationsMixin", + "ExtensionMetadataOperations", "Operations", + "NetworkProfileOperations", "PrivateLinkScopesOperations", "PrivateLinkResourcesOperations", "PrivateEndpointConnectionsOperations", diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_operations.py new file mode 100644 index 000000000000..5b79f36e5988 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_operations.py @@ -0,0 +1,229 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._extension_metadata_operations import build_get_request, build_list_request +from .._vendor import HybridComputeManagementClientMixinABC + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExtensionMetadataOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`extension_metadata` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, location: str, publisher: str, extension_type: str, version: str, **kwargs: Any + ) -> _models.ExtensionValue: + """Gets an Extension Metadata based on location, publisher, extensionType and version. + + :param location: The location of the Extension being received. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :param version: The version of the Extension being received. Required. + :type version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExtensionValue or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.ExtensionValue + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.ExtensionValue] = kwargs.pop("cls", None) + + request = build_get_request( + location=location, + publisher=publisher, + extension_type=extension_type, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExtensionValue", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}" + } + + @distributed_trace + def list( + self, location: str, publisher: str, extension_type: str, **kwargs: Any + ) -> AsyncIterable["_models.ExtensionValue"]: + """Gets all Extension versions based on location, publisher, extensionType. + + :param location: The location of the Extension being received. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionValue or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.ExtensionValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.ExtensionValueListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + location=location, + publisher=publisher, + extension_type=extension_type, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionValueListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions" + } diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py index 9ed92a8644c4..368a4a6f1b74 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py @@ -58,7 +58,7 @@ async def _upgrade_extensions_initial( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -87,8 +87,9 @@ async def _upgrade_extensions_initial( # pylint: disable=inconsistent-return-st request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -98,8 +99,16 @@ async def _upgrade_extensions_initial( # pylint: disable=inconsistent-return-st error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _upgrade_extensions_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions" @@ -193,7 +202,7 @@ async def begin_upgrade_extensions( :param machine_name: The name of the hybrid machine. Required. :type machine_name: str :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Is either a model type or a IO type. Required. + Is either a MachineExtensionUpgrade type or a IO type. Required. :type extension_upgrade_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpgrade or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -214,7 +223,7 @@ async def begin_upgrade_extensions( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py index 9222583a9bcc..75375e131d8d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py @@ -86,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -116,8 +116,9 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -242,7 +243,7 @@ async def begin_create_or_update( :param extension_name: The name of the machine extension. Required. :type extension_name: str :param extension_parameters: Parameters supplied to the Create Machine Extension operation. Is - either a model type or a IO type. Required. + either a MachineExtension type or a IO type. Required. :type extension_parameters: ~azure.mgmt.hybridcompute.models.MachineExtension or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -263,7 +264,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -330,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -360,8 +361,9 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -372,11 +374,19 @@ async def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("MachineExtension", pipeline_response) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized @@ -486,7 +496,7 @@ async def begin_update( :param extension_name: The name of the machine extension. Required. :type extension_name: str :param extension_parameters: Parameters supplied to the Create Machine Extension operation. Is - either a model type or a IO type. Required. + either a MachineExtensionUpdate type or a IO type. Required. :type extension_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -507,7 +517,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -569,7 +579,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -587,8 +597,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -598,8 +609,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}" @@ -633,7 +652,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -705,7 +724,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MachineExtension] = kwargs.pop("cls", None) @@ -723,8 +742,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -767,7 +787,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MachineExtensionsListResult] = kwargs.pop("cls", None) @@ -824,8 +844,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py index 82d87fe31a41..475d812d5071 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machines_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -21,17 +21,21 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models from ..._vendor import _convert_request from ...operations._machines_operations import ( + build_assess_patches_request, build_delete_request, build_get_request, + build_install_patches_request, build_list_by_resource_group_request, build_list_by_subscription_request, ) @@ -68,7 +72,7 @@ def __init__(self, *args, **kwargs) -> None: async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, machine_name: str, **kwargs: Any ) -> None: - """The operation to remove a hybrid machine identity in Azure. + """The operation to delete a hybrid machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -91,7 +95,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -108,8 +112,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,7 +165,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Machine] = kwargs.pop("cls", None) @@ -178,8 +183,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -200,6 +206,376 @@ async def get( "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}" } + async def _assess_patches_initial( + self, resource_group_name: str, name: str, **kwargs: Any + ) -> Optional[_models.MachineAssessPatchesResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[Optional[_models.MachineAssessPatchesResult]] = kwargs.pop("cls", None) + + request = build_assess_patches_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._assess_patches_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("MachineAssessPatchesResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _assess_patches_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches" + } + + @distributed_trace_async + async def begin_assess_patches( + self, resource_group_name: str, name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.MachineAssessPatchesResult]: + """The operation to assess patches on a hybrid machine identity in Azure. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param name: The name of the hybrid machine. Required. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: 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 MachineAssessPatchesResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineAssessPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.MachineAssessPatchesResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._assess_patches_initial( + resource_group_name=resource_group_name, + name=name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MachineAssessPatchesResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_assess_patches.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches" + } + + async def _install_patches_initial( + self, + resource_group_name: str, + name: str, + install_patches_input: Union[_models.MachineInstallPatchesParameters, IO], + **kwargs: Any + ) -> Optional[_models.MachineInstallPatchesResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MachineInstallPatchesResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(install_patches_input, (IO, bytes)): + _content = install_patches_input + else: + _json = self._serialize.body(install_patches_input, "MachineInstallPatchesParameters") + + request = build_install_patches_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._install_patches_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("MachineInstallPatchesResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _install_patches_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches" + } + + @overload + async def begin_install_patches( + self, + resource_group_name: str, + name: str, + install_patches_input: _models.MachineInstallPatchesParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MachineInstallPatchesResult]: + """The operation to install patches on a hybrid machine identity in Azure. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param name: The name of the hybrid machine. Required. + :type name: str + :param install_patches_input: Input for InstallPatches as directly received by the API. + Required. + :type install_patches_input: ~azure.mgmt.hybridcompute.models.MachineInstallPatchesParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MachineInstallPatchesResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineInstallPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_install_patches( + self, + resource_group_name: str, + name: str, + install_patches_input: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MachineInstallPatchesResult]: + """The operation to install patches on a hybrid machine identity in Azure. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param name: The name of the hybrid machine. Required. + :type name: str + :param install_patches_input: Input for InstallPatches as directly received by the API. + Required. + :type install_patches_input: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MachineInstallPatchesResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineInstallPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_install_patches( + self, + resource_group_name: str, + name: str, + install_patches_input: Union[_models.MachineInstallPatchesParameters, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.MachineInstallPatchesResult]: + """The operation to install patches on a hybrid machine identity in Azure. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param name: The name of the hybrid machine. Required. + :type name: str + :param install_patches_input: Input for InstallPatches as directly received by the API. Is + either a MachineInstallPatchesParameters type or a IO type. Required. + :type install_patches_input: ~azure.mgmt.hybridcompute.models.MachineInstallPatchesParameters + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MachineInstallPatchesResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineInstallPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MachineInstallPatchesResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._install_patches_initial( + resource_group_name=resource_group_name, + name=name, + install_patches_input=install_patches_input, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MachineInstallPatchesResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_install_patches.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches" + } + @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Machine"]: """Lists all the hybrid machines in the specified resource group. Use the nextLink property in the @@ -216,7 +592,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) @@ -271,8 +647,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,7 +679,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Machine" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) @@ -356,8 +733,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_profile_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_profile_operations.py new file mode 100644 index 000000000000..3725f52c5219 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_network_profile_operations.py @@ -0,0 +1,122 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._network_profile_operations import build_get_request +from .._vendor import HybridComputeManagementClientMixinABC + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class NetworkProfileOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`network_profile` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> _models.NetworkProfile: + """The operation to get network information of hybrid machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/networkProfile" + } diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py index 9f5348b29c3e..b0156c739fa4 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_operations.py @@ -71,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) @@ -124,8 +124,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py index 060a70c71e0b..b5a647b0bc3c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_endpoint_connections_operations.py @@ -95,7 +95,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) @@ -113,8 +113,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,7 +155,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -184,8 +185,9 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,7 +308,7 @@ async def begin_create_or_update( :type scope_name: str :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str - :param parameters: Is either a model type or a IO type. Required. + :param parameters: Is either a PrivateEndpointConnection type or a IO type. Required. :type parameters: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -328,7 +330,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -390,7 +392,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -408,8 +410,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,8 +422,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}" @@ -454,7 +465,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -518,7 +529,7 @@ def list_by_private_link_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) @@ -574,8 +585,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py index 631aff65c461..3f20465fea8c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_resources_operations.py @@ -79,7 +79,7 @@ def list_by_private_link_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) @@ -135,8 +135,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -182,7 +183,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) @@ -200,8 +201,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py index c5d98c4beb86..3bf018c7c20c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_private_link_scopes_operations.py @@ -84,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.HybridComputePrivateLink _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.HybridComputePrivateLinkScopeListResult] = kwargs.pop("cls", None) @@ -138,8 +138,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -173,7 +174,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.HybridComputePrivateLinkScopeListResult] = kwargs.pop("cls", None) @@ -228,8 +229,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -260,7 +262,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -277,8 +279,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -288,8 +291,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}" @@ -319,7 +330,7 @@ async def begin_delete(self, resource_group_name: str, scope_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -388,7 +399,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.HybridComputePrivateLinkScope] = kwargs.pop("cls", None) @@ -405,8 +416,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -504,7 +516,8 @@ async def create_or_update( :param scope_name: The name of the Azure Arc PrivateLinkScope resource. Required. :type scope_name: str :param parameters: Properties that need to be specified to create or update a Azure Arc for - Servers and Clusters PrivateLinkScope. Is either a model type or a IO type. Required. + Servers and Clusters PrivateLinkScope. Is either a HybridComputePrivateLinkScope type or a IO + type. Required. :type parameters: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -525,7 +538,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -554,8 +567,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -657,7 +671,7 @@ async def update_tags( :param scope_name: The name of the Azure Arc PrivateLinkScope resource. Required. :type scope_name: str :param private_link_scope_tags: Updated tag information to set into the PrivateLinkScope - instance. Is either a model type or a IO type. Required. + instance. Is either a TagsResource type or a IO type. Required. :type private_link_scope_tags: ~azure.mgmt.hybridcompute.models.TagsResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -678,7 +692,7 @@ async def update_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -707,8 +721,9 @@ async def update_tags( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -756,7 +771,7 @@ async def get_validation_details( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateLinkScopeValidationDetails] = kwargs.pop("cls", None) @@ -773,8 +788,9 @@ async def get_validation_details( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -823,7 +839,7 @@ async def get_validation_details_for_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateLinkScopeValidationDetails] = kwargs.pop("cls", None) @@ -840,8 +856,9 @@ async def get_validation_details_for_machine( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py index 2dfe40d65d6c..7a3dcdfbd2c3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py @@ -7,31 +7,40 @@ # -------------------------------------------------------------------------- from ._models_py3 import AgentConfiguration +from ._models_py3 import AgentUpgrade +from ._models_py3 import AvailablePatchCountByClassification from ._models_py3 import CloudMetadata from ._models_py3 import ConfigurationExtension from ._models_py3 import ConnectionDetail from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorDetailAutoGenerated from ._models_py3 import ErrorResponse +from ._models_py3 import ErrorResponseAutoGenerated from ._models_py3 import ExtensionTargetProperties +from ._models_py3 import ExtensionValue +from ._models_py3 import ExtensionValueListResult from ._models_py3 import HybridComputePrivateLinkScope from ._models_py3 import HybridComputePrivateLinkScopeListResult from ._models_py3 import HybridComputePrivateLinkScopeProperties from ._models_py3 import Identity +from ._models_py3 import IpAddress +from ._models_py3 import LinuxParameters from ._models_py3 import LocationData from ._models_py3 import Machine +from ._models_py3 import MachineAssessPatchesResult from ._models_py3 import MachineExtension from ._models_py3 import MachineExtensionInstanceView from ._models_py3 import MachineExtensionInstanceViewStatus -from ._models_py3 import MachineExtensionProperties from ._models_py3 import MachineExtensionUpdate -from ._models_py3 import MachineExtensionUpdateProperties from ._models_py3 import MachineExtensionUpgrade from ._models_py3 import MachineExtensionsListResult +from ._models_py3 import MachineInstallPatchesParameters +from ._models_py3 import MachineInstallPatchesResult from ._models_py3 import MachineListResult -from ._models_py3 import MachineProperties from ._models_py3 import MachineUpdate -from ._models_py3 import MachineUpdateProperties +from ._models_py3 import NetworkInterface +from ._models_py3 import NetworkProfile from ._models_py3 import OSProfile from ._models_py3 import OSProfileLinuxConfiguration from ._models_py3 import OSProfileWindowsConfiguration @@ -54,48 +63,69 @@ from ._models_py3 import ResourceUpdate from ._models_py3 import ServiceStatus from ._models_py3 import ServiceStatuses +from ._models_py3 import Subnet from ._models_py3 import SystemData from ._models_py3 import TagsResource from ._models_py3 import TrackedResource +from ._models_py3 import WindowsParameters +from ._hybrid_compute_management_client_enums import AgentConfigurationMode from ._hybrid_compute_management_client_enums import AssessmentModeTypes from ._hybrid_compute_management_client_enums import CreatedByType from ._hybrid_compute_management_client_enums import InstanceViewTypes +from ._hybrid_compute_management_client_enums import LastAttemptStatusEnum +from ._hybrid_compute_management_client_enums import OsType from ._hybrid_compute_management_client_enums import PatchModeTypes +from ._hybrid_compute_management_client_enums import PatchOperationStartedBy +from ._hybrid_compute_management_client_enums import PatchOperationStatus +from ._hybrid_compute_management_client_enums import PatchServiceUsed from ._hybrid_compute_management_client_enums import PublicNetworkAccessType from ._hybrid_compute_management_client_enums import StatusLevelTypes from ._hybrid_compute_management_client_enums import StatusTypes +from ._hybrid_compute_management_client_enums import VMGuestPatchClassificationLinux +from ._hybrid_compute_management_client_enums import VMGuestPatchClassificationWindows +from ._hybrid_compute_management_client_enums import VMGuestPatchRebootSetting +from ._hybrid_compute_management_client_enums import VMGuestPatchRebootStatus from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ "AgentConfiguration", + "AgentUpgrade", + "AvailablePatchCountByClassification", "CloudMetadata", "ConfigurationExtension", "ConnectionDetail", "ErrorAdditionalInfo", "ErrorDetail", + "ErrorDetailAutoGenerated", "ErrorResponse", + "ErrorResponseAutoGenerated", "ExtensionTargetProperties", + "ExtensionValue", + "ExtensionValueListResult", "HybridComputePrivateLinkScope", "HybridComputePrivateLinkScopeListResult", "HybridComputePrivateLinkScopeProperties", "Identity", + "IpAddress", + "LinuxParameters", "LocationData", "Machine", + "MachineAssessPatchesResult", "MachineExtension", "MachineExtensionInstanceView", "MachineExtensionInstanceViewStatus", - "MachineExtensionProperties", "MachineExtensionUpdate", - "MachineExtensionUpdateProperties", "MachineExtensionUpgrade", "MachineExtensionsListResult", + "MachineInstallPatchesParameters", + "MachineInstallPatchesResult", "MachineListResult", - "MachineProperties", "MachineUpdate", - "MachineUpdateProperties", + "NetworkInterface", + "NetworkProfile", "OSProfile", "OSProfileLinuxConfiguration", "OSProfileWindowsConfiguration", @@ -118,16 +148,28 @@ "ResourceUpdate", "ServiceStatus", "ServiceStatuses", + "Subnet", "SystemData", "TagsResource", "TrackedResource", + "WindowsParameters", + "AgentConfigurationMode", "AssessmentModeTypes", "CreatedByType", "InstanceViewTypes", + "LastAttemptStatusEnum", + "OsType", "PatchModeTypes", + "PatchOperationStartedBy", + "PatchOperationStatus", + "PatchServiceUsed", "PublicNetworkAccessType", "StatusLevelTypes", "StatusTypes", + "VMGuestPatchClassificationLinux", + "VMGuestPatchClassificationWindows", + "VMGuestPatchRebootSetting", + "VMGuestPatchRebootStatus", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py index cf1430cbeb8a..bba505938458 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py @@ -10,6 +10,15 @@ from azure.core import CaseInsensitiveEnumMeta +class AgentConfigurationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of configuration mode to use. Modes are pre-defined configurations of security controls, + extension allowlists and guest configuration, maintained by Microsoft. + """ + + FULL = "full" + MONITOR = "monitor" + + class AssessmentModeTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the assessment mode.""" @@ -32,6 +41,20 @@ class InstanceViewTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): INSTANCE_VIEW = "instanceView" +class LastAttemptStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies the status of Agent Upgrade.""" + + SUCCESS = "Success" + FAILED = "Failed" + + +class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The operating system type of the machine.""" + + WINDOWS = "Windows" + LINUX = "Linux" + + class PatchModeTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the patch mode.""" @@ -41,6 +64,37 @@ class PatchModeTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): MANUAL = "Manual" +class PatchOperationStartedBy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates if operation was triggered by user or by platform.""" + + USER = "User" + PLATFORM = "Platform" + + +class PatchOperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The overall success or failure status of the operation. It remains "InProgress" until the + operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or + "CompletedWithWarnings.". + """ + + UNKNOWN = "Unknown" + IN_PROGRESS = "InProgress" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + + +class PatchServiceUsed(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies the patch service used for the operation.""" + + UNKNOWN = "Unknown" + WU = "WU" + WU_WSUS = "WU_WSUS" + YUM = "YUM" + APT = "APT" + ZYPPER = "Zypper" + + class PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The network access policy to determine if Azure Arc agents can use public Azure Arc service endpoints. Defaults to disabled (access to Azure Arc services only via private link). @@ -68,3 +122,43 @@ class StatusTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): CONNECTED = "Connected" DISCONNECTED = "Disconnected" ERROR = "Error" + + +class VMGuestPatchClassificationLinux(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VMGuestPatchClassificationLinux.""" + + CRITICAL = "Critical" + SECURITY = "Security" + OTHER = "Other" + + +class VMGuestPatchClassificationWindows(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VMGuestPatchClassificationWindows.""" + + CRITICAL = "Critical" + SECURITY = "Security" + UPDATE_ROLL_UP = "UpdateRollUp" + FEATURE_PACK = "FeaturePack" + SERVICE_PACK = "ServicePack" + DEFINITION = "Definition" + TOOLS = "Tools" + UPDATES = "Updates" + + +class VMGuestPatchRebootSetting(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines when it is acceptable to reboot a VM during a software update operation.""" + + IF_REQUIRED = "IfRequired" + NEVER = "Never" + ALWAYS = "Always" + + +class VMGuestPatchRebootStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The reboot state of the VM following completion of the operation.""" + + UNKNOWN = "Unknown" + NOT_NEEDED = "NotNeeded" + REQUIRED = "Required" + STARTED = "Started" + FAILED = "Failed" + COMPLETED = "Completed" diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py index 1a98ef511fa2..344e9feb367a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py @@ -13,10 +13,6 @@ from .. import _serialization -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports if sys.version_info >= (3, 8): from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports else: @@ -25,7 +21,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from .. import models as _models -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object class AgentConfiguration(_serialization.Model): @@ -51,6 +46,10 @@ class AgentConfiguration(_serialization.Model): :ivar guest_configuration_enabled: Specified whether the guest configuration service is enabled or disabled. :vartype guest_configuration_enabled: str + :ivar config_mode: Name of configuration mode to use. Modes are pre-defined configurations of + security controls, extension allowlists and guest configuration, maintained by Microsoft. Known + values are: "full" and "monitor". + :vartype config_mode: str or ~azure.mgmt.hybridcompute.models.AgentConfigurationMode """ _validation = { @@ -61,6 +60,7 @@ class AgentConfiguration(_serialization.Model): "proxy_bypass": {"readonly": True}, "extensions_enabled": {"readonly": True}, "guest_configuration_enabled": {"readonly": True}, + "config_mode": {"readonly": True}, } _attribute_map = { @@ -71,6 +71,7 @@ class AgentConfiguration(_serialization.Model): "proxy_bypass": {"key": "proxyBypass", "type": "[str]"}, "extensions_enabled": {"key": "extensionsEnabled", "type": "str"}, "guest_configuration_enabled": {"key": "guestConfigurationEnabled", "type": "str"}, + "config_mode": {"key": "configMode", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: @@ -83,6 +84,130 @@ def __init__(self, **kwargs: Any) -> None: self.proxy_bypass = None self.extensions_enabled = None self.guest_configuration_enabled = None + self.config_mode = None + + +class AgentUpgrade(_serialization.Model): + """The info w.r.t Agent Upgrade. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar desired_version: Specifies the version info w.r.t AgentUpgrade for the machine. + :vartype desired_version: str + :ivar correlation_id: The correlation ID passed in from RSM per upgrade. + :vartype correlation_id: str + :ivar enable_automatic_upgrade: Specifies if RSM should try to upgrade this machine. + :vartype enable_automatic_upgrade: bool + :ivar last_attempt_timestamp: Timestamp of last upgrade attempt. + :vartype last_attempt_timestamp: str + :ivar last_attempt_status: Specifies the status of Agent Upgrade. Known values are: "Success" + and "Failed". + :vartype last_attempt_status: str or ~azure.mgmt.hybridcompute.models.LastAttemptStatusEnum + :ivar last_attempt_message: Failure message of last upgrade attempt if any. + :vartype last_attempt_message: str + """ + + _validation = { + "last_attempt_timestamp": {"readonly": True}, + "last_attempt_status": {"readonly": True}, + "last_attempt_message": {"readonly": True}, + } + + _attribute_map = { + "desired_version": {"key": "desiredVersion", "type": "str"}, + "correlation_id": {"key": "correlationId", "type": "str"}, + "enable_automatic_upgrade": {"key": "enableAutomaticUpgrade", "type": "bool"}, + "last_attempt_timestamp": {"key": "lastAttemptTimestamp", "type": "str"}, + "last_attempt_status": {"key": "lastAttemptStatus", "type": "str"}, + "last_attempt_message": {"key": "lastAttemptMessage", "type": "str"}, + } + + def __init__( + self, + *, + desired_version: Optional[str] = None, + correlation_id: Optional[str] = None, + enable_automatic_upgrade: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword desired_version: Specifies the version info w.r.t AgentUpgrade for the machine. + :paramtype desired_version: str + :keyword correlation_id: The correlation ID passed in from RSM per upgrade. + :paramtype correlation_id: str + :keyword enable_automatic_upgrade: Specifies if RSM should try to upgrade this machine. + :paramtype enable_automatic_upgrade: bool + """ + super().__init__(**kwargs) + self.desired_version = desired_version + self.correlation_id = correlation_id + self.enable_automatic_upgrade = enable_automatic_upgrade + self.last_attempt_timestamp = None + self.last_attempt_status = None + self.last_attempt_message = None + + +class AvailablePatchCountByClassification(_serialization.Model): + """Summarization of patches available for installation on the machine by classification. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar security: Number of security patches available for installation. + :vartype security: int + :ivar critical: Number of critical patches available for installation. + :vartype critical: int + :ivar definition: Number of definition patches available for installation. + :vartype definition: int + :ivar update_rollup: Number of update Rollup patches available for installation. + :vartype update_rollup: int + :ivar feature_pack: Number of feature pack patches available for installation. + :vartype feature_pack: int + :ivar service_pack: Number of service pack patches available for installation. + :vartype service_pack: int + :ivar tools: Number of tools patches available for installation. + :vartype tools: int + :ivar updates: Number of updates category patches available for installation. + :vartype updates: int + :ivar other: Number of other patches available for installation. + :vartype other: int + """ + + _validation = { + "security": {"readonly": True}, + "critical": {"readonly": True}, + "definition": {"readonly": True}, + "update_rollup": {"readonly": True}, + "feature_pack": {"readonly": True}, + "service_pack": {"readonly": True}, + "tools": {"readonly": True}, + "updates": {"readonly": True}, + "other": {"readonly": True}, + } + + _attribute_map = { + "security": {"key": "security", "type": "int"}, + "critical": {"key": "critical", "type": "int"}, + "definition": {"key": "definition", "type": "int"}, + "update_rollup": {"key": "updateRollup", "type": "int"}, + "feature_pack": {"key": "featurePack", "type": "int"}, + "service_pack": {"key": "servicePack", "type": "int"}, + "tools": {"key": "tools", "type": "int"}, + "updates": {"key": "updates", "type": "int"}, + "other": {"key": "other", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.security = None + self.critical = None + self.definition = None + self.update_rollup = None + self.feature_pack = None + self.service_pack = None + self.tools = None + self.updates = None + self.other = None class CloudMetadata(_serialization.Model): @@ -250,6 +375,49 @@ def __init__(self, **kwargs: Any) -> None: self.additional_info = None +class ErrorDetailAutoGenerated(_serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorDetailAutoGenerated] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetailAutoGenerated]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class ErrorResponse(_serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). @@ -271,6 +439,27 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A self.error = error +class ErrorResponseAutoGenerated(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.hybridcompute.models.ErrorDetailAutoGenerated + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetailAutoGenerated"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetailAutoGenerated"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.hybridcompute.models.ErrorDetailAutoGenerated + """ + super().__init__(**kwargs) + self.error = error + + class ExtensionTargetProperties(_serialization.Model): """Describes the Machine Extension Target Version Properties. @@ -291,6 +480,160 @@ def __init__(self, *, target_version: Optional[str] = None, **kwargs: Any) -> No self.target_version = target_version +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + + +class ExtensionValue(ProxyResource): + """Describes a Extension Metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar version: The version of the Extension being received. + :vartype version: str + :ivar extension_type: The type of the Extension being received. + :vartype extension_type: str + :ivar publisher: The publisher of the Extension being received. + :vartype publisher: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "version": {"readonly": True}, + "extension_type": {"readonly": True}, + "publisher": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "version": {"key": "properties.version", "type": "str"}, + "extension_type": {"key": "properties.extensionType", "type": "str"}, + "publisher": {"key": "properties.publisher", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.version = None + self.extension_type = None + self.publisher = None + + +class ExtensionValueListResult(_serialization.Model): + """The List Extension Metadata response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of extension metadata. + :vartype value: list[~azure.mgmt.hybridcompute.models.ExtensionValue] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ExtensionValue]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + class PrivateLinkScopesResource(_serialization.Model): """An azure resource object. @@ -525,91 +868,141 @@ def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs self.type = type -class LocationData(_serialization.Model): - """Metadata pertaining to the geographic location of the resource. +class IpAddress(_serialization.Model): + """Describes properties of the IP address. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: A canonical name for the geographic or physical location. Required. - :vartype name: str - :ivar city: The city or locality where the resource is located. - :vartype city: str - :ivar district: The district, state, or province where the resource is located. - :vartype district: str - :ivar country_or_region: The country or region where the resource is located. - :vartype country_or_region: str + :ivar address: Represents the IP Address. + :vartype address: str + :ivar ip_address_version: Represents the Ip Address Version. + :vartype ip_address_version: str + :ivar subnet: The subnet to which this IP address belongs. + :vartype subnet: ~azure.mgmt.hybridcompute.models.Subnet """ _validation = { - "name": {"required": True, "max_length": 256}, + "subnet": {"readonly": True}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, - "city": {"key": "city", "type": "str"}, - "district": {"key": "district", "type": "str"}, - "country_or_region": {"key": "countryOrRegion", "type": "str"}, + "address": {"key": "address", "type": "str"}, + "ip_address_version": {"key": "ipAddressVersion", "type": "str"}, + "subnet": {"key": "subnet", "type": "Subnet"}, } def __init__( - self, - *, - name: str, - city: Optional[str] = None, - district: Optional[str] = None, - country_or_region: Optional[str] = None, - **kwargs: Any + self, *, address: Optional[str] = None, ip_address_version: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword name: A canonical name for the geographic or physical location. Required. - :paramtype name: str - :keyword city: The city or locality where the resource is located. - :paramtype city: str - :keyword district: The district, state, or province where the resource is located. - :paramtype district: str - :keyword country_or_region: The country or region where the resource is located. - :paramtype country_or_region: str + :keyword address: Represents the IP Address. + :paramtype address: str + :keyword ip_address_version: Represents the Ip Address Version. + :paramtype ip_address_version: str """ super().__init__(**kwargs) - self.name = name - self.city = city - self.district = district - self.country_or_region = country_or_region + self.address = address + self.ip_address_version = ip_address_version + self.subnet = None + + +class LinuxParameters(_serialization.Model): + """Input for InstallPatches on a Linux VM, as directly received by the API. + + :ivar classifications_to_include: The update classifications to select when installing patches + for Linux. + :vartype classifications_to_include: list[str or + ~azure.mgmt.hybridcompute.models.VMGuestPatchClassificationLinux] + :ivar package_name_masks_to_include: packages to include in the patch operation. Format: + packageName_packageVersion. + :vartype package_name_masks_to_include: list[str] + :ivar package_name_masks_to_exclude: packages to exclude in the patch operation. Format: + packageName_packageVersion. + :vartype package_name_masks_to_exclude: list[str] + """ + _attribute_map = { + "classifications_to_include": {"key": "classificationsToInclude", "type": "[str]"}, + "package_name_masks_to_include": {"key": "packageNameMasksToInclude", "type": "[str]"}, + "package_name_masks_to_exclude": {"key": "packageNameMasksToExclude", "type": "[str]"}, + } -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. + def __init__( + self, + *, + classifications_to_include: Optional[List[Union[str, "_models.VMGuestPatchClassificationLinux"]]] = None, + package_name_masks_to_include: Optional[List[str]] = None, + package_name_masks_to_exclude: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword classifications_to_include: The update classifications to select when installing + patches for Linux. + :paramtype classifications_to_include: list[str or + ~azure.mgmt.hybridcompute.models.VMGuestPatchClassificationLinux] + :keyword package_name_masks_to_include: packages to include in the patch operation. Format: + packageName_packageVersion. + :paramtype package_name_masks_to_include: list[str] + :keyword package_name_masks_to_exclude: packages to exclude in the patch operation. Format: + packageName_packageVersion. + :paramtype package_name_masks_to_exclude: list[str] + """ + super().__init__(**kwargs) + self.classifications_to_include = classifications_to_include + self.package_name_masks_to_include = package_name_masks_to_include + self.package_name_masks_to_exclude = package_name_masks_to_exclude - Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. +class LocationData(_serialization.Model): + """Metadata pertaining to the geographic location of the resource. + + All required parameters must be populated in order to send to Azure. + + :ivar name: A canonical name for the geographic or physical location. Required. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str + :ivar city: The city or locality where the resource is located. + :vartype city: str + :ivar district: The district, state, or province where the resource is located. + :vartype district: str + :ivar country_or_region: The country or region where the resource is located. + :vartype country_or_region: str """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, + "name": {"required": True, "max_length": 256}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, + "city": {"key": "city", "type": "str"}, + "district": {"key": "district", "type": "str"}, + "country_or_region": {"key": "countryOrRegion", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + name: str, + city: Optional[str] = None, + district: Optional[str] = None, + country_or_region: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: A canonical name for the geographic or physical location. Required. + :paramtype name: str + :keyword city: The city or locality where the resource is located. + :paramtype city: str + :keyword district: The district, state, or province where the resource is located. + :paramtype district: str + :keyword country_or_region: The country or region where the resource is located. + :paramtype country_or_region: str + """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.name = name + self.city = city + self.district = district + self.country_or_region = country_or_region class TrackedResource(Resource): @@ -628,6 +1021,9 @@ class TrackedResource(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -638,6 +1034,7 @@ class TrackedResource(Resource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "location": {"required": True}, } @@ -645,6 +1042,7 @@ class TrackedResource(Resource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, } @@ -661,7 +1059,7 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw self.location = location -class Machine(TrackedResource): +class Machine(TrackedResource): # pylint: disable=too-many-instance-attributes """Describes a hybrid machine. Variables are only populated by the server, and will be ignored when sending a request. @@ -676,44 +1074,162 @@ class Machine(TrackedResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar properties: Hybrid Compute Machine properties. - :vartype properties: ~azure.mgmt.hybridcompute.models.MachineProperties + :ivar resources: The list of extensions affiliated to the machine. + :vartype resources: list[~azure.mgmt.hybridcompute.models.MachineExtension] :ivar identity: Identity for the resource. :vartype identity: ~azure.mgmt.hybridcompute.models.Identity - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar location_data: Metadata pertaining to the geographic location of the resource. + :vartype location_data: ~azure.mgmt.hybridcompute.models.LocationData + :ivar agent_configuration: Configurable properties that the user can set locally via the + azcmagent config command, or remotely via ARM. + :vartype agent_configuration: ~azure.mgmt.hybridcompute.models.AgentConfiguration + :ivar service_statuses: Statuses of dependent services that are reported back to ARM. + :vartype service_statuses: ~azure.mgmt.hybridcompute.models.ServiceStatuses + :ivar cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + :vartype cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata + :ivar agent_upgrade: The info of the machine w.r.t Agent Upgrade. + :vartype agent_upgrade: ~azure.mgmt.hybridcompute.models.AgentUpgrade + :ivar os_profile: Specifies the operating system settings for the hybrid machine. + :vartype os_profile: ~azure.mgmt.hybridcompute.models.OSProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar status: The status of the hybrid machine agent. Known values are: "Connected", + "Disconnected", and "Error". + :vartype status: str or ~azure.mgmt.hybridcompute.models.StatusTypes + :ivar last_status_change: The time of the last status change. + :vartype last_status_change: ~datetime.datetime + :ivar error_details: Details about the error state. + :vartype error_details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] + :ivar agent_version: The hybrid machine agent full version. + :vartype agent_version: str + :ivar vm_id: Specifies the hybrid machine unique ID. + :vartype vm_id: str + :ivar display_name: Specifies the hybrid machine display name. + :vartype display_name: str + :ivar machine_fqdn: Specifies the hybrid machine FQDN. + :vartype machine_fqdn: str + :ivar client_public_key: Public Key that the client provides to be used during initial resource + onboarding. + :vartype client_public_key: str + :ivar os_name: The Operating System running on the hybrid machine. + :vartype os_name: str + :ivar os_version: The version of Operating System running on the hybrid machine. + :vartype os_version: str + :ivar os_type: The type of Operating System (windows/linux). + :vartype os_type: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. + :vartype vm_uuid: str + :ivar extensions: Machine Extensions information (deprecated field). + :vartype extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + :ivar private_link_scope_resource_id: The resource id of the private link scope this machine is + assigned to, if any. + :vartype private_link_scope_resource_id: str + :ivar parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this + machine is assigned to, if any. + :vartype parent_cluster_resource_id: str + :ivar mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. + :vartype mssql_discovered: str + :ivar detected_properties: Detected properties from the machine. + :vartype detected_properties: dict[str, str] """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "location": {"required": True}, "system_data": {"readonly": True}, + "location": {"required": True}, + "resources": {"readonly": True}, + "agent_configuration": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "status": {"readonly": True}, + "last_status_change": {"readonly": True}, + "error_details": {"readonly": True}, + "agent_version": {"readonly": True}, + "display_name": {"readonly": True}, + "machine_fqdn": {"readonly": True}, + "os_name": {"readonly": True}, + "os_version": {"readonly": True}, + "vm_uuid": {"readonly": True}, + "os_sku": {"readonly": True}, + "domain_name": {"readonly": True}, + "ad_fqdn": {"readonly": True}, + "dns_fqdn": {"readonly": True}, + "detected_properties": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "MachineProperties"}, + "resources": {"key": "resources", "type": "[MachineExtension]"}, "identity": {"key": "identity", "type": "Identity"}, - "system_data": {"key": "systemData", "type": "SystemData"}, + "location_data": {"key": "properties.locationData", "type": "LocationData"}, + "agent_configuration": {"key": "properties.agentConfiguration", "type": "AgentConfiguration"}, + "service_statuses": {"key": "properties.serviceStatuses", "type": "ServiceStatuses"}, + "cloud_metadata": {"key": "properties.cloudMetadata", "type": "CloudMetadata"}, + "agent_upgrade": {"key": "properties.agentUpgrade", "type": "AgentUpgrade"}, + "os_profile": {"key": "properties.osProfile", "type": "OSProfile"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, + "last_status_change": {"key": "properties.lastStatusChange", "type": "iso-8601"}, + "error_details": {"key": "properties.errorDetails", "type": "[ErrorDetail]"}, + "agent_version": {"key": "properties.agentVersion", "type": "str"}, + "vm_id": {"key": "properties.vmId", "type": "str"}, + "display_name": {"key": "properties.displayName", "type": "str"}, + "machine_fqdn": {"key": "properties.machineFqdn", "type": "str"}, + "client_public_key": {"key": "properties.clientPublicKey", "type": "str"}, + "os_name": {"key": "properties.osName", "type": "str"}, + "os_version": {"key": "properties.osVersion", "type": "str"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "vm_uuid": {"key": "properties.vmUuid", "type": "str"}, + "extensions": {"key": "properties.extensions", "type": "[MachineExtensionInstanceView]"}, + "os_sku": {"key": "properties.osSku", "type": "str"}, + "domain_name": {"key": "properties.domainName", "type": "str"}, + "ad_fqdn": {"key": "properties.adFqdn", "type": "str"}, + "dns_fqdn": {"key": "properties.dnsFqdn", "type": "str"}, + "private_link_scope_resource_id": {"key": "properties.privateLinkScopeResourceId", "type": "str"}, + "parent_cluster_resource_id": {"key": "properties.parentClusterResourceId", "type": "str"}, + "mssql_discovered": {"key": "properties.mssqlDiscovered", "type": "str"}, + "detected_properties": {"key": "properties.detectedProperties", "type": "{str}"}, } - def __init__( + def __init__( # pylint: disable=too-many-locals self, *, location: str, tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.MachineProperties"] = None, identity: Optional["_models.Identity"] = None, + location_data: Optional["_models.LocationData"] = None, + service_statuses: Optional["_models.ServiceStatuses"] = None, + cloud_metadata: Optional["_models.CloudMetadata"] = None, + agent_upgrade: Optional["_models.AgentUpgrade"] = None, + os_profile: Optional["_models.OSProfile"] = None, + vm_id: Optional[str] = None, + client_public_key: Optional[str] = None, + os_type: Optional[str] = None, + extensions: Optional[List["_models.MachineExtensionInstanceView"]] = None, + private_link_scope_resource_id: Optional[str] = None, + parent_cluster_resource_id: Optional[str] = None, + mssql_discovered: Optional[str] = None, **kwargs: Any ) -> None: """ @@ -721,18 +1237,161 @@ def __init__( :paramtype tags: dict[str, str] :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword properties: Hybrid Compute Machine properties. - :paramtype properties: ~azure.mgmt.hybridcompute.models.MachineProperties :keyword identity: Identity for the resource. :paramtype identity: ~azure.mgmt.hybridcompute.models.Identity + :keyword location_data: Metadata pertaining to the geographic location of the resource. + :paramtype location_data: ~azure.mgmt.hybridcompute.models.LocationData + :keyword service_statuses: Statuses of dependent services that are reported back to ARM. + :paramtype service_statuses: ~azure.mgmt.hybridcompute.models.ServiceStatuses + :keyword cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + :paramtype cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata + :keyword agent_upgrade: The info of the machine w.r.t Agent Upgrade. + :paramtype agent_upgrade: ~azure.mgmt.hybridcompute.models.AgentUpgrade + :keyword os_profile: Specifies the operating system settings for the hybrid machine. + :paramtype os_profile: ~azure.mgmt.hybridcompute.models.OSProfile + :keyword vm_id: Specifies the hybrid machine unique ID. + :paramtype vm_id: str + :keyword client_public_key: Public Key that the client provides to be used during initial + resource onboarding. + :paramtype client_public_key: str + :keyword os_type: The type of Operating System (windows/linux). + :paramtype os_type: str + :keyword extensions: Machine Extensions information (deprecated field). + :paramtype extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] + :keyword private_link_scope_resource_id: The resource id of the private link scope this machine + is assigned to, if any. + :paramtype private_link_scope_resource_id: str + :keyword parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this + machine is assigned to, if any. + :paramtype parent_cluster_resource_id: str + :keyword mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. + :paramtype mssql_discovered: str """ super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties + self.resources = None self.identity = identity - self.system_data = None + self.location_data = location_data + self.agent_configuration = None + self.service_statuses = service_statuses + self.cloud_metadata = cloud_metadata + self.agent_upgrade = agent_upgrade + self.os_profile = os_profile + self.provisioning_state = None + self.status = None + self.last_status_change = None + self.error_details = None + self.agent_version = None + self.vm_id = vm_id + self.display_name = None + self.machine_fqdn = None + self.client_public_key = client_public_key + self.os_name = None + self.os_version = None + self.os_type = os_type + self.vm_uuid = None + self.extensions = extensions + self.os_sku = None + self.domain_name = None + self.ad_fqdn = None + self.dns_fqdn = None + self.private_link_scope_resource_id = private_link_scope_resource_id + self.parent_cluster_resource_id = parent_cluster_resource_id + self.mssql_discovered = mssql_discovered + self.detected_properties = None + + +class MachineAssessPatchesResult(_serialization.Model): + """Describes the properties of an AssessPatches result. + + Variables are only populated by the server, and will be ignored when sending a request. + :ivar status: The overall success or failure status of the operation. It remains "InProgress" + until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", + or "CompletedWithWarnings.". Known values are: "Unknown", "InProgress", "Failed", "Succeeded", + and "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.hybridcompute.models.PatchOperationStatus + :ivar assessment_activity_id: The activity ID of the operation that produced this result. + :vartype assessment_activity_id: str + :ivar reboot_pending: The overall reboot status of the VM. It will be true when partially + installed patches require a reboot to complete installation but the reboot has not yet + occurred. + :vartype reboot_pending: bool + :ivar available_patch_count_by_classification: Summarization of patches available for + installation on the machine by classification. + :vartype available_patch_count_by_classification: + ~azure.mgmt.hybridcompute.models.AvailablePatchCountByClassification + :ivar start_date_time: The UTC timestamp when the operation began. + :vartype start_date_time: ~datetime.datetime + :ivar last_modified_date_time: The UTC timestamp when the operation finished. + :vartype last_modified_date_time: ~datetime.datetime + :ivar started_by: Indicates if operation was triggered by user or by platform. Known values + are: "User" and "Platform". + :vartype started_by: str or ~azure.mgmt.hybridcompute.models.PatchOperationStartedBy + :ivar patch_service_used: Specifies the patch service used for the operation. Known values are: + "Unknown", "WU", "WU_WSUS", "YUM", "APT", and "Zypper". + :vartype patch_service_used: str or ~azure.mgmt.hybridcompute.models.PatchServiceUsed + :ivar os_type: The operating system type of the machine. Known values are: "Windows" and + "Linux". + :vartype os_type: str or ~azure.mgmt.hybridcompute.models.OsType + :ivar error_details: The errors that were encountered during execution of the operation. The + details array contains the list of them. + :vartype error_details: ~azure.mgmt.hybridcompute.models.ErrorDetail + """ + + _validation = { + "status": {"readonly": True}, + "assessment_activity_id": {"readonly": True}, + "reboot_pending": {"readonly": True}, + "start_date_time": {"readonly": True}, + "last_modified_date_time": {"readonly": True}, + "started_by": {"readonly": True}, + "patch_service_used": {"readonly": True}, + "os_type": {"readonly": True}, + "error_details": {"readonly": True}, + } + + _attribute_map = { + "status": {"key": "status", "type": "str"}, + "assessment_activity_id": {"key": "assessmentActivityId", "type": "str"}, + "reboot_pending": {"key": "rebootPending", "type": "bool"}, + "available_patch_count_by_classification": { + "key": "availablePatchCountByClassification", + "type": "AvailablePatchCountByClassification", + }, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "last_modified_date_time": {"key": "lastModifiedDateTime", "type": "iso-8601"}, + "started_by": {"key": "startedBy", "type": "str"}, + "patch_service_used": {"key": "patchServiceUsed", "type": "str"}, + "os_type": {"key": "osType", "type": "str"}, + "error_details": {"key": "errorDetails", "type": "ErrorDetail"}, + } -class MachineExtension(TrackedResource): + def __init__( + self, + *, + available_patch_count_by_classification: Optional["_models.AvailablePatchCountByClassification"] = None, + **kwargs: Any + ) -> None: + """ + :keyword available_patch_count_by_classification: Summarization of patches available for + installation on the machine by classification. + :paramtype available_patch_count_by_classification: + ~azure.mgmt.hybridcompute.models.AvailablePatchCountByClassification + """ + super().__init__(**kwargs) + self.status = None + self.assessment_activity_id = None + self.reboot_pending = None + self.available_patch_count_by_classification = available_patch_count_by_classification + self.start_date_time = None + self.last_modified_date_time = None + self.started_by = None + self.patch_service_used = None + self.os_type = None + self.error_details = None + + +class MachineExtension(TrackedResource): # pylint: disable=too-many-instance-attributes """Describes a Machine Extension. Variables are only populated by the server, and will be ignored when sending a request. @@ -747,32 +1406,67 @@ class MachineExtension(TrackedResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar properties: Describes Machine Extension Properties. - :vartype properties: ~azure.mgmt.hybridcompute.models.MachineExtensionProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :vartype force_update_tag: str + :ivar publisher: The name of the extension handler publisher. + :vartype publisher: str + :ivar type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :vartype type_properties_type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :ivar enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :vartype enable_automatic_upgrade: bool + :ivar auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :vartype auto_upgrade_minor_version: bool + :ivar settings: Json formatted public settings for the extension. + :vartype settings: dict[str, any] + :ivar protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :vartype protected_settings: dict[str, any] + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The machine extension instance view. + :vartype instance_view: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "location": {"required": True}, "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "MachineExtensionProperties"}, - "system_data": {"key": "systemData", "type": "SystemData"}, + "force_update_tag": {"key": "properties.forceUpdateTag", "type": "str"}, + "publisher": {"key": "properties.publisher", "type": "str"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + "type_handler_version": {"key": "properties.typeHandlerVersion", "type": "str"}, + "enable_automatic_upgrade": {"key": "properties.enableAutomaticUpgrade", "type": "bool"}, + "auto_upgrade_minor_version": {"key": "properties.autoUpgradeMinorVersion", "type": "bool"}, + "settings": {"key": "properties.settings", "type": "{object}"}, + "protected_settings": {"key": "properties.protectedSettings", "type": "{object}"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "instance_view": {"key": "properties.instanceView", "type": "MachineExtensionInstanceView"}, } def __init__( @@ -780,7 +1474,15 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.MachineExtensionProperties"] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type_properties_type: Optional[str] = None, + type_handler_version: Optional[str] = None, + enable_automatic_upgrade: Optional[bool] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[Dict[str, Any]] = None, + protected_settings: Optional[Dict[str, Any]] = None, + instance_view: Optional["_models.MachineExtensionInstanceView"] = None, **kwargs: Any ) -> None: """ @@ -788,12 +1490,42 @@ def __init__( :paramtype tags: dict[str, str] :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword properties: Describes Machine Extension Properties. - :paramtype properties: ~azure.mgmt.hybridcompute.models.MachineExtensionProperties + :keyword force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :paramtype force_update_tag: str + :keyword publisher: The name of the extension handler publisher. + :paramtype publisher: str + :keyword type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :paramtype type_properties_type: str + :keyword type_handler_version: Specifies the version of the script handler. + :paramtype type_handler_version: str + :keyword enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :paramtype enable_automatic_upgrade: bool + :keyword auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :paramtype auto_upgrade_minor_version: bool + :keyword settings: Json formatted public settings for the extension. + :paramtype settings: dict[str, any] + :keyword protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :paramtype protected_settings: dict[str, any] + :keyword instance_view: The machine extension instance view. + :paramtype instance_view: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView """ super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - self.system_data = None + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type_properties_type = type_properties_type + self.type_handler_version = type_handler_version + self.enable_automatic_upgrade = enable_automatic_upgrade + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view class MachineExtensionInstanceView(_serialization.Model): @@ -895,107 +1627,6 @@ def __init__( self.time = time -class MachineExtensionProperties(_serialization.Model): - """Describes the properties of a Machine Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :vartype force_update_tag: str - :ivar publisher: The name of the extension handler publisher. - :vartype publisher: str - :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". - :vartype type: str - :ivar type_handler_version: Specifies the version of the script handler. - :vartype type_handler_version: str - :ivar enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :vartype enable_automatic_upgrade: bool - :ivar auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :vartype auto_upgrade_minor_version: bool - :ivar settings: Json formatted public settings for the extension. - :vartype settings: JSON - :ivar protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :vartype protected_settings: JSON - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str - :ivar instance_view: The machine extension instance view. - :vartype instance_view: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView - """ - - _validation = { - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "force_update_tag": {"key": "forceUpdateTag", "type": "str"}, - "publisher": {"key": "publisher", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "type_handler_version": {"key": "typeHandlerVersion", "type": "str"}, - "enable_automatic_upgrade": {"key": "enableAutomaticUpgrade", "type": "bool"}, - "auto_upgrade_minor_version": {"key": "autoUpgradeMinorVersion", "type": "bool"}, - "settings": {"key": "settings", "type": "object"}, - "protected_settings": {"key": "protectedSettings", "type": "object"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "instance_view": {"key": "instanceView", "type": "MachineExtensionInstanceView"}, - } - - def __init__( - self, - *, - force_update_tag: Optional[str] = None, - publisher: Optional[str] = None, - type: Optional[str] = None, - type_handler_version: Optional[str] = None, - enable_automatic_upgrade: Optional[bool] = None, - auto_upgrade_minor_version: Optional[bool] = None, - settings: Optional[JSON] = None, - protected_settings: Optional[JSON] = None, - instance_view: Optional["_models.MachineExtensionInstanceView"] = None, - **kwargs: Any - ) -> None: - """ - :keyword force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :paramtype force_update_tag: str - :keyword publisher: The name of the extension handler publisher. - :paramtype publisher: str - :keyword type: Specifies the type of the extension; an example is "CustomScriptExtension". - :paramtype type: str - :keyword type_handler_version: Specifies the version of the script handler. - :paramtype type_handler_version: str - :keyword enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :paramtype enable_automatic_upgrade: bool - :keyword auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :paramtype auto_upgrade_minor_version: bool - :keyword settings: Json formatted public settings for the extension. - :paramtype settings: JSON - :keyword protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :paramtype protected_settings: JSON - :keyword instance_view: The machine extension instance view. - :paramtype instance_view: ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView - """ - super().__init__(**kwargs) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.type = type - self.type_handler_version = type_handler_version - self.enable_automatic_upgrade = enable_automatic_upgrade - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings - self.provisioning_state = None - self.instance_view = instance_view - - class MachineExtensionsListResult(_serialization.Model): """Describes the Machine Extensions List Result. @@ -1055,35 +1686,6 @@ class MachineExtensionUpdate(ResourceUpdate): :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar properties: Describes Machine Extension Update Properties. - :vartype properties: ~azure.mgmt.hybridcompute.models.MachineExtensionUpdateProperties - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "MachineExtensionUpdateProperties"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.MachineExtensionUpdateProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: Describes Machine Extension Update Properties. - :paramtype properties: ~azure.mgmt.hybridcompute.models.MachineExtensionUpdateProperties - """ - super().__init__(tags=tags, **kwargs) - self.properties = properties - - -class MachineExtensionUpdateProperties(_serialization.Model): - """Describes the properties of a Machine Extension. - :ivar force_update_tag: How the extension handler should be forced to update even if the extension configuration has not changed. :vartype force_update_tag: str @@ -1093,40 +1695,49 @@ class MachineExtensionUpdateProperties(_serialization.Model): :vartype type: str :ivar type_handler_version: Specifies the version of the script handler. :vartype type_handler_version: str + :ivar enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :vartype enable_automatic_upgrade: bool :ivar auto_upgrade_minor_version: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. :vartype auto_upgrade_minor_version: bool :ivar settings: Json formatted public settings for the extension. - :vartype settings: JSON + :vartype settings: dict[str, any] :ivar protected_settings: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - :vartype protected_settings: JSON + :vartype protected_settings: dict[str, any] """ _attribute_map = { - "force_update_tag": {"key": "forceUpdateTag", "type": "str"}, - "publisher": {"key": "publisher", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "type_handler_version": {"key": "typeHandlerVersion", "type": "str"}, - "auto_upgrade_minor_version": {"key": "autoUpgradeMinorVersion", "type": "bool"}, - "settings": {"key": "settings", "type": "object"}, - "protected_settings": {"key": "protectedSettings", "type": "object"}, + "tags": {"key": "tags", "type": "{str}"}, + "force_update_tag": {"key": "properties.forceUpdateTag", "type": "str"}, + "publisher": {"key": "properties.publisher", "type": "str"}, + "type": {"key": "properties.type", "type": "str"}, + "type_handler_version": {"key": "properties.typeHandlerVersion", "type": "str"}, + "enable_automatic_upgrade": {"key": "properties.enableAutomaticUpgrade", "type": "bool"}, + "auto_upgrade_minor_version": {"key": "properties.autoUpgradeMinorVersion", "type": "bool"}, + "settings": {"key": "properties.settings", "type": "{object}"}, + "protected_settings": {"key": "properties.protectedSettings", "type": "{object}"}, } def __init__( self, *, + tags: Optional[Dict[str, str]] = None, force_update_tag: Optional[str] = None, publisher: Optional[str] = None, type: Optional[str] = None, type_handler_version: Optional[str] = None, + enable_automatic_upgrade: Optional[bool] = None, auto_upgrade_minor_version: Optional[bool] = None, - settings: Optional[JSON] = None, - protected_settings: Optional[JSON] = None, + settings: Optional[Dict[str, Any]] = None, + protected_settings: Optional[Dict[str, Any]] = None, **kwargs: Any ) -> None: """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] :keyword force_update_tag: How the extension handler should be forced to update even if the extension configuration has not changed. :paramtype force_update_tag: str @@ -1136,21 +1747,25 @@ def __init__( :paramtype type: str :keyword type_handler_version: Specifies the version of the script handler. :paramtype type_handler_version: str + :keyword enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :paramtype enable_automatic_upgrade: bool :keyword auto_upgrade_minor_version: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. :paramtype auto_upgrade_minor_version: bool :keyword settings: Json formatted public settings for the extension. - :paramtype settings: JSON + :paramtype settings: dict[str, any] :keyword protected_settings: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - :paramtype protected_settings: JSON + :paramtype protected_settings: dict[str, any] """ - super().__init__(**kwargs) + super().__init__(tags=tags, **kwargs) self.force_update_tag = force_update_tag self.publisher = publisher self.type = type self.type_handler_version = type_handler_version + self.enable_automatic_upgrade = enable_automatic_upgrade self.auto_upgrade_minor_version = auto_upgrade_minor_version self.settings = settings self.protected_settings = protected_settings @@ -1180,275 +1795,223 @@ def __init__( self.extension_targets = extension_targets -class MachineListResult(_serialization.Model): - """The List hybrid machine operation response. +class MachineInstallPatchesParameters(_serialization.Model): + """Input for InstallPatches as directly received by the API. All required parameters must be populated in order to send to Azure. - :ivar value: The list of hybrid machines. Required. - :vartype value: list[~azure.mgmt.hybridcompute.models.Machine] - :ivar next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI to - fetch the next page of hybrid machines. - :vartype next_link: str + :ivar maximum_duration: Specifies the maximum amount of time that the operation will run. It + must be an ISO 8601-compliant duration string such as PT4H (4 hours). Required. + :vartype maximum_duration: str + :ivar reboot_setting: Defines when it is acceptable to reboot a VM during a software update + operation. Required. Known values are: "IfRequired", "Never", and "Always". + :vartype reboot_setting: str or ~azure.mgmt.hybridcompute.models.VMGuestPatchRebootSetting + :ivar windows_parameters: Input for InstallPatches on a Windows VM, as directly received by the + API. + :vartype windows_parameters: ~azure.mgmt.hybridcompute.models.WindowsParameters + :ivar linux_parameters: Input for InstallPatches on a Linux VM, as directly received by the + API. + :vartype linux_parameters: ~azure.mgmt.hybridcompute.models.LinuxParameters """ _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Machine]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "maximum_duration": {"required": True}, + "reboot_setting": {"required": True}, } - def __init__(self, *, value: List["_models.Machine"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of hybrid machines. Required. - :paramtype value: list[~azure.mgmt.hybridcompute.models.Machine] - :keyword next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI - to fetch the next page of hybrid machines. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class MachineProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Describes the properties of a hybrid machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location_data: Metadata pertaining to the geographic location of the resource. - :vartype location_data: ~azure.mgmt.hybridcompute.models.LocationData - :ivar agent_configuration: Configurable properties that the user can set locally via the - azcmagent config command, or remotely via ARM. - :vartype agent_configuration: ~azure.mgmt.hybridcompute.models.AgentConfiguration - :ivar service_statuses: Statuses of dependent services that are reported back to ARM. - :vartype service_statuses: ~azure.mgmt.hybridcompute.models.ServiceStatuses - :ivar cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - :vartype cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata - :ivar os_profile: Specifies the operating system settings for the hybrid machine. - :vartype os_profile: ~azure.mgmt.hybridcompute.models.OSProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str - :ivar status: The status of the hybrid machine agent. Known values are: "Connected", - "Disconnected", and "Error". - :vartype status: str or ~azure.mgmt.hybridcompute.models.StatusTypes - :ivar last_status_change: The time of the last status change. - :vartype last_status_change: ~datetime.datetime - :ivar error_details: Details about the error state. - :vartype error_details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] - :ivar agent_version: The hybrid machine agent full version. - :vartype agent_version: str - :ivar vm_id: Specifies the hybrid machine unique ID. - :vartype vm_id: str - :ivar display_name: Specifies the hybrid machine display name. - :vartype display_name: str - :ivar machine_fqdn: Specifies the hybrid machine FQDN. - :vartype machine_fqdn: str - :ivar client_public_key: Public Key that the client provides to be used during initial resource - onboarding. - :vartype client_public_key: str - :ivar os_name: The Operating System running on the hybrid machine. - :vartype os_name: str - :ivar os_version: The version of Operating System running on the hybrid machine. - :vartype os_version: str - :ivar os_type: The type of Operating System (windows/linux). - :vartype os_type: str - :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. - :vartype vm_uuid: str - :ivar extensions: Machine Extensions information. - :vartype extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] - :ivar os_sku: Specifies the Operating System product SKU. - :vartype os_sku: str - :ivar domain_name: Specifies the Windows domain name. - :vartype domain_name: str - :ivar ad_fqdn: Specifies the AD fully qualified display name. - :vartype ad_fqdn: str - :ivar dns_fqdn: Specifies the DNS fully qualified display name. - :vartype dns_fqdn: str - :ivar private_link_scope_resource_id: The resource id of the private link scope this machine is - assigned to, if any. - :vartype private_link_scope_resource_id: str - :ivar parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this - machine is assigned to, if any. - :vartype parent_cluster_resource_id: str - :ivar mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. - :vartype mssql_discovered: str - :ivar detected_properties: Detected properties from the machine. - :vartype detected_properties: dict[str, str] + _attribute_map = { + "maximum_duration": {"key": "maximumDuration", "type": "str"}, + "reboot_setting": {"key": "rebootSetting", "type": "str"}, + "windows_parameters": {"key": "windowsParameters", "type": "WindowsParameters"}, + "linux_parameters": {"key": "linuxParameters", "type": "LinuxParameters"}, + } + + def __init__( + self, + *, + maximum_duration: str, + reboot_setting: Union[str, "_models.VMGuestPatchRebootSetting"], + windows_parameters: Optional["_models.WindowsParameters"] = None, + linux_parameters: Optional["_models.LinuxParameters"] = None, + **kwargs: Any + ) -> None: + """ + :keyword maximum_duration: Specifies the maximum amount of time that the operation will run. It + must be an ISO 8601-compliant duration string such as PT4H (4 hours). Required. + :paramtype maximum_duration: str + :keyword reboot_setting: Defines when it is acceptable to reboot a VM during a software update + operation. Required. Known values are: "IfRequired", "Never", and "Always". + :paramtype reboot_setting: str or ~azure.mgmt.hybridcompute.models.VMGuestPatchRebootSetting + :keyword windows_parameters: Input for InstallPatches on a Windows VM, as directly received by + the API. + :paramtype windows_parameters: ~azure.mgmt.hybridcompute.models.WindowsParameters + :keyword linux_parameters: Input for InstallPatches on a Linux VM, as directly received by the + API. + :paramtype linux_parameters: ~azure.mgmt.hybridcompute.models.LinuxParameters + """ + super().__init__(**kwargs) + self.maximum_duration = maximum_duration + self.reboot_setting = reboot_setting + self.windows_parameters = windows_parameters + self.linux_parameters = linux_parameters + + +class MachineInstallPatchesResult(_serialization.Model): # pylint: disable=too-many-instance-attributes + """The result summary of an installation operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The overall success or failure status of the operation. It remains "InProgress" + until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or + "CompletedWithWarnings.". Known values are: "Unknown", "InProgress", "Failed", "Succeeded", and + "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.hybridcompute.models.PatchOperationStatus + :ivar installation_activity_id: The activity ID of the operation that produced this result. + :vartype installation_activity_id: str + :ivar reboot_status: The reboot state of the VM following completion of the operation. Known + values are: "Unknown", "NotNeeded", "Required", "Started", "Failed", and "Completed". + :vartype reboot_status: str or ~azure.mgmt.hybridcompute.models.VMGuestPatchRebootStatus + :ivar maintenance_window_exceeded: Whether the operation ran out of time before it completed + all its intended actions. + :vartype maintenance_window_exceeded: bool + :ivar excluded_patch_count: The number of patches that were not installed due to the user + blocking their installation. + :vartype excluded_patch_count: int + :ivar not_selected_patch_count: The number of patches that were detected as available for + install, but did not meet the operation's criteria. + :vartype not_selected_patch_count: int + :ivar pending_patch_count: The number of patches that were identified as meeting the + installation criteria, but were not able to be installed. Typically this happens when + maintenanceWindowExceeded == true. + :vartype pending_patch_count: int + :ivar installed_patch_count: The number of patches successfully installed. + :vartype installed_patch_count: int + :ivar failed_patch_count: The number of patches that could not be installed due to some issue. + See errors for details. + :vartype failed_patch_count: int + :ivar start_date_time: The UTC timestamp when the operation began. + :vartype start_date_time: ~datetime.datetime + :ivar last_modified_date_time: The UTC timestamp when the operation finished. + :vartype last_modified_date_time: ~datetime.datetime + :ivar started_by: Indicates if operation was triggered by user or by platform. Known values + are: "User" and "Platform". + :vartype started_by: str or ~azure.mgmt.hybridcompute.models.PatchOperationStartedBy + :ivar patch_service_used: Specifies the patch service used for the operation. Known values are: + "Unknown", "WU", "WU_WSUS", "YUM", "APT", and "Zypper". + :vartype patch_service_used: str or ~azure.mgmt.hybridcompute.models.PatchServiceUsed + :ivar os_type: The operating system type of the machine. Known values are: "Windows" and + "Linux". + :vartype os_type: str or ~azure.mgmt.hybridcompute.models.OsType + :ivar error_details: The errors that were encountered during execution of the operation. The + details array contains the list of them. + :vartype error_details: ~azure.mgmt.hybridcompute.models.ErrorDetail """ _validation = { - "agent_configuration": {"readonly": True}, - "provisioning_state": {"readonly": True}, "status": {"readonly": True}, - "last_status_change": {"readonly": True}, + "installation_activity_id": {"readonly": True}, + "reboot_status": {"readonly": True}, + "maintenance_window_exceeded": {"readonly": True}, + "excluded_patch_count": {"readonly": True}, + "not_selected_patch_count": {"readonly": True}, + "pending_patch_count": {"readonly": True}, + "installed_patch_count": {"readonly": True}, + "failed_patch_count": {"readonly": True}, + "start_date_time": {"readonly": True}, + "last_modified_date_time": {"readonly": True}, + "started_by": {"readonly": True}, + "patch_service_used": {"readonly": True}, + "os_type": {"readonly": True}, "error_details": {"readonly": True}, - "agent_version": {"readonly": True}, - "display_name": {"readonly": True}, - "machine_fqdn": {"readonly": True}, - "os_name": {"readonly": True}, - "os_version": {"readonly": True}, - "vm_uuid": {"readonly": True}, - "os_sku": {"readonly": True}, - "domain_name": {"readonly": True}, - "ad_fqdn": {"readonly": True}, - "dns_fqdn": {"readonly": True}, - "detected_properties": {"readonly": True}, } _attribute_map = { - "location_data": {"key": "locationData", "type": "LocationData"}, - "agent_configuration": {"key": "agentConfiguration", "type": "AgentConfiguration"}, - "service_statuses": {"key": "serviceStatuses", "type": "ServiceStatuses"}, - "cloud_metadata": {"key": "cloudMetadata", "type": "CloudMetadata"}, - "os_profile": {"key": "osProfile", "type": "OSProfile"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, "status": {"key": "status", "type": "str"}, - "last_status_change": {"key": "lastStatusChange", "type": "iso-8601"}, - "error_details": {"key": "errorDetails", "type": "[ErrorDetail]"}, - "agent_version": {"key": "agentVersion", "type": "str"}, - "vm_id": {"key": "vmId", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "machine_fqdn": {"key": "machineFqdn", "type": "str"}, - "client_public_key": {"key": "clientPublicKey", "type": "str"}, - "os_name": {"key": "osName", "type": "str"}, - "os_version": {"key": "osVersion", "type": "str"}, + "installation_activity_id": {"key": "installationActivityId", "type": "str"}, + "reboot_status": {"key": "rebootStatus", "type": "str"}, + "maintenance_window_exceeded": {"key": "maintenanceWindowExceeded", "type": "bool"}, + "excluded_patch_count": {"key": "excludedPatchCount", "type": "int"}, + "not_selected_patch_count": {"key": "notSelectedPatchCount", "type": "int"}, + "pending_patch_count": {"key": "pendingPatchCount", "type": "int"}, + "installed_patch_count": {"key": "installedPatchCount", "type": "int"}, + "failed_patch_count": {"key": "failedPatchCount", "type": "int"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "last_modified_date_time": {"key": "lastModifiedDateTime", "type": "iso-8601"}, + "started_by": {"key": "startedBy", "type": "str"}, + "patch_service_used": {"key": "patchServiceUsed", "type": "str"}, "os_type": {"key": "osType", "type": "str"}, - "vm_uuid": {"key": "vmUuid", "type": "str"}, - "extensions": {"key": "extensions", "type": "[MachineExtensionInstanceView]"}, - "os_sku": {"key": "osSku", "type": "str"}, - "domain_name": {"key": "domainName", "type": "str"}, - "ad_fqdn": {"key": "adFqdn", "type": "str"}, - "dns_fqdn": {"key": "dnsFqdn", "type": "str"}, - "private_link_scope_resource_id": {"key": "privateLinkScopeResourceId", "type": "str"}, - "parent_cluster_resource_id": {"key": "parentClusterResourceId", "type": "str"}, - "mssql_discovered": {"key": "mssqlDiscovered", "type": "str"}, - "detected_properties": {"key": "detectedProperties", "type": "{str}"}, + "error_details": {"key": "errorDetails", "type": "ErrorDetail"}, } - def __init__( # pylint: disable=too-many-locals - self, - *, - location_data: Optional["_models.LocationData"] = None, - service_statuses: Optional["_models.ServiceStatuses"] = None, - cloud_metadata: Optional["_models.CloudMetadata"] = None, - os_profile: Optional["_models.OSProfile"] = None, - vm_id: Optional[str] = None, - client_public_key: Optional[str] = None, - os_type: Optional[str] = None, - extensions: Optional[List["_models.MachineExtensionInstanceView"]] = None, - private_link_scope_resource_id: Optional[str] = None, - parent_cluster_resource_id: Optional[str] = None, - mssql_discovered: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword location_data: Metadata pertaining to the geographic location of the resource. - :paramtype location_data: ~azure.mgmt.hybridcompute.models.LocationData - :keyword service_statuses: Statuses of dependent services that are reported back to ARM. - :paramtype service_statuses: ~azure.mgmt.hybridcompute.models.ServiceStatuses - :keyword cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - :paramtype cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata - :keyword os_profile: Specifies the operating system settings for the hybrid machine. - :paramtype os_profile: ~azure.mgmt.hybridcompute.models.OSProfile - :keyword vm_id: Specifies the hybrid machine unique ID. - :paramtype vm_id: str - :keyword client_public_key: Public Key that the client provides to be used during initial - resource onboarding. - :paramtype client_public_key: str - :keyword os_type: The type of Operating System (windows/linux). - :paramtype os_type: str - :keyword extensions: Machine Extensions information. - :paramtype extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] - :keyword private_link_scope_resource_id: The resource id of the private link scope this machine - is assigned to, if any. - :paramtype private_link_scope_resource_id: str - :keyword parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this - machine is assigned to, if any. - :paramtype parent_cluster_resource_id: str - :keyword mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. - :paramtype mssql_discovered: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.location_data = location_data - self.agent_configuration = None - self.service_statuses = service_statuses - self.cloud_metadata = cloud_metadata - self.os_profile = os_profile - self.provisioning_state = None self.status = None - self.last_status_change = None + self.installation_activity_id = None + self.reboot_status = None + self.maintenance_window_exceeded = None + self.excluded_patch_count = None + self.not_selected_patch_count = None + self.pending_patch_count = None + self.installed_patch_count = None + self.failed_patch_count = None + self.start_date_time = None + self.last_modified_date_time = None + self.started_by = None + self.patch_service_used = None + self.os_type = None self.error_details = None - self.agent_version = None - self.vm_id = vm_id - self.display_name = None - self.machine_fqdn = None - self.client_public_key = client_public_key - self.os_name = None - self.os_version = None - self.os_type = os_type - self.vm_uuid = None - self.extensions = extensions - self.os_sku = None - self.domain_name = None - self.ad_fqdn = None - self.dns_fqdn = None - self.private_link_scope_resource_id = private_link_scope_resource_id - self.parent_cluster_resource_id = parent_cluster_resource_id - self.mssql_discovered = mssql_discovered - self.detected_properties = None -class MachineUpdate(ResourceUpdate): - """Describes a hybrid machine Update. +class MachineListResult(_serialization.Model): + """The List hybrid machine operation response. - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.hybridcompute.models.Identity - :ivar properties: Hybrid Compute Machine properties. - :vartype properties: ~azure.mgmt.hybridcompute.models.MachineUpdateProperties + All required parameters must be populated in order to send to Azure. + + :ivar value: The list of hybrid machines. Required. + :vartype value: list[~azure.mgmt.hybridcompute.models.Machine] + :ivar next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI to + fetch the next page of hybrid machines. + :vartype next_link: str """ + _validation = { + "value": {"required": True}, + } + _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "Identity"}, - "properties": {"key": "properties", "type": "MachineUpdateProperties"}, + "value": {"key": "value", "type": "[Machine]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.Identity"] = None, - properties: Optional["_models.MachineUpdateProperties"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, value: List["_models.Machine"], next_link: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.hybridcompute.models.Identity - :keyword properties: Hybrid Compute Machine properties. - :paramtype properties: ~azure.mgmt.hybridcompute.models.MachineUpdateProperties + :keyword value: The list of hybrid machines. Required. + :paramtype value: list[~azure.mgmt.hybridcompute.models.Machine] + :keyword next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI + to fetch the next page of hybrid machines. + :paramtype next_link: str """ - super().__init__(tags=tags, **kwargs) - self.identity = identity - self.properties = properties + super().__init__(**kwargs) + self.value = value + self.next_link = next_link -class MachineUpdateProperties(_serialization.Model): - """Describes the ARM updatable properties of a hybrid machine. +class MachineUpdate(ResourceUpdate): + """Describes a hybrid machine Update. + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.hybridcompute.models.Identity :ivar location_data: Metadata pertaining to the geographic location of the resource. :vartype location_data: ~azure.mgmt.hybridcompute.models.LocationData :ivar os_profile: Specifies the operating system settings for the hybrid machine. :vartype os_profile: ~azure.mgmt.hybridcompute.models.OSProfile :ivar cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). :vartype cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata + :ivar agent_upgrade: The info of the machine w.r.t Agent Upgrade. + :vartype agent_upgrade: ~azure.mgmt.hybridcompute.models.AgentUpgrade :ivar parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. :vartype parent_cluster_resource_id: str @@ -1458,30 +2021,42 @@ class MachineUpdateProperties(_serialization.Model): """ _attribute_map = { - "location_data": {"key": "locationData", "type": "LocationData"}, - "os_profile": {"key": "osProfile", "type": "OSProfile"}, - "cloud_metadata": {"key": "cloudMetadata", "type": "CloudMetadata"}, - "parent_cluster_resource_id": {"key": "parentClusterResourceId", "type": "str"}, - "private_link_scope_resource_id": {"key": "privateLinkScopeResourceId", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": {"key": "identity", "type": "Identity"}, + "location_data": {"key": "properties.locationData", "type": "LocationData"}, + "os_profile": {"key": "properties.osProfile", "type": "OSProfile"}, + "cloud_metadata": {"key": "properties.cloudMetadata", "type": "CloudMetadata"}, + "agent_upgrade": {"key": "properties.agentUpgrade", "type": "AgentUpgrade"}, + "parent_cluster_resource_id": {"key": "properties.parentClusterResourceId", "type": "str"}, + "private_link_scope_resource_id": {"key": "properties.privateLinkScopeResourceId", "type": "str"}, } def __init__( self, *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.Identity"] = None, location_data: Optional["_models.LocationData"] = None, os_profile: Optional["_models.OSProfile"] = None, cloud_metadata: Optional["_models.CloudMetadata"] = None, + agent_upgrade: Optional["_models.AgentUpgrade"] = None, parent_cluster_resource_id: Optional[str] = None, private_link_scope_resource_id: Optional[str] = None, **kwargs: Any ) -> None: """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.hybridcompute.models.Identity :keyword location_data: Metadata pertaining to the geographic location of the resource. :paramtype location_data: ~azure.mgmt.hybridcompute.models.LocationData :keyword os_profile: Specifies the operating system settings for the hybrid machine. :paramtype os_profile: ~azure.mgmt.hybridcompute.models.OSProfile :keyword cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). :paramtype cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata + :keyword agent_upgrade: The info of the machine w.r.t Agent Upgrade. + :paramtype agent_upgrade: ~azure.mgmt.hybridcompute.models.AgentUpgrade :keyword parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. :paramtype parent_cluster_resource_id: str @@ -1489,14 +2064,56 @@ def __init__( is assigned to, if any. :paramtype private_link_scope_resource_id: str """ - super().__init__(**kwargs) + super().__init__(tags=tags, **kwargs) + self.identity = identity self.location_data = location_data self.os_profile = os_profile self.cloud_metadata = cloud_metadata + self.agent_upgrade = agent_upgrade self.parent_cluster_resource_id = parent_cluster_resource_id self.private_link_scope_resource_id = private_link_scope_resource_id +class NetworkInterface(_serialization.Model): + """Describes a network interface. + + :ivar ip_addresses: The list of IP addresses in this interface. + :vartype ip_addresses: list[~azure.mgmt.hybridcompute.models.IpAddress] + """ + + _attribute_map = { + "ip_addresses": {"key": "ipAddresses", "type": "[IpAddress]"}, + } + + def __init__(self, *, ip_addresses: Optional[List["_models.IpAddress"]] = None, **kwargs: Any) -> None: + """ + :keyword ip_addresses: The list of IP addresses in this interface. + :paramtype ip_addresses: list[~azure.mgmt.hybridcompute.models.IpAddress] + """ + super().__init__(**kwargs) + self.ip_addresses = ip_addresses + + +class NetworkProfile(_serialization.Model): + """Describes the network information on this machine. + + :ivar network_interfaces: The list of network interfaces. + :vartype network_interfaces: list[~azure.mgmt.hybridcompute.models.NetworkInterface] + """ + + _attribute_map = { + "network_interfaces": {"key": "networkInterfaces", "type": "[NetworkInterface]"}, + } + + def __init__(self, *, network_interfaces: Optional[List["_models.NetworkInterface"]] = None, **kwargs: Any) -> None: + """ + :keyword network_interfaces: The list of network interfaces. + :paramtype network_interfaces: list[~azure.mgmt.hybridcompute.models.NetworkInterface] + """ + super().__init__(**kwargs) + self.network_interfaces = network_interfaces + + class OperationListResult(_serialization.Model): """The List Compute Operation operation response. @@ -1713,39 +2330,6 @@ def __init__( self.patch_mode = patch_mode -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - - class PrivateEndpointConnection(ProxyResource): """A private endpoint connection. @@ -1759,10 +2343,11 @@ class PrivateEndpointConnection(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData :ivar properties: Resource properties. :vartype properties: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -1776,8 +2361,8 @@ class PrivateEndpointConnection(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "properties": {"key": "properties", "type": "PrivateEndpointConnectionProperties"}, "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "PrivateEndpointConnectionProperties"}, } def __init__( @@ -1789,7 +2374,6 @@ def __init__( """ super().__init__(**kwargs) self.properties = properties - self.system_data = None class PrivateEndpointConnectionDataModel(_serialization.Model): @@ -1949,10 +2533,11 @@ class PrivateLinkResource(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData :ivar properties: Resource properties. :vartype properties: ~azure.mgmt.hybridcompute.models.PrivateLinkResourceProperties - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData """ _validation = { @@ -1966,8 +2551,8 @@ class PrivateLinkResource(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "properties": {"key": "properties", "type": "PrivateLinkResourceProperties"}, "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "PrivateLinkResourceProperties"}, } def __init__(self, *, properties: Optional["_models.PrivateLinkResourceProperties"] = None, **kwargs: Any) -> None: @@ -1977,7 +2562,6 @@ def __init__(self, *, properties: Optional["_models.PrivateLinkResourcePropertie """ super().__init__(**kwargs) self.properties = properties - self.system_data = None class PrivateLinkResourceListResult(_serialization.Model): @@ -2187,6 +2771,26 @@ def __init__( self.guest_configuration_service = guest_configuration_service +class Subnet(_serialization.Model): + """Describes the subnet. + + :ivar address_prefix: Represents address prefix. + :vartype address_prefix: str + """ + + _attribute_map = { + "address_prefix": {"key": "addressPrefix", "type": "str"}, + } + + def __init__(self, *, address_prefix: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword address_prefix: Represents address prefix. + :paramtype address_prefix: str + """ + super().__init__(**kwargs) + self.address_prefix = address_prefix + + class SystemData(_serialization.Model): """Metadata pertaining to creation and last modification of the resource. @@ -2270,3 +2874,64 @@ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> N """ super().__init__(**kwargs) self.tags = tags + + +class WindowsParameters(_serialization.Model): + """Input for InstallPatches on a Windows VM, as directly received by the API. + + :ivar classifications_to_include: The update classifications to select when installing patches + for Windows. + :vartype classifications_to_include: list[str or + ~azure.mgmt.hybridcompute.models.VMGuestPatchClassificationWindows] + :ivar kb_numbers_to_include: Kbs to include in the patch operation. + :vartype kb_numbers_to_include: list[str] + :ivar kb_numbers_to_exclude: Kbs to exclude in the patch operation. + :vartype kb_numbers_to_exclude: list[str] + :ivar exclude_kbs_requiring_reboot: Filters out Kbs that don't have an + InstallationRebootBehavior of 'NeverReboots' when this is set to true. + :vartype exclude_kbs_requiring_reboot: bool + :ivar max_patch_publish_date: This is used to install patches that were published on or before + this given max published date. + :vartype max_patch_publish_date: ~datetime.datetime + """ + + _attribute_map = { + "classifications_to_include": {"key": "classificationsToInclude", "type": "[str]"}, + "kb_numbers_to_include": {"key": "kbNumbersToInclude", "type": "[str]"}, + "kb_numbers_to_exclude": {"key": "kbNumbersToExclude", "type": "[str]"}, + "exclude_kbs_requiring_reboot": {"key": "excludeKbsRequiringReboot", "type": "bool"}, + "max_patch_publish_date": {"key": "maxPatchPublishDate", "type": "iso-8601"}, + } + + def __init__( + self, + *, + classifications_to_include: Optional[List[Union[str, "_models.VMGuestPatchClassificationWindows"]]] = None, + kb_numbers_to_include: Optional[List[str]] = None, + kb_numbers_to_exclude: Optional[List[str]] = None, + exclude_kbs_requiring_reboot: Optional[bool] = None, + max_patch_publish_date: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword classifications_to_include: The update classifications to select when installing + patches for Windows. + :paramtype classifications_to_include: list[str or + ~azure.mgmt.hybridcompute.models.VMGuestPatchClassificationWindows] + :keyword kb_numbers_to_include: Kbs to include in the patch operation. + :paramtype kb_numbers_to_include: list[str] + :keyword kb_numbers_to_exclude: Kbs to exclude in the patch operation. + :paramtype kb_numbers_to_exclude: list[str] + :keyword exclude_kbs_requiring_reboot: Filters out Kbs that don't have an + InstallationRebootBehavior of 'NeverReboots' when this is set to true. + :paramtype exclude_kbs_requiring_reboot: bool + :keyword max_patch_publish_date: This is used to install patches that were published on or + before this given max published date. + :paramtype max_patch_publish_date: ~datetime.datetime + """ + super().__init__(**kwargs) + self.classifications_to_include = classifications_to_include + self.kb_numbers_to_include = kb_numbers_to_include + self.kb_numbers_to_exclude = kb_numbers_to_exclude + self.exclude_kbs_requiring_reboot = exclude_kbs_requiring_reboot + self.max_patch_publish_date = max_patch_publish_date diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py index 4709c0d6c162..309238b771c8 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py @@ -9,7 +9,9 @@ from ._machines_operations import MachinesOperations from ._machine_extensions_operations import MachineExtensionsOperations from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin +from ._extension_metadata_operations import ExtensionMetadataOperations from ._operations import Operations +from ._network_profile_operations import NetworkProfileOperations from ._private_link_scopes_operations import PrivateLinkScopesOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations @@ -22,7 +24,9 @@ "MachinesOperations", "MachineExtensionsOperations", "HybridComputeManagementClientOperationsMixin", + "ExtensionMetadataOperations", "Operations", + "NetworkProfileOperations", "PrivateLinkScopesOperations", "PrivateLinkResourcesOperations", "PrivateEndpointConnectionsOperations", diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py new file mode 100644 index 000000000000..8e416cc20b6f --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py @@ -0,0 +1,294 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import HybridComputeManagementClientMixinABC, _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + location: str, publisher: str, extension_type: str, version: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "location": _SERIALIZER.url("location", location, "str"), + "publisher": _SERIALIZER.url("publisher", publisher, "str"), + "extensionType": _SERIALIZER.url("extension_type", extension_type, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + location: str, publisher: str, extension_type: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "location": _SERIALIZER.url("location", location, "str"), + "publisher": _SERIALIZER.url("publisher", publisher, "str"), + "extensionType": _SERIALIZER.url("extension_type", extension_type, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ExtensionMetadataOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`extension_metadata` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, location: str, publisher: str, extension_type: str, version: str, **kwargs: Any + ) -> _models.ExtensionValue: + """Gets an Extension Metadata based on location, publisher, extensionType and version. + + :param location: The location of the Extension being received. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :param version: The version of the Extension being received. Required. + :type version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExtensionValue or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.ExtensionValue + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.ExtensionValue] = kwargs.pop("cls", None) + + request = build_get_request( + location=location, + publisher=publisher, + extension_type=extension_type, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExtensionValue", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}" + } + + @distributed_trace + def list( + self, location: str, publisher: str, extension_type: str, **kwargs: Any + ) -> Iterable["_models.ExtensionValue"]: + """Gets all Extension versions based on location, publisher, extensionType. + + :param location: The location of the Extension being received. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionValue or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.ExtensionValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.ExtensionValueListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + location=location, + publisher=publisher, + extension_type=extension_type, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionValueListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions" + } diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py index 3bf746ea295b..47fafa2ec53e 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py @@ -47,7 +47,7 @@ def build_upgrade_extensions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -61,7 +61,9 @@ def build_upgrade_extensions_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "machineName": _SERIALIZER.url("machine_name", machine_name, "str"), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"[a-zA-Z0-9-_\.]" + ), } _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore @@ -96,7 +98,7 @@ def _upgrade_extensions_initial( # pylint: disable=inconsistent-return-statemen _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -125,8 +127,9 @@ def _upgrade_extensions_initial( # pylint: disable=inconsistent-return-statemen request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -136,8 +139,16 @@ def _upgrade_extensions_initial( # pylint: disable=inconsistent-return-statemen error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _upgrade_extensions_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions" @@ -231,7 +242,7 @@ def begin_upgrade_extensions( :param machine_name: The name of the hybrid machine. Required. :type machine_name: str :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Is either a model type or a IO type. Required. + Is either a MachineExtensionUpgrade type or a IO type. Required. :type extension_upgrade_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpgrade or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -252,7 +263,7 @@ def begin_upgrade_extensions( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py index 1362e42cc39a..e457dd1dd551 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py @@ -49,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -62,7 +62,9 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "machineName": _SERIALIZER.url("machine_name", machine_name, "str"), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"[a-zA-Z0-9-_\.]" + ), "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } @@ -86,7 +88,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -99,7 +101,9 @@ def build_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "machineName": _SERIALIZER.url("machine_name", machine_name, "str"), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"[a-zA-Z0-9-_\.]" + ), "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } @@ -123,7 +127,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +139,9 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "machineName": _SERIALIZER.url("machine_name", machine_name, "str"), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"[a-zA-Z0-9-_\.]" + ), "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } @@ -157,7 +163,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +175,9 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "machineName": _SERIALIZER.url("machine_name", machine_name, "str"), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"[a-zA-Z0-9-_\.]" + ), "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } @@ -191,7 +199,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +211,9 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "machineName": _SERIALIZER.url("machine_name", machine_name, "str"), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"[a-zA-Z0-9-_\.]" + ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } @@ -258,7 +268,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -288,8 +298,9 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -414,7 +425,7 @@ def begin_create_or_update( :param extension_name: The name of the machine extension. Required. :type extension_name: str :param extension_parameters: Parameters supplied to the Create Machine Extension operation. Is - either a model type or a IO type. Required. + either a MachineExtension type or a IO type. Required. :type extension_parameters: ~azure.mgmt.hybridcompute.models.MachineExtension or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -435,7 +446,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -502,7 +513,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -532,8 +543,9 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -544,11 +556,19 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize("MachineExtension", pipeline_response) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized @@ -658,7 +678,7 @@ def begin_update( :param extension_name: The name of the machine extension. Required. :type extension_name: str :param extension_parameters: Parameters supplied to the Create Machine Extension operation. Is - either a model type or a IO type. Required. + either a MachineExtensionUpdate type or a IO type. Required. :type extension_parameters: ~azure.mgmt.hybridcompute.models.MachineExtensionUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -679,7 +699,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -741,7 +761,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -759,8 +779,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -770,8 +791,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}" @@ -805,7 +834,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -877,7 +906,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MachineExtension] = kwargs.pop("cls", None) @@ -895,8 +924,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -938,7 +968,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MachineExtensionsListResult] = kwargs.pop("cls", None) @@ -995,8 +1025,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py index 9de684ceaf32..248ce9c89364 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -21,10 +21,12 @@ from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._serialization import Serializer @@ -47,7 +49,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +62,9 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "machineName": _SERIALIZER.url("machine_name", machine_name, "str"), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"[a-zA-Z0-9-_\.]" + ), } _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore @@ -85,7 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +102,9 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "machineName": _SERIALIZER.url("machine_name", machine_name, "str"), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"[a-zA-Z0-9-_\.]" + ), } _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore @@ -114,11 +120,76 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_assess_patches_request( + resource_group_name: str, name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_install_patches_request( + resource_group_name: str, name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +219,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +262,7 @@ def __init__(self, *args, **kwargs): def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, machine_name: str, **kwargs: Any ) -> None: - """The operation to remove a hybrid machine identity in Azure. + """The operation to delete a hybrid machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -214,7 +285,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -231,8 +302,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,7 +355,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Machine] = kwargs.pop("cls", None) @@ -301,8 +373,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -323,6 +396,376 @@ def get( "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}" } + def _assess_patches_initial( + self, resource_group_name: str, name: str, **kwargs: Any + ) -> Optional[_models.MachineAssessPatchesResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[Optional[_models.MachineAssessPatchesResult]] = kwargs.pop("cls", None) + + request = build_assess_patches_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._assess_patches_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("MachineAssessPatchesResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _assess_patches_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches" + } + + @distributed_trace + def begin_assess_patches( + self, resource_group_name: str, name: str, **kwargs: Any + ) -> LROPoller[_models.MachineAssessPatchesResult]: + """The operation to assess patches on a hybrid machine identity in Azure. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param name: The name of the hybrid machine. Required. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: 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 MachineAssessPatchesResult or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineAssessPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.MachineAssessPatchesResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._assess_patches_initial( + resource_group_name=resource_group_name, + name=name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MachineAssessPatchesResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_assess_patches.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches" + } + + def _install_patches_initial( + self, + resource_group_name: str, + name: str, + install_patches_input: Union[_models.MachineInstallPatchesParameters, IO], + **kwargs: Any + ) -> Optional[_models.MachineInstallPatchesResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MachineInstallPatchesResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(install_patches_input, (IO, bytes)): + _content = install_patches_input + else: + _json = self._serialize.body(install_patches_input, "MachineInstallPatchesParameters") + + request = build_install_patches_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._install_patches_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("MachineInstallPatchesResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _install_patches_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches" + } + + @overload + def begin_install_patches( + self, + resource_group_name: str, + name: str, + install_patches_input: _models.MachineInstallPatchesParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MachineInstallPatchesResult]: + """The operation to install patches on a hybrid machine identity in Azure. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param name: The name of the hybrid machine. Required. + :type name: str + :param install_patches_input: Input for InstallPatches as directly received by the API. + Required. + :type install_patches_input: ~azure.mgmt.hybridcompute.models.MachineInstallPatchesParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either MachineInstallPatchesResult or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineInstallPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_install_patches( + self, + resource_group_name: str, + name: str, + install_patches_input: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MachineInstallPatchesResult]: + """The operation to install patches on a hybrid machine identity in Azure. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param name: The name of the hybrid machine. Required. + :type name: str + :param install_patches_input: Input for InstallPatches as directly received by the API. + Required. + :type install_patches_input: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either MachineInstallPatchesResult or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineInstallPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_install_patches( + self, + resource_group_name: str, + name: str, + install_patches_input: Union[_models.MachineInstallPatchesParameters, IO], + **kwargs: Any + ) -> LROPoller[_models.MachineInstallPatchesResult]: + """The operation to install patches on a hybrid machine identity in Azure. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param name: The name of the hybrid machine. Required. + :type name: str + :param install_patches_input: Input for InstallPatches as directly received by the API. Is + either a MachineInstallPatchesParameters type or a IO type. Required. + :type install_patches_input: ~azure.mgmt.hybridcompute.models.MachineInstallPatchesParameters + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either MachineInstallPatchesResult or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineInstallPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MachineInstallPatchesResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._install_patches_initial( + resource_group_name=resource_group_name, + name=name, + install_patches_input=install_patches_input, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MachineInstallPatchesResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_install_patches.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches" + } + @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Machine"]: """Lists all the hybrid machines in the specified resource group. Use the nextLink property in the @@ -339,7 +782,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) @@ -394,8 +837,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -425,7 +869,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Machine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) @@ -479,8 +923,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py new file mode 100644 index 000000000000..aa854ef2cfb2 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py @@ -0,0 +1,157 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import HybridComputeManagementClientMixinABC, _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request(resource_group_name: str, machine_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/networkProfile", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"[a-zA-Z0-9-_\.]" + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class NetworkProfileOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`network_profile` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, machine_name: str, **kwargs: Any) -> _models.NetworkProfile: + """The operation to get network information of hybrid machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkProfile or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.NetworkProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-27"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.NetworkProfile] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/networkProfile" + } diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py index ac2c41358c96..7849ae5bec16 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py @@ -45,7 +45,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +91,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) @@ -144,8 +144,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py index 273666ba7307..d36683ea616d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py @@ -53,7 +53,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,7 +93,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +172,7 @@ def build_list_by_private_link_scope_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -247,7 +247,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) @@ -265,8 +265,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,7 +307,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -336,8 +337,9 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -458,7 +460,7 @@ def begin_create_or_update( :type scope_name: str :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str - :param parameters: Is either a model type or a IO type. Required. + :param parameters: Is either a PrivateEndpointConnection type or a IO type. Required. :type parameters: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -480,7 +482,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -542,7 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -560,8 +562,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -571,8 +574,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}" @@ -606,7 +617,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -670,7 +681,7 @@ def list_by_private_link_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) @@ -726,8 +737,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py index 1996f1c9bba4..871421fec0e0 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py @@ -47,7 +47,7 @@ def build_list_by_private_link_scope_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def list_by_private_link_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) @@ -202,8 +202,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -249,7 +250,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) @@ -267,8 +268,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py index f67a6360fb4c..838513e625c6 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py @@ -47,7 +47,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +103,7 @@ def build_delete_request(resource_group_name: str, scope_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_get_request(resource_group_name: str, scope_name: str, subscription_id _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +167,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -203,7 +203,7 @@ def build_update_tags_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -239,7 +239,7 @@ def build_get_validation_details_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,7 +270,7 @@ def build_get_validation_details_for_machine_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-10")) + api_version: Literal["2022-12-27"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -330,7 +330,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.HybridComputePrivateLinkScope _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.HybridComputePrivateLinkScopeListResult] = kwargs.pop("cls", None) @@ -384,8 +384,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,7 +420,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.HybridComputePrivateLinkScopeListResult] = kwargs.pop("cls", None) @@ -474,8 +475,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -506,7 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -523,8 +525,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -534,8 +537,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _delete_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}" @@ -565,7 +576,7 @@ def begin_delete(self, resource_group_name: str, scope_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -632,7 +643,7 @@ def get(self, resource_group_name: str, scope_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.HybridComputePrivateLinkScope] = kwargs.pop("cls", None) @@ -649,8 +660,9 @@ def get(self, resource_group_name: str, scope_name: str, **kwargs: Any) -> _mode request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -748,7 +760,8 @@ def create_or_update( :param scope_name: The name of the Azure Arc PrivateLinkScope resource. Required. :type scope_name: str :param parameters: Properties that need to be specified to create or update a Azure Arc for - Servers and Clusters PrivateLinkScope. Is either a model type or a IO type. Required. + Servers and Clusters PrivateLinkScope. Is either a HybridComputePrivateLinkScope type or a IO + type. Required. :type parameters: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -769,7 +782,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -798,8 +811,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -901,7 +915,7 @@ def update_tags( :param scope_name: The name of the Azure Arc PrivateLinkScope resource. Required. :type scope_name: str :param private_link_scope_tags: Updated tag information to set into the PrivateLinkScope - instance. Is either a model type or a IO type. Required. + instance. Is either a TagsResource type or a IO type. Required. :type private_link_scope_tags: ~azure.mgmt.hybridcompute.models.TagsResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -922,7 +936,7 @@ def update_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -951,8 +965,9 @@ def update_tags( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1000,7 +1015,7 @@ def get_validation_details( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateLinkScopeValidationDetails] = kwargs.pop("cls", None) @@ -1017,8 +1032,9 @@ def get_validation_details( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1067,7 +1083,7 @@ def get_validation_details_for_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-03-10"] = kwargs.pop( + api_version: Literal["2022-12-27"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PrivateLinkScopeValidationDetails] = kwargs.pop("cls", None) @@ -1084,8 +1100,9 @@ def get_validation_details_for_machine( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/delete_extension.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/delete_extension.py index 815837a8162d..e876aa7f7add 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/delete_extension.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/delete_extension.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/DELETEExtension.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/DELETEExtension.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension_metadata_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension_metadata_get.py new file mode 100644 index 000000000000..04bb1d6d219a --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension_metadata_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_metadata_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + ) + + response = client.extension_metadata.get( + location="EastUS", + publisher="microsoft.azure.monitor", + extension_type="azuremonitorlinuxagent", + version="1.9.1", + ) + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/ExtensionMetadata_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension_metadata_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension_metadata_list.py new file mode 100644 index 000000000000..668acb7c1fdc --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension_metadata_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_metadata_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + ) + + response = client.extension_metadata.list( + location="EastUS", + publisher="microsoft.azure.monitor", + extension_type="azuremonitorlinuxagent", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/ExtensionMetadata_List.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extensions_upgrade.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extensions_upgrade.py index bc32f852f1be..e2592b1af6b9 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extensions_upgrade.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extensions_upgrade.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Extensions_Upgrade.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Extensions_Upgrade.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/get_extension.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/get_extension.py index 3810ab40ff02..c85fe9f80e10 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/get_extension.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/get_extension.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/GETExtension.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/GETExtension.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/get_network_profile.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/get_network_profile.py new file mode 100644 index 000000000000..ea8689c821c9 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/get_network_profile.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python get_network_profile.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.network_profile.get( + resource_group_name="myResourceGroup", + machine_name="myMachine", + ) + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/GETNetworkProfile.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/list_extension.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/list_extension.py index d08aeda3992c..b4b7dba0aa97 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/list_extension.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/list_extension.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/LISTExtension.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/LISTExtension.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine_assess_patches.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine_assess_patches.py new file mode 100644 index 000000000000..cc0902c611ad --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine_assess_patches.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python machine_assess_patches.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="{subscription-id}", + ) + + response = client.machines.begin_assess_patches( + resource_group_name="myResourceGroupName", + name="myMachineName", + ).result() + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/MachineAssessPatches.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine_install_patches.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine_install_patches.py new file mode 100644 index 000000000000..a257480d45d0 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine_install_patches.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python machine_install_patches.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="{subscription-id}", + ) + + response = client.machines.begin_install_patches( + resource_group_name="myResourceGroupName", + name="myMachineName", + install_patches_input={ + "maximumDuration": "PT4H", + "rebootSetting": "IfRequired", + "windowsParameters": { + "classificationsToInclude": ["Critical", "Security"], + "maxPatchPublishDate": "2021-08-19T02:36:43.0539904+00:00", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/MachineInstallPatches.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_delete.py index 45849dd24257..f78c9b057dc0 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_delete.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Machines_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_get.py index 1823a3c4d527..a8c275992659 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Machines_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_list_by_resource_group.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_list_by_resource_group.py index 15bfc7fb6ab2..c0f7b17f1313 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_list_by_resource_group.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Machines_ListByResourceGroup.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_list_by_subscription.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_list_by_subscription.py index c63d3cf642d7..32ba1bb3eac8 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_list_by_subscription.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machines_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Machines_ListBySubscription.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py index e6329473690d..8209f6702d16 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Operations_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_delete.py index 7bcd012c70fe..a25332fea920 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateEndpointConnectionDelete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_get.py index be41316b1d8a..265f91281930 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateEndpointConnectionGet.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_list.py index 468ae8970a10..e8668476839c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateEndpointConnectionList.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionList.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_update.py index b3cf25f2dbae..0e70041d651c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint_connection_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateEndpointConnectionUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope_private_link_resource_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope_private_link_resource_get.py index 2260809654e9..146692b2fefc 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope_private_link_resource_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope_private_link_resource_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopePrivateLinkResourceGet.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopePrivateLinkResourceGet.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope_private_link_resource_list_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope_private_link_resource_list_get.py index f2ebf4d78f9a..60bab8e0b10d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope_private_link_resource_list_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope_private_link_resource_list_get.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopePrivateLinkResourceListGet.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopePrivateLinkResourceListGet.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_create.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_create.py index 884fbc9f0054..14760569b0ef 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_create.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_create.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesCreate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesCreate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_delete.py index 95f6bd430319..0e84a05e5726 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_delete.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesDelete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesDelete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get.py index 2ea1de7c6a66..d5669edbffd7 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesGet.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesGet.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get_validation.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get_validation.py index a5fa356f2030..159dce987fb5 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get_validation.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get_validation.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesGetValidation.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesGetValidation.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get_validation_for_machine.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get_validation_for_machine.py index 73d51134638a..635b7342b44a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get_validation_for_machine.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_get_validation_for_machine.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesGetValidationForMachine.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesGetValidationForMachine.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_list.py index a54f4093e333..e0f803a36baa 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesList.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesList.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_list_by_resource_group.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_list_by_resource_group.py index 716c781d68a3..c9e78c20e6bb 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_list_by_resource_group.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesListByResourceGroup.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_update.py index 9bd9543f150e..57d87bbcd545 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scopes_update.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/put_extension.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/put_extension.py index f0c1acd58846..dac7e70f6ffe 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/put_extension.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/put_extension.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PUTExtension.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PUTExtension.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/update_extension.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/update_extension.py index 59f1c0959211..dc6858ce7f7a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/update_extension.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/update_extension.py @@ -35,6 +35,7 @@ def main(): extension_name="CustomScriptExtension", extension_parameters={ "properties": { + "enableAutomaticUpgrade": True, "publisher": "Microsoft.Compute", "settings": {"commandToExecute": 'powershell.exe -c "Get-Process | Where-Object { $_.CPU -lt 100 }"'}, "type": "CustomScriptExtension", @@ -45,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/UpdateExtension.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/UpdateExtension.json if __name__ == "__main__": main()