diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/_meta.json b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/_meta.json index 10dc5f7494546..e5972932464e1 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/_meta.json +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/_meta.json @@ -1,11 +1,11 @@ { - "commit": "ec882de9043fe225777bbf5fd28ed5259b0949db", + "commit": "10fc6a5278c4f563c28640514bc58e351738714c", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.7", "use": [ "@autorest/python@6.7.1", "@autorest/modelerfour@4.26.2" ], - "autorest_command": "autorest specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", + "autorest_command": "autorest specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", "readme": "specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/readme.md" } \ No newline at end of file diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_configuration.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_configuration.py index 09e475d6cf9e8..f62eb392a19b4 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_configuration.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_configuration.py @@ -29,14 +29,14 @@ class HDInsightContainersMgmtClientConfiguration(Configuration): # pylint: disa :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2023-11-01-preview". 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(HDInsightContainersMgmtClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-06-01-preview") + api_version: str = kwargs.pop("api_version", "2023-11-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_hd_insight_containers_mgmt_client.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_hd_insight_containers_mgmt_client.py index 615dafbac6928..508b497d0020c 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_hd_insight_containers_mgmt_client.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_hd_insight_containers_mgmt_client.py @@ -18,7 +18,9 @@ from .operations import ( AvailableClusterPoolVersionsOperations, AvailableClusterVersionsOperations, + ClusterAvailableUpgradesOperations, ClusterJobsOperations, + ClusterPoolAvailableUpgradesOperations, ClusterPoolsOperations, ClustersOperations, LocationsOperations, @@ -31,12 +33,18 @@ class HDInsightContainersMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """HDInsight On Aks Management Client. + """HDInsight Containers Management Client. :ivar cluster_pools: ClusterPoolsOperations operations :vartype cluster_pools: azure.mgmt.hdinsightcontainers.operations.ClusterPoolsOperations + :ivar cluster_pool_available_upgrades: ClusterPoolAvailableUpgradesOperations operations + :vartype cluster_pool_available_upgrades: + azure.mgmt.hdinsightcontainers.operations.ClusterPoolAvailableUpgradesOperations :ivar clusters: ClustersOperations operations :vartype clusters: azure.mgmt.hdinsightcontainers.operations.ClustersOperations + :ivar cluster_available_upgrades: ClusterAvailableUpgradesOperations operations + :vartype cluster_available_upgrades: + azure.mgmt.hdinsightcontainers.operations.ClusterAvailableUpgradesOperations :ivar cluster_jobs: ClusterJobsOperations operations :vartype cluster_jobs: azure.mgmt.hdinsightcontainers.operations.ClusterJobsOperations :ivar locations: LocationsOperations operations @@ -55,7 +63,7 @@ class HDInsightContainersMgmtClient: # pylint: disable=client-accepts-api-versi :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2023-11-01-preview". 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 @@ -79,7 +87,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.cluster_pools = ClusterPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.cluster_pool_available_upgrades = ClusterPoolAvailableUpgradesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.cluster_available_upgrades = ClusterAvailableUpgradesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.cluster_jobs = ClusterJobsOperations(self._client, self._config, self._serialize, self._deserialize) self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_configuration.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_configuration.py index 415d5705e755f..4204f951ee495 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_configuration.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_configuration.py @@ -29,14 +29,14 @@ class HDInsightContainersMgmtClientConfiguration(Configuration): # pylint: disa :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2023-11-01-preview". 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(HDInsightContainersMgmtClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-06-01-preview") + api_version: str = kwargs.pop("api_version", "2023-11-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_hd_insight_containers_mgmt_client.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_hd_insight_containers_mgmt_client.py index 4f035e558401c..bc3c66fb035cb 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_hd_insight_containers_mgmt_client.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_hd_insight_containers_mgmt_client.py @@ -18,7 +18,9 @@ from .operations import ( AvailableClusterPoolVersionsOperations, AvailableClusterVersionsOperations, + ClusterAvailableUpgradesOperations, ClusterJobsOperations, + ClusterPoolAvailableUpgradesOperations, ClusterPoolsOperations, ClustersOperations, LocationsOperations, @@ -31,12 +33,18 @@ class HDInsightContainersMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """HDInsight On Aks Management Client. + """HDInsight Containers Management Client. :ivar cluster_pools: ClusterPoolsOperations operations :vartype cluster_pools: azure.mgmt.hdinsightcontainers.aio.operations.ClusterPoolsOperations + :ivar cluster_pool_available_upgrades: ClusterPoolAvailableUpgradesOperations operations + :vartype cluster_pool_available_upgrades: + azure.mgmt.hdinsightcontainers.aio.operations.ClusterPoolAvailableUpgradesOperations :ivar clusters: ClustersOperations operations :vartype clusters: azure.mgmt.hdinsightcontainers.aio.operations.ClustersOperations + :ivar cluster_available_upgrades: ClusterAvailableUpgradesOperations operations + :vartype cluster_available_upgrades: + azure.mgmt.hdinsightcontainers.aio.operations.ClusterAvailableUpgradesOperations :ivar cluster_jobs: ClusterJobsOperations operations :vartype cluster_jobs: azure.mgmt.hdinsightcontainers.aio.operations.ClusterJobsOperations :ivar locations: LocationsOperations operations @@ -55,7 +63,7 @@ class HDInsightContainersMgmtClient: # pylint: disable=client-accepts-api-versi :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2023-11-01-preview". 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 @@ -79,7 +87,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.cluster_pools = ClusterPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.cluster_pool_available_upgrades = ClusterPoolAvailableUpgradesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.cluster_available_upgrades = ClusterAvailableUpgradesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.cluster_jobs = ClusterJobsOperations(self._client, self._config, self._serialize, self._deserialize) self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/__init__.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/__init__.py index 3c44ccd0cd628..560926c82ae8c 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/__init__.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/__init__.py @@ -7,7 +7,9 @@ # -------------------------------------------------------------------------- from ._cluster_pools_operations import ClusterPoolsOperations +from ._cluster_pool_available_upgrades_operations import ClusterPoolAvailableUpgradesOperations from ._clusters_operations import ClustersOperations +from ._cluster_available_upgrades_operations import ClusterAvailableUpgradesOperations from ._cluster_jobs_operations import ClusterJobsOperations from ._locations_operations import LocationsOperations from ._operations import Operations @@ -20,7 +22,9 @@ __all__ = [ "ClusterPoolsOperations", + "ClusterPoolAvailableUpgradesOperations", "ClustersOperations", + "ClusterAvailableUpgradesOperations", "ClusterJobsOperations", "LocationsOperations", "Operations", diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_available_upgrades_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_available_upgrades_operations.py new file mode 100644 index 0000000000000..15f5a9db0e650 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_available_upgrades_operations.py @@ -0,0 +1,150 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from 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.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._cluster_available_upgrades_operations import build_list_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ClusterAvailableUpgradesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s + :attr:`cluster_available_upgrades` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ClusterAvailableUpgrade"]: + """List a cluster available upgrade. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_name: The name of the HDInsight cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ClusterAvailableUpgrade or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterAvailableUpgrade] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ClusterAvailableUpgradeList] = 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( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + cluster_name=cluster_name, + 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("ClusterAvailableUpgradeList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/availableUpgrades" + } diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_jobs_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_jobs_operations.py index ea5fdaeac7bb2..e8a200ea16150 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_jobs_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_jobs_operations.py @@ -299,7 +299,12 @@ def get_long_running_output(pipeline_response): @distributed_trace def list( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + filter: Optional[str] = None, + **kwargs: Any ) -> AsyncIterable["_models.ClusterJob"]: """Get jobs of HDInsight on AKS cluster. @@ -310,6 +315,9 @@ def list( :type cluster_pool_name: str :param cluster_name: The name of the HDInsight cluster. Required. :type cluster_name: str + :param filter: The system query option to filter job returned in the response. Allowed value is + 'jobName eq {jobName}' or 'jarName eq {jarName}'. Default value is None. + :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ClusterJob or the result of cls(response) :rtype: @@ -338,6 +346,7 @@ def prepare_request(next_link=None): cluster_pool_name=cluster_pool_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + filter=filter, api_version=api_version, template_url=self.list.metadata["url"], headers=_headers, diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pool_available_upgrades_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pool_available_upgrades_operations.py new file mode 100644 index 0000000000000..d845e0ac48fb7 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pool_available_upgrades_operations.py @@ -0,0 +1,147 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from 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.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._cluster_pool_available_upgrades_operations import build_list_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ClusterPoolAvailableUpgradesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s + :attr:`cluster_pool_available_upgrades` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, cluster_pool_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ClusterPoolAvailableUpgrade"]: + """List a cluster pool available upgrade. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ClusterPoolAvailableUpgrade or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterPoolAvailableUpgrade] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ClusterPoolAvailableUpgradeList] = 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( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + 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("ClusterPoolAvailableUpgradeList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/availableUpgrades" + } diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pools_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pools_operations.py index 2097150454bb5..b81b9333595ec 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pools_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pools_operations.py @@ -38,6 +38,7 @@ build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request, + build_upgrade_request, ) T = TypeVar("T") @@ -623,7 +624,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -876,3 +877,234 @@ async def get_next(next_link=None): list_by_resource_group.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools" } + + async def _upgrade_initial( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_pool_upgrade_request: Union[_models.ClusterPoolUpgrade, IO], + **kwargs: Any + ) -> Optional[_models.ClusterPool]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ClusterPool]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cluster_pool_upgrade_request, (IOBase, bytes)): + _content = cluster_pool_upgrade_request + else: + _json = self._serialize.body(cluster_pool_upgrade_request, "ClusterPoolUpgrade") + + request = build_upgrade_request( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._upgrade_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("ClusterPool", 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 + + _upgrade_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/upgrade" + } + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_pool_upgrade_request: _models.ClusterPoolUpgrade, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ClusterPool]: + """Upgrade a cluster pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_pool_upgrade_request: Upgrade a cluster pool. Required. + :type cluster_pool_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgrade + :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 ClusterPool or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_pool_upgrade_request: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ClusterPool]: + """Upgrade a cluster pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_pool_upgrade_request: Upgrade a cluster pool. Required. + :type cluster_pool_upgrade_request: 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 ClusterPool or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_pool_upgrade_request: Union[_models.ClusterPoolUpgrade, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.ClusterPool]: + """Upgrade a cluster pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_pool_upgrade_request: Upgrade a cluster pool. Is either a ClusterPoolUpgrade + type or a IO type. Required. + :type cluster_pool_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgrade + 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 ClusterPool or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterPool] = 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._upgrade_initial( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + cluster_pool_upgrade_request=cluster_pool_upgrade_request, + 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("ClusterPool", 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_upgrade.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/upgrade" + } diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_clusters_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_clusters_operations.py index d8a2d4feb9f88..01aba74047da0 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_clusters_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_clusters_operations.py @@ -41,6 +41,7 @@ build_list_service_configs_request, build_resize_request, build_update_request, + build_upgrade_request, ) T = TypeVar("T") @@ -158,6 +159,248 @@ async def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters" } + async def _upgrade_initial( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + cluster_upgrade_request: Union[_models.ClusterUpgrade, IO], + **kwargs: Any + ) -> Optional[_models.Cluster]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Cluster]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cluster_upgrade_request, (IOBase, bytes)): + _content = cluster_upgrade_request + else: + _json = self._serialize.body(cluster_upgrade_request, "ClusterUpgrade") + + request = build_upgrade_request( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._upgrade_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("Cluster", 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 + + _upgrade_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/upgrade" + } + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + cluster_upgrade_request: _models.ClusterUpgrade, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Upgrade a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_name: The name of the HDInsight cluster. Required. + :type cluster_name: str + :param cluster_upgrade_request: Upgrade a cluster. Required. + :type cluster_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgrade + :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 Cluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hdinsightcontainers.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + cluster_upgrade_request: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Upgrade a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_name: The name of the HDInsight cluster. Required. + :type cluster_name: str + :param cluster_upgrade_request: Upgrade a cluster. Required. + :type cluster_upgrade_request: 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 Cluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hdinsightcontainers.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + cluster_upgrade_request: Union[_models.ClusterUpgrade, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Upgrade a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_name: The name of the HDInsight cluster. Required. + :type cluster_name: str + :param cluster_upgrade_request: Upgrade a cluster. Is either a ClusterUpgrade type or a IO + type. Required. + :type cluster_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgrade 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 Cluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hdinsightcontainers.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = 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._upgrade_initial( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + cluster_name=cluster_name, + cluster_upgrade_request=cluster_upgrade_request, + 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("Cluster", 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_upgrade.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/upgrade" + } + async def _resize_initial( self, resource_group_name: str, @@ -990,7 +1233,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/__init__.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/__init__.py index 39a26dba8fe74..51b30abe3d913 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/__init__.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/__init__.py @@ -12,8 +12,16 @@ from ._models_py3 import AutoscaleProfile from ._models_py3 import CatalogOptions from ._models_py3 import Cluster +from ._models_py3 import ClusterAKSPatchVersionUpgradeProperties +from ._models_py3 import ClusterAccessProfile +from ._models_py3 import ClusterAvailableUpgrade +from ._models_py3 import ClusterAvailableUpgradeAksPatchUpgradeProperties +from ._models_py3 import ClusterAvailableUpgradeHotfixUpgradeProperties +from ._models_py3 import ClusterAvailableUpgradeList +from ._models_py3 import ClusterAvailableUpgradeProperties from ._models_py3 import ClusterComponentsItem from ._models_py3 import ClusterConfigFile +from ._models_py3 import ClusterHotfixUpgradeProperties from ._models_py3 import ClusterInstanceViewProperties from ._models_py3 import ClusterInstanceViewPropertiesStatus from ._models_py3 import ClusterInstanceViewResult @@ -28,23 +36,35 @@ from ._models_py3 import ClusterLogAnalyticsProfile from ._models_py3 import ClusterPatch from ._models_py3 import ClusterPool +from ._models_py3 import ClusterPoolAKSPatchVersionUpgradeProperties +from ._models_py3 import ClusterPoolAvailableUpgrade +from ._models_py3 import ClusterPoolAvailableUpgradeAksPatchUpgradeProperties +from ._models_py3 import ClusterPoolAvailableUpgradeList +from ._models_py3 import ClusterPoolAvailableUpgradeNodeOsUpgradeProperties +from ._models_py3 import ClusterPoolAvailableUpgradeProperties from ._models_py3 import ClusterPoolComputeProfile from ._models_py3 import ClusterPoolListResult from ._models_py3 import ClusterPoolLogAnalyticsProfile from ._models_py3 import ClusterPoolNetworkProfile +from ._models_py3 import ClusterPoolNodeOsImageUpdateProperties from ._models_py3 import ClusterPoolProfile from ._models_py3 import ClusterPoolResourcePropertiesAksClusterProfile from ._models_py3 import ClusterPoolResourcePropertiesClusterPoolProfile from ._models_py3 import ClusterPoolResourcePropertiesComputeProfile from ._models_py3 import ClusterPoolResourcePropertiesLogAnalyticsProfile from ._models_py3 import ClusterPoolResourcePropertiesNetworkProfile +from ._models_py3 import ClusterPoolUpgrade +from ._models_py3 import ClusterPoolUpgradeProperties from ._models_py3 import ClusterPoolVersion from ._models_py3 import ClusterPoolVersionsListResult from ._models_py3 import ClusterProfile from ._models_py3 import ClusterPrometheusProfile +from ._models_py3 import ClusterRangerPluginProfile from ._models_py3 import ClusterResizeData from ._models_py3 import ClusterServiceConfig from ._models_py3 import ClusterServiceConfigsProfile +from ._models_py3 import ClusterUpgrade +from ._models_py3 import ClusterUpgradeProperties from ._models_py3 import ClusterVersion from ._models_py3 import ClusterVersionsListResult from ._models_py3 import ComparisonRule @@ -52,16 +72,20 @@ from ._models_py3 import ComputeResourceDefinition from ._models_py3 import ConnectivityProfile from ._models_py3 import ConnectivityProfileWeb +from ._models_py3 import DiskStorageProfile from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse from ._models_py3 import FlinkCatalogOptions from ._models_py3 import FlinkHiveCatalogOption +from ._models_py3 import FlinkJobProfile from ._models_py3 import FlinkJobProperties from ._models_py3 import FlinkProfile from ._models_py3 import FlinkStorageProfile from ._models_py3 import HiveCatalogOption from ._models_py3 import IdentityProfile +from ._models_py3 import KafkaConnectivityProfile +from ._models_py3 import KafkaProfile from ._models_py3 import LoadBasedConfig from ._models_py3 import NameAvailabilityParameters from ._models_py3 import NameAvailabilityResult @@ -70,6 +94,11 @@ from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult from ._models_py3 import ProxyResource +from ._models_py3 import RangerAdminSpec +from ._models_py3 import RangerAdminSpecDatabase +from ._models_py3 import RangerAuditSpec +from ._models_py3 import RangerProfile +from ._models_py3 import RangerUsersyncSpec from ._models_py3 import Resource from ._models_py3 import ScalingRule from ._models_py3 import Schedule @@ -105,15 +134,29 @@ from ._hd_insight_containers_mgmt_client_enums import Action from ._hd_insight_containers_mgmt_client_enums import ActionType from ._hd_insight_containers_mgmt_client_enums import AutoscaleType +from ._hd_insight_containers_mgmt_client_enums import ClusterAvailableUpgradeType +from ._hd_insight_containers_mgmt_client_enums import ClusterPoolAvailableUpgradeType +from ._hd_insight_containers_mgmt_client_enums import ClusterPoolUpgradeType +from ._hd_insight_containers_mgmt_client_enums import ClusterUpgradeType from ._hd_insight_containers_mgmt_client_enums import ComparisonOperator from ._hd_insight_containers_mgmt_client_enums import ContentEncoding from ._hd_insight_containers_mgmt_client_enums import CreatedByType +from ._hd_insight_containers_mgmt_client_enums import CurrentClusterAksVersionStatus +from ._hd_insight_containers_mgmt_client_enums import CurrentClusterPoolAksVersionStatus +from ._hd_insight_containers_mgmt_client_enums import DataDiskType +from ._hd_insight_containers_mgmt_client_enums import DbConnectionAuthenticationMode +from ._hd_insight_containers_mgmt_client_enums import DeploymentMode from ._hd_insight_containers_mgmt_client_enums import JobType from ._hd_insight_containers_mgmt_client_enums import KeyVaultObjectType +from ._hd_insight_containers_mgmt_client_enums import MetastoreDbConnectionAuthenticationMode from ._hd_insight_containers_mgmt_client_enums import Origin +from ._hd_insight_containers_mgmt_client_enums import OutboundType from ._hd_insight_containers_mgmt_client_enums import ProvisioningStatus +from ._hd_insight_containers_mgmt_client_enums import RangerUsersyncMode from ._hd_insight_containers_mgmt_client_enums import ScaleActionType from ._hd_insight_containers_mgmt_client_enums import ScheduleDay +from ._hd_insight_containers_mgmt_client_enums import Severity +from ._hd_insight_containers_mgmt_client_enums import UpgradeMode from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -125,8 +168,16 @@ "AutoscaleProfile", "CatalogOptions", "Cluster", + "ClusterAKSPatchVersionUpgradeProperties", + "ClusterAccessProfile", + "ClusterAvailableUpgrade", + "ClusterAvailableUpgradeAksPatchUpgradeProperties", + "ClusterAvailableUpgradeHotfixUpgradeProperties", + "ClusterAvailableUpgradeList", + "ClusterAvailableUpgradeProperties", "ClusterComponentsItem", "ClusterConfigFile", + "ClusterHotfixUpgradeProperties", "ClusterInstanceViewProperties", "ClusterInstanceViewPropertiesStatus", "ClusterInstanceViewResult", @@ -141,23 +192,35 @@ "ClusterLogAnalyticsProfile", "ClusterPatch", "ClusterPool", + "ClusterPoolAKSPatchVersionUpgradeProperties", + "ClusterPoolAvailableUpgrade", + "ClusterPoolAvailableUpgradeAksPatchUpgradeProperties", + "ClusterPoolAvailableUpgradeList", + "ClusterPoolAvailableUpgradeNodeOsUpgradeProperties", + "ClusterPoolAvailableUpgradeProperties", "ClusterPoolComputeProfile", "ClusterPoolListResult", "ClusterPoolLogAnalyticsProfile", "ClusterPoolNetworkProfile", + "ClusterPoolNodeOsImageUpdateProperties", "ClusterPoolProfile", "ClusterPoolResourcePropertiesAksClusterProfile", "ClusterPoolResourcePropertiesClusterPoolProfile", "ClusterPoolResourcePropertiesComputeProfile", "ClusterPoolResourcePropertiesLogAnalyticsProfile", "ClusterPoolResourcePropertiesNetworkProfile", + "ClusterPoolUpgrade", + "ClusterPoolUpgradeProperties", "ClusterPoolVersion", "ClusterPoolVersionsListResult", "ClusterProfile", "ClusterPrometheusProfile", + "ClusterRangerPluginProfile", "ClusterResizeData", "ClusterServiceConfig", "ClusterServiceConfigsProfile", + "ClusterUpgrade", + "ClusterUpgradeProperties", "ClusterVersion", "ClusterVersionsListResult", "ComparisonRule", @@ -165,16 +228,20 @@ "ComputeResourceDefinition", "ConnectivityProfile", "ConnectivityProfileWeb", + "DiskStorageProfile", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", "FlinkCatalogOptions", "FlinkHiveCatalogOption", + "FlinkJobProfile", "FlinkJobProperties", "FlinkProfile", "FlinkStorageProfile", "HiveCatalogOption", "IdentityProfile", + "KafkaConnectivityProfile", + "KafkaProfile", "LoadBasedConfig", "NameAvailabilityParameters", "NameAvailabilityResult", @@ -183,6 +250,11 @@ "OperationDisplay", "OperationListResult", "ProxyResource", + "RangerAdminSpec", + "RangerAdminSpecDatabase", + "RangerAuditSpec", + "RangerProfile", + "RangerUsersyncSpec", "Resource", "ScalingRule", "Schedule", @@ -217,15 +289,29 @@ "Action", "ActionType", "AutoscaleType", + "ClusterAvailableUpgradeType", + "ClusterPoolAvailableUpgradeType", + "ClusterPoolUpgradeType", + "ClusterUpgradeType", "ComparisonOperator", "ContentEncoding", "CreatedByType", + "CurrentClusterAksVersionStatus", + "CurrentClusterPoolAksVersionStatus", + "DataDiskType", + "DbConnectionAuthenticationMode", + "DeploymentMode", "JobType", "KeyVaultObjectType", + "MetastoreDbConnectionAuthenticationMode", "Origin", + "OutboundType", "ProvisioningStatus", + "RangerUsersyncMode", "ScaleActionType", "ScheduleDay", + "Severity", + "UpgradeMode", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_hd_insight_containers_mgmt_client_enums.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_hd_insight_containers_mgmt_client_enums.py index cd4fd682c917e..c56673fe4fecd 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_hd_insight_containers_mgmt_client_enums.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_hd_insight_containers_mgmt_client_enums.py @@ -25,6 +25,8 @@ class Action(str, Enum, metaclass=CaseInsensitiveEnumMeta): SAVEPOINT = "SAVEPOINT" LIST_SAVEPOINT = "LIST_SAVEPOINT" DELETE = "DELETE" + LAST_STATE_UPDATE = "LAST_STATE_UPDATE" + RE_LAUNCH = "RE_LAUNCH" class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -40,6 +42,34 @@ class AutoscaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): LOAD_BASED = "LoadBased" +class ClusterAvailableUpgradeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of upgrade.""" + + AKS_PATCH_UPGRADE = "AKSPatchUpgrade" + HOTFIX_UPGRADE = "HotfixUpgrade" + + +class ClusterPoolAvailableUpgradeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of upgrade.""" + + AKS_PATCH_UPGRADE = "AKSPatchUpgrade" + NODE_OS_UPGRADE = "NodeOsUpgrade" + + +class ClusterPoolUpgradeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of upgrade.""" + + AKS_PATCH_UPGRADE = "AKSPatchUpgrade" + NODE_OS_UPGRADE = "NodeOsUpgrade" + + +class ClusterUpgradeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of upgrade.""" + + AKS_PATCH_UPGRADE = "AKSPatchUpgrade" + HOTFIX_UPGRADE = "HotfixUpgrade" + + class ComparisonOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The comparison operator.""" @@ -68,6 +98,51 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KEY = "Key" +class CurrentClusterAksVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current AKS version's status: whether it is deprecated or supported.""" + + DEPRECATED = "Deprecated" + SUPPORTED = "Supported" + + +class CurrentClusterPoolAksVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current AKS version's status: whether it is deprecated or supported.""" + + DEPRECATED = "Deprecated" + SUPPORTED = "Supported" + + +class DataDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Managed Disk Type.""" + + STANDARD_HDD_LRS = "Standard_HDD_LRS" + STANDARD_SSD_LRS = "Standard_SSD_LRS" + STANDARD_SSD_ZRS = "Standard_SSD_ZRS" + PREMIUM_SSD_LRS = "Premium_SSD_LRS" + PREMIUM_SSD_ZRS = "Premium_SSD_ZRS" + PREMIUM_SSD_V2_LRS = "Premium_SSD_v2_LRS" + + +class DbConnectionAuthenticationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The authentication mode to connect to your Hive metastore database. More details: + https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization. + """ + + SQL_AUTH = "SqlAuth" + """The password-based authentication to connect to your Hive metastore database.""" + IDENTITY_AUTH = "IdentityAuth" + """The managed-identity-based authentication to connect to your Hive metastore database.""" + + +class DeploymentMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A string property that indicates the deployment mode of Flink cluster. It can have one of the + following enum values => Application, Session. Default value is Session. + """ + + APPLICATION = "Application" + SESSION = "Session" + + class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of cluster job.""" @@ -82,6 +157,17 @@ class KeyVaultObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CERTIFICATE = "Certificate" +class MetastoreDbConnectionAuthenticationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The authentication mode to connect to your Hive metastore database. More details: + https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization. + """ + + SQL_AUTH = "SqlAuth" + """The password-based authentication to connect to your Hive metastore database.""" + IDENTITY_AUTH = "IdentityAuth" + """The managed-identity-based authentication to connect to your Hive metastore database.""" + + class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". @@ -92,6 +178,17 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_SYSTEM = "user,system" +class OutboundType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This can only be set at cluster pool creation time and cannot be changed later.""" + + LOAD_BALANCER = "loadBalancer" + """The load balancer is used for egress through an AKS assigned public IP. This supports + #: Kubernetes services of type 'loadBalancer'.""" + USER_DEFINED_ROUTING = "userDefinedRouting" + """Egress paths must be defined by the user. This is an advanced scenario and requires proper + #: network configuration.""" + + class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of the resource.""" @@ -101,6 +198,13 @@ class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" +class RangerUsersyncMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """User & groups can be synced automatically or via a static list that's refreshed.""" + + STATIC = "static" + AUTOMATIC = "automatic" + + class ScaleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The action type.""" @@ -118,3 +222,22 @@ class ScheduleDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): THURSDAY = "Thursday" FRIDAY = "Friday" SATURDAY = "Saturday" + + +class Severity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Severity of this upgrade.""" + + LOW = "low" + MEDIUM = "medium" + HIGH = "high" + CRITICAL = "critical" + + +class UpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A string property that indicates the upgrade mode to be performed on the Flink job. It can have + one of the following enum values => STATELESS_UPDATE, SAVEPOINT, LAST_STATE_UPDATE. + """ + + STATELESS_UPDATE = "STATELESS_UPDATE" + UPDATE = "UPDATE" + LAST_STATE_UPDATE = "LAST_STATE_UPDATE" diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_models_py3.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_models_py3.py index 260c4f07d8d68..0474300d2b31a 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_models_py3.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_models_py3.py @@ -470,6 +470,418 @@ def __init__( self.status = None +class ClusterAccessProfile(_serialization.Model): + """Cluster access profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar enable_internal_ingress: Whether to create cluster using private IP instead of public IP. + Required. + :vartype enable_internal_ingress: bool + :ivar private_link_service_id: Private link service resource id. Only when + enableInternalIngress is true, this property will be returned. + :vartype private_link_service_id: str + """ + + _validation = { + "enable_internal_ingress": {"required": True}, + "private_link_service_id": {"readonly": True}, + } + + _attribute_map = { + "enable_internal_ingress": {"key": "enableInternalIngress", "type": "bool"}, + "private_link_service_id": {"key": "privateLinkServiceId", "type": "str"}, + } + + def __init__(self, *, enable_internal_ingress: bool, **kwargs: Any) -> None: + """ + :keyword enable_internal_ingress: Whether to create cluster using private IP instead of public + IP. Required. + :paramtype enable_internal_ingress: bool + """ + super().__init__(**kwargs) + self.enable_internal_ingress = enable_internal_ingress + self.private_link_service_id = None + + +class ClusterUpgradeProperties(_serialization.Model): + """Properties of upgrading cluster. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ClusterAKSPatchVersionUpgradeProperties, ClusterHotfixUpgradeProperties + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "HotfixUpgrade". + :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeType + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + } + + _subtype_map = { + "upgrade_type": { + "AKSPatchUpgrade": "ClusterAKSPatchVersionUpgradeProperties", + "HotfixUpgrade": "ClusterHotfixUpgradeProperties", + } + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.upgrade_type: Optional[str] = None + + +class ClusterAKSPatchVersionUpgradeProperties(ClusterUpgradeProperties): + """Properties of upgrading cluster's aks patch version. + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "HotfixUpgrade". + :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeType + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.upgrade_type: str = "AKSPatchUpgrade" + + +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. E.g. + "/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.hdinsightcontainers.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 ClusterAvailableUpgrade(ProxyResource): + """Cluster available upgrade. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.hdinsightcontainers.models.SystemData + :ivar upgrade_type: Type of upgrade. Known values are: "AKSPatchUpgrade" and "HotfixUpgrade". + :vartype upgrade_type: str or + ~azure.mgmt.hdinsightcontainers.models.ClusterAvailableUpgradeType + """ + + _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"}, + "upgrade_type": {"key": "properties.upgradeType", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.upgrade_type: Optional[str] = None + + +class ClusterAvailableUpgradeProperties(_serialization.Model): + """Cluster available upgrade properties. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ClusterAvailableUpgradeAksPatchUpgradeProperties, + ClusterAvailableUpgradeHotfixUpgradeProperties + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "HotfixUpgrade". + :vartype upgrade_type: str or + ~azure.mgmt.hdinsightcontainers.models.ClusterAvailableUpgradeType + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + } + + _subtype_map = { + "upgrade_type": { + "AKSPatchUpgrade": "ClusterAvailableUpgradeAksPatchUpgradeProperties", + "HotfixUpgrade": "ClusterAvailableUpgradeHotfixUpgradeProperties", + } + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.upgrade_type: Optional[str] = None + + +class ClusterAvailableUpgradeAksPatchUpgradeProperties(ClusterAvailableUpgradeProperties): + """Cluster available aks patch version upgrade. + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "HotfixUpgrade". + :vartype upgrade_type: str or + ~azure.mgmt.hdinsightcontainers.models.ClusterAvailableUpgradeType + :ivar current_version: Current node pool version. + :vartype current_version: str + :ivar current_version_status: Current AKS version's status: whether it is deprecated or + supported. Known values are: "Deprecated" and "Supported". + :vartype current_version_status: str or + ~azure.mgmt.hdinsightcontainers.models.CurrentClusterAksVersionStatus + :ivar latest_version: Latest available version, which should be equal to aks control plane + version if it's not deprecated. + :vartype latest_version: str + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + "current_version": {"key": "currentVersion", "type": "str"}, + "current_version_status": {"key": "currentVersionStatus", "type": "str"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + } + + def __init__( + self, + *, + current_version: Optional[str] = None, + current_version_status: Optional[Union[str, "_models.CurrentClusterAksVersionStatus"]] = None, + latest_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword current_version: Current node pool version. + :paramtype current_version: str + :keyword current_version_status: Current AKS version's status: whether it is deprecated or + supported. Known values are: "Deprecated" and "Supported". + :paramtype current_version_status: str or + ~azure.mgmt.hdinsightcontainers.models.CurrentClusterAksVersionStatus + :keyword latest_version: Latest available version, which should be equal to aks control plane + version if it's not deprecated. + :paramtype latest_version: str + """ + super().__init__(**kwargs) + self.upgrade_type: str = "AKSPatchUpgrade" + self.current_version = current_version + self.current_version_status = current_version_status + self.latest_version = latest_version + + +class ClusterAvailableUpgradeHotfixUpgradeProperties( + ClusterAvailableUpgradeProperties +): # pylint: disable=too-many-instance-attributes + """Cluster available hotfix version upgrade. + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "HotfixUpgrade". + :vartype upgrade_type: str or + ~azure.mgmt.hdinsightcontainers.models.ClusterAvailableUpgradeType + :ivar description: Hotfix version upgrade description. + :vartype description: str + :ivar source_oss_version: Source OSS version of current cluster component. + :vartype source_oss_version: str + :ivar source_cluster_version: Source cluster version of current cluster component. + :vartype source_cluster_version: str + :ivar source_build_number: Source build number of current cluster component. + :vartype source_build_number: str + :ivar target_oss_version: Target OSS version of component to be upgraded. + :vartype target_oss_version: str + :ivar target_cluster_version: Target cluster version of component to be upgraded. + :vartype target_cluster_version: str + :ivar target_build_number: Target build number of component to be upgraded. + :vartype target_build_number: str + :ivar component_name: Name of component to be upgraded. + :vartype component_name: str + :ivar severity: Severity of this upgrade. Known values are: "low", "medium", "high", and + "critical". + :vartype severity: str or ~azure.mgmt.hdinsightcontainers.models.Severity + :ivar extended_properties: Extended properties of current available upgrade version. + :vartype extended_properties: str + :ivar created_time: Created time of current available upgrade version. + :vartype created_time: ~datetime.datetime + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "source_oss_version": {"key": "sourceOssVersion", "type": "str"}, + "source_cluster_version": {"key": "sourceClusterVersion", "type": "str"}, + "source_build_number": {"key": "sourceBuildNumber", "type": "str"}, + "target_oss_version": {"key": "targetOssVersion", "type": "str"}, + "target_cluster_version": {"key": "targetClusterVersion", "type": "str"}, + "target_build_number": {"key": "targetBuildNumber", "type": "str"}, + "component_name": {"key": "componentName", "type": "str"}, + "severity": {"key": "severity", "type": "str"}, + "extended_properties": {"key": "extendedProperties", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + source_oss_version: Optional[str] = None, + source_cluster_version: Optional[str] = None, + source_build_number: Optional[str] = None, + target_oss_version: Optional[str] = None, + target_cluster_version: Optional[str] = None, + target_build_number: Optional[str] = None, + component_name: Optional[str] = None, + severity: Optional[Union[str, "_models.Severity"]] = None, + extended_properties: Optional[str] = None, + created_time: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword description: Hotfix version upgrade description. + :paramtype description: str + :keyword source_oss_version: Source OSS version of current cluster component. + :paramtype source_oss_version: str + :keyword source_cluster_version: Source cluster version of current cluster component. + :paramtype source_cluster_version: str + :keyword source_build_number: Source build number of current cluster component. + :paramtype source_build_number: str + :keyword target_oss_version: Target OSS version of component to be upgraded. + :paramtype target_oss_version: str + :keyword target_cluster_version: Target cluster version of component to be upgraded. + :paramtype target_cluster_version: str + :keyword target_build_number: Target build number of component to be upgraded. + :paramtype target_build_number: str + :keyword component_name: Name of component to be upgraded. + :paramtype component_name: str + :keyword severity: Severity of this upgrade. Known values are: "low", "medium", "high", and + "critical". + :paramtype severity: str or ~azure.mgmt.hdinsightcontainers.models.Severity + :keyword extended_properties: Extended properties of current available upgrade version. + :paramtype extended_properties: str + :keyword created_time: Created time of current available upgrade version. + :paramtype created_time: ~datetime.datetime + """ + super().__init__(**kwargs) + self.upgrade_type: str = "HotfixUpgrade" + self.description = description + self.source_oss_version = source_oss_version + self.source_cluster_version = source_cluster_version + self.source_build_number = source_build_number + self.target_oss_version = target_oss_version + self.target_cluster_version = target_cluster_version + self.target_build_number = target_build_number + self.component_name = component_name + self.severity = severity + self.extended_properties = extended_properties + self.created_time = created_time + + +class ClusterAvailableUpgradeList(_serialization.Model): + """Collection of Cluster available upgrade. + + All required parameters must be populated in order to send to Azure. + + :ivar value: Collection of Cluster available upgrade. Required. + :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterAvailableUpgrade] + :ivar next_link: The Url of next result page. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ClusterAvailableUpgrade]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.ClusterAvailableUpgrade"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Cluster available upgrade. Required. + :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterAvailableUpgrade] + :keyword next_link: The Url of next result page. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + class ClusterComponentsItem(_serialization.Model): """ClusterComponentsItem. @@ -563,6 +975,63 @@ def __init__( self.values = values +class ClusterHotfixUpgradeProperties(ClusterUpgradeProperties): + """Properties of upgrading cluster's hotfix. + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "HotfixUpgrade". + :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeType + :ivar target_oss_version: Target OSS version of component to be upgraded. + :vartype target_oss_version: str + :ivar target_cluster_version: Target cluster version of component to be upgraded. + :vartype target_cluster_version: str + :ivar target_build_number: Target build number of component to be upgraded. + :vartype target_build_number: str + :ivar component_name: Name of component to be upgraded. + :vartype component_name: str + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + "target_oss_version": {"key": "targetOssVersion", "type": "str"}, + "target_cluster_version": {"key": "targetClusterVersion", "type": "str"}, + "target_build_number": {"key": "targetBuildNumber", "type": "str"}, + "component_name": {"key": "componentName", "type": "str"}, + } + + def __init__( + self, + *, + target_oss_version: Optional[str] = None, + target_cluster_version: Optional[str] = None, + target_build_number: Optional[str] = None, + component_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword target_oss_version: Target OSS version of component to be upgraded. + :paramtype target_oss_version: str + :keyword target_cluster_version: Target cluster version of component to be upgraded. + :paramtype target_cluster_version: str + :keyword target_build_number: Target build number of component to be upgraded. + :paramtype target_build_number: str + :keyword component_name: Name of component to be upgraded. + :paramtype component_name: str + """ + super().__init__(**kwargs) + self.upgrade_type: str = "HotfixUpgrade" + self.target_oss_version = target_oss_version + self.target_cluster_version = target_cluster_version + self.target_build_number = target_build_number + self.component_name = component_name + + class ClusterInstanceViewProperties(_serialization.Model): """Cluster Instance View Properties. @@ -792,49 +1261,11 @@ class ClusterInstanceViewsResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.ClusterInstanceViewResult"]] = None, **kwargs: Any) -> None: """ :keyword value: Cluster instance view array. - :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewResult] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = 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. E.g. - "/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.hdinsightcontainers.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: - """ """ + :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewResult] + """ super().__init__(**kwargs) + self.value = value + self.next_link = None class ClusterJob(ProxyResource): @@ -1049,45 +1480,18 @@ def __init__( self.metrics_enabled = metrics_enabled -class ClusterPatch(TrackedResource): +class ClusterPatch(_serialization.Model): """The patch for a cluster. - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/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.hdinsightcontainers.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. + :ivar location: The geo-location where the resource lives. :vartype location: str :ivar cluster_profile: Cluster resource patch properties. :vartype cluster_profile: ~azure.mgmt.hdinsightcontainers.models.UpdatableClusterProfile """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, "cluster_profile": {"key": "properties.clusterProfile", "type": "UpdatableClusterProfile"}, @@ -1096,20 +1500,22 @@ class ClusterPatch(TrackedResource): def __init__( self, *, - location: str, tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, cluster_profile: Optional["_models.UpdatableClusterProfile"] = None, **kwargs: Any ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. + :keyword location: The geo-location where the resource lives. :paramtype location: str :keyword cluster_profile: Cluster resource patch properties. :paramtype cluster_profile: ~azure.mgmt.hdinsightcontainers.models.UpdatableClusterProfile """ - super().__init__(tags=tags, location=location, **kwargs) + super().__init__(**kwargs) + self.tags = tags + self.location = location self.cluster_profile = cluster_profile @@ -1261,6 +1667,299 @@ def __init__( self.status = None +class ClusterPoolUpgradeProperties(_serialization.Model): + """Properties of upgrading cluster pool. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ClusterPoolAKSPatchVersionUpgradeProperties, ClusterPoolNodeOsImageUpdateProperties + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "NodeOsUpgrade". + :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeType + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + } + + _subtype_map = { + "upgrade_type": { + "AKSPatchUpgrade": "ClusterPoolAKSPatchVersionUpgradeProperties", + "NodeOsUpgrade": "ClusterPoolNodeOsImageUpdateProperties", + } + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.upgrade_type: Optional[str] = None + + +class ClusterPoolAKSPatchVersionUpgradeProperties(ClusterPoolUpgradeProperties): + """Properties of upgrading cluster pool's aks patch version. + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "NodeOsUpgrade". + :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeType + :ivar upgrade_cluster_pool: whether upgrade cluster pool or not. If it's true, + upgradeAllClusterNodes should be false. + :vartype upgrade_cluster_pool: bool + :ivar upgrade_all_cluster_nodes: whether upgrade all clusters' nodes. If it's true, + upgradeClusterPool should be false. + :vartype upgrade_all_cluster_nodes: bool + :ivar target_aks_version: Target aks version. When it's not set, latest version will be used. + When upgradeClusterPool is true and upgradeAllClusterNodes is false, target version should be + greater or equal to current version. When upgradeClusterPool is false and + upgradeAllClusterNodes is true, target version should be equal to aks version of cluster pool. + :vartype target_aks_version: str + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + "upgrade_cluster_pool": {"key": "upgradeClusterPool", "type": "bool"}, + "upgrade_all_cluster_nodes": {"key": "upgradeAllClusterNodes", "type": "bool"}, + "target_aks_version": {"key": "targetAksVersion", "type": "str"}, + } + + def __init__( + self, + *, + upgrade_cluster_pool: bool = False, + upgrade_all_cluster_nodes: bool = False, + target_aks_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword upgrade_cluster_pool: whether upgrade cluster pool or not. If it's true, + upgradeAllClusterNodes should be false. + :paramtype upgrade_cluster_pool: bool + :keyword upgrade_all_cluster_nodes: whether upgrade all clusters' nodes. If it's true, + upgradeClusterPool should be false. + :paramtype upgrade_all_cluster_nodes: bool + :keyword target_aks_version: Target aks version. When it's not set, latest version will be + used. When upgradeClusterPool is true and upgradeAllClusterNodes is false, target version + should be greater or equal to current version. When upgradeClusterPool is false and + upgradeAllClusterNodes is true, target version should be equal to aks version of cluster pool. + :paramtype target_aks_version: str + """ + super().__init__(**kwargs) + self.upgrade_type: str = "AKSPatchUpgrade" + self.upgrade_cluster_pool = upgrade_cluster_pool + self.upgrade_all_cluster_nodes = upgrade_all_cluster_nodes + self.target_aks_version = target_aks_version + + +class ClusterPoolAvailableUpgrade(ProxyResource): + """Cluster pool available upgrade. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.hdinsightcontainers.models.SystemData + :ivar upgrade_type: Type of upgrade. Known values are: "AKSPatchUpgrade" and "NodeOsUpgrade". + :vartype upgrade_type: str or + ~azure.mgmt.hdinsightcontainers.models.ClusterPoolAvailableUpgradeType + """ + + _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"}, + "upgrade_type": {"key": "properties.upgradeType", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.upgrade_type: Optional[str] = None + + +class ClusterPoolAvailableUpgradeProperties(_serialization.Model): + """Cluster pool available upgrade properties. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ClusterPoolAvailableUpgradeAksPatchUpgradeProperties, + ClusterPoolAvailableUpgradeNodeOsUpgradeProperties + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "NodeOsUpgrade". + :vartype upgrade_type: str or + ~azure.mgmt.hdinsightcontainers.models.ClusterPoolAvailableUpgradeType + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + } + + _subtype_map = { + "upgrade_type": { + "AKSPatchUpgrade": "ClusterPoolAvailableUpgradeAksPatchUpgradeProperties", + "NodeOsUpgrade": "ClusterPoolAvailableUpgradeNodeOsUpgradeProperties", + } + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.upgrade_type: Optional[str] = None + + +class ClusterPoolAvailableUpgradeAksPatchUpgradeProperties(ClusterPoolAvailableUpgradeProperties): + """Cluster pool available aks patch version upgrade. + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "NodeOsUpgrade". + :vartype upgrade_type: str or + ~azure.mgmt.hdinsightcontainers.models.ClusterPoolAvailableUpgradeType + :ivar current_version: Current AKS version. + :vartype current_version: str + :ivar current_version_status: Current AKS version's status: whether it is deprecated or + supported. Known values are: "Deprecated" and "Supported". + :vartype current_version_status: str or + ~azure.mgmt.hdinsightcontainers.models.CurrentClusterPoolAksVersionStatus + :ivar latest_version: Latest AKS patch version. + :vartype latest_version: str + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + "current_version": {"key": "currentVersion", "type": "str"}, + "current_version_status": {"key": "currentVersionStatus", "type": "str"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + } + + def __init__( + self, + *, + current_version: Optional[str] = None, + current_version_status: Optional[Union[str, "_models.CurrentClusterPoolAksVersionStatus"]] = None, + latest_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword current_version: Current AKS version. + :paramtype current_version: str + :keyword current_version_status: Current AKS version's status: whether it is deprecated or + supported. Known values are: "Deprecated" and "Supported". + :paramtype current_version_status: str or + ~azure.mgmt.hdinsightcontainers.models.CurrentClusterPoolAksVersionStatus + :keyword latest_version: Latest AKS patch version. + :paramtype latest_version: str + """ + super().__init__(**kwargs) + self.upgrade_type: str = "AKSPatchUpgrade" + self.current_version = current_version + self.current_version_status = current_version_status + self.latest_version = latest_version + + +class ClusterPoolAvailableUpgradeList(_serialization.Model): + """Collection of Cluster pool available upgrade. + + All required parameters must be populated in order to send to Azure. + + :ivar value: Collection of Cluster pool available upgrade. Required. + :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterPoolAvailableUpgrade] + :ivar next_link: The Url of next result page. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ClusterPoolAvailableUpgrade]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.ClusterPoolAvailableUpgrade"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Cluster pool available upgrade. Required. + :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterPoolAvailableUpgrade] + :keyword next_link: The Url of next result page. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ClusterPoolAvailableUpgradeNodeOsUpgradeProperties(ClusterPoolAvailableUpgradeProperties): + """Cluster pool available node os update. + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "NodeOsUpgrade". + :vartype upgrade_type: str or + ~azure.mgmt.hdinsightcontainers.models.ClusterPoolAvailableUpgradeType + :ivar latest_version: The latest node os version. + :vartype latest_version: str + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + } + + def __init__(self, *, latest_version: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword latest_version: The latest node os version. + :paramtype latest_version: str + """ + super().__init__(**kwargs) + self.upgrade_type: str = "NodeOsUpgrade" + self.latest_version = latest_version + + class ClusterPoolComputeProfile(_serialization.Model): """Cluster pool compute profile. @@ -1363,6 +2062,18 @@ class ClusterPoolNetworkProfile(_serialization.Model): :ivar subnet_id: Cluster pool subnet resource id. Required. :vartype subnet_id: str + :ivar outbound_type: This can only be set at cluster pool creation time and cannot be changed + later. Known values are: "loadBalancer" and "userDefinedRouting". + :vartype outbound_type: str or ~azure.mgmt.hdinsightcontainers.models.OutboundType + :ivar enable_private_api_server: ClusterPool is based on AKS cluster. Aks cluster exposes the + apiserver to public internet by default. If you set this property to true, a private aks + cluster will be created, and it will use private apiserver, which is not exposed to public + internet. + :vartype enable_private_api_server: bool + :ivar api_server_authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. + 137.117.106.88/29. This feature is not compatible with private AKS clusters. So you cannot set + enablePrivateApiServer to true and apiServerAuthorizedIpRanges at the same time. + :vartype api_server_authorized_ip_ranges: list[str] """ _validation = { @@ -1371,15 +2082,65 @@ class ClusterPoolNetworkProfile(_serialization.Model): _attribute_map = { "subnet_id": {"key": "subnetId", "type": "str"}, + "outbound_type": {"key": "outboundType", "type": "str"}, + "enable_private_api_server": {"key": "enablePrivateApiServer", "type": "bool"}, + "api_server_authorized_ip_ranges": {"key": "apiServerAuthorizedIpRanges", "type": "[str]"}, } - def __init__(self, *, subnet_id: str, **kwargs: Any) -> None: + def __init__( + self, + *, + subnet_id: str, + outbound_type: Union[str, "_models.OutboundType"] = "loadBalancer", + enable_private_api_server: Optional[bool] = None, + api_server_authorized_ip_ranges: Optional[List[str]] = None, + **kwargs: Any + ) -> None: """ :keyword subnet_id: Cluster pool subnet resource id. Required. :paramtype subnet_id: str + :keyword outbound_type: This can only be set at cluster pool creation time and cannot be + changed later. Known values are: "loadBalancer" and "userDefinedRouting". + :paramtype outbound_type: str or ~azure.mgmt.hdinsightcontainers.models.OutboundType + :keyword enable_private_api_server: ClusterPool is based on AKS cluster. Aks cluster exposes + the apiserver to public internet by default. If you set this property to true, a private aks + cluster will be created, and it will use private apiserver, which is not exposed to public + internet. + :paramtype enable_private_api_server: bool + :keyword api_server_authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. + 137.117.106.88/29. This feature is not compatible with private AKS clusters. So you cannot set + enablePrivateApiServer to true and apiServerAuthorizedIpRanges at the same time. + :paramtype api_server_authorized_ip_ranges: list[str] """ super().__init__(**kwargs) self.subnet_id = subnet_id + self.outbound_type = outbound_type + self.enable_private_api_server = enable_private_api_server + self.api_server_authorized_ip_ranges = api_server_authorized_ip_ranges + + +class ClusterPoolNodeOsImageUpdateProperties(ClusterPoolUpgradeProperties): + """Properties of upgrading cluster pool's aks patch version. + + All required parameters must be populated in order to send to Azure. + + :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and + "NodeOsUpgrade". + :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeType + """ + + _validation = { + "upgrade_type": {"required": True}, + } + + _attribute_map = { + "upgrade_type": {"key": "upgradeType", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.upgrade_type: str = "NodeOsUpgrade" class ClusterPoolProfile(_serialization.Model): @@ -1553,6 +2314,18 @@ class ClusterPoolResourcePropertiesNetworkProfile(ClusterPoolNetworkProfile): :ivar subnet_id: Cluster pool subnet resource id. Required. :vartype subnet_id: str + :ivar outbound_type: This can only be set at cluster pool creation time and cannot be changed + later. Known values are: "loadBalancer" and "userDefinedRouting". + :vartype outbound_type: str or ~azure.mgmt.hdinsightcontainers.models.OutboundType + :ivar enable_private_api_server: ClusterPool is based on AKS cluster. Aks cluster exposes the + apiserver to public internet by default. If you set this property to true, a private aks + cluster will be created, and it will use private apiserver, which is not exposed to public + internet. + :vartype enable_private_api_server: bool + :ivar api_server_authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. + 137.117.106.88/29. This feature is not compatible with private AKS clusters. So you cannot set + enablePrivateApiServer to true and apiServerAuthorizedIpRanges at the same time. + :vartype api_server_authorized_ip_ranges: list[str] """ _validation = { @@ -1561,14 +2334,69 @@ class ClusterPoolResourcePropertiesNetworkProfile(ClusterPoolNetworkProfile): _attribute_map = { "subnet_id": {"key": "subnetId", "type": "str"}, + "outbound_type": {"key": "outboundType", "type": "str"}, + "enable_private_api_server": {"key": "enablePrivateApiServer", "type": "bool"}, + "api_server_authorized_ip_ranges": {"key": "apiServerAuthorizedIpRanges", "type": "[str]"}, } - def __init__(self, *, subnet_id: str, **kwargs: Any) -> None: + def __init__( + self, + *, + subnet_id: str, + outbound_type: Union[str, "_models.OutboundType"] = "loadBalancer", + enable_private_api_server: Optional[bool] = None, + api_server_authorized_ip_ranges: Optional[List[str]] = None, + **kwargs: Any + ) -> None: """ :keyword subnet_id: Cluster pool subnet resource id. Required. :paramtype subnet_id: str + :keyword outbound_type: This can only be set at cluster pool creation time and cannot be + changed later. Known values are: "loadBalancer" and "userDefinedRouting". + :paramtype outbound_type: str or ~azure.mgmt.hdinsightcontainers.models.OutboundType + :keyword enable_private_api_server: ClusterPool is based on AKS cluster. Aks cluster exposes + the apiserver to public internet by default. If you set this property to true, a private aks + cluster will be created, and it will use private apiserver, which is not exposed to public + internet. + :paramtype enable_private_api_server: bool + :keyword api_server_authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. + 137.117.106.88/29. This feature is not compatible with private AKS clusters. So you cannot set + enablePrivateApiServer to true and apiServerAuthorizedIpRanges at the same time. + :paramtype api_server_authorized_ip_ranges: list[str] + """ + super().__init__( + subnet_id=subnet_id, + outbound_type=outbound_type, + enable_private_api_server=enable_private_api_server, + api_server_authorized_ip_ranges=api_server_authorized_ip_ranges, + **kwargs + ) + + +class ClusterPoolUpgrade(_serialization.Model): + """Cluster Pool Upgrade. + + All required parameters must be populated in order to send to Azure. + + :ivar properties: Properties of upgrading cluster pool. Required. + :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeProperties + """ + + _validation = { + "properties": {"required": True}, + } + + _attribute_map = { + "properties": {"key": "properties", "type": "ClusterPoolUpgradeProperties"}, + } + + def __init__(self, *, properties: "_models.ClusterPoolUpgradeProperties", **kwargs: Any) -> None: + """ + :keyword properties: Properties of upgrading cluster pool. Required. + :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeProperties """ - super().__init__(subnet_id=subnet_id, **kwargs) + super().__init__(**kwargs) + self.properties = properties class ClusterPoolVersion(ProxyResource): @@ -1678,7 +2506,8 @@ class ClusterProfile(_serialization.Model): # pylint: disable=too-many-instance :vartype oss_version: str :ivar components: Component list of this cluster type and version. :vartype components: list[~azure.mgmt.hdinsightcontainers.models.ClusterComponentsItem] - :ivar identity_profile: Identity Profile with details of an MSI. Required. + :ivar identity_profile: This property is required by Trino, Spark and Flink cluster but is + optional for Kafka cluster. :vartype identity_profile: ~azure.mgmt.hdinsightcontainers.models.IdentityProfile :ivar authorization_profile: Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. Required. @@ -1690,6 +2519,8 @@ class ClusterProfile(_serialization.Model): # pylint: disable=too-many-instance list[~azure.mgmt.hdinsightcontainers.models.ClusterServiceConfigsProfile] :ivar connectivity_profile: Cluster connectivity profile. :vartype connectivity_profile: ~azure.mgmt.hdinsightcontainers.models.ConnectivityProfile + :ivar cluster_access_profile: Cluster access profile. + :vartype cluster_access_profile: ~azure.mgmt.hdinsightcontainers.models.ClusterAccessProfile :ivar log_analytics_profile: Cluster log analytics profile to enable or disable OMS agent for cluster. :vartype log_analytics_profile: @@ -1701,8 +2532,11 @@ class ClusterProfile(_serialization.Model): # pylint: disable=too-many-instance :ivar autoscale_profile: This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with Autoscale. :vartype autoscale_profile: ~azure.mgmt.hdinsightcontainers.models.AutoscaleProfile - :ivar kafka_profile: Kafka cluster profile. - :vartype kafka_profile: dict[str, any] + :ivar ranger_plugin_profile: Cluster Ranger plugin profile. + :vartype ranger_plugin_profile: + ~azure.mgmt.hdinsightcontainers.models.ClusterRangerPluginProfile + :ivar kafka_profile: The Kafka cluster profile. + :vartype kafka_profile: ~azure.mgmt.hdinsightcontainers.models.KafkaProfile :ivar trino_profile: Trino Cluster profile. :vartype trino_profile: ~azure.mgmt.hdinsightcontainers.models.TrinoProfile :ivar llap_profile: LLAP cluster profile. @@ -1711,6 +2545,8 @@ class ClusterProfile(_serialization.Model): # pylint: disable=too-many-instance :vartype flink_profile: ~azure.mgmt.hdinsightcontainers.models.FlinkProfile :ivar spark_profile: The spark cluster profile. :vartype spark_profile: ~azure.mgmt.hdinsightcontainers.models.SparkProfile + :ivar ranger_profile: The ranger cluster profile. + :vartype ranger_profile: ~azure.mgmt.hdinsightcontainers.models.RangerProfile :ivar stub_profile: Stub cluster profile. :vartype stub_profile: dict[str, any] :ivar script_action_profiles: The script action profile list. @@ -1728,7 +2564,6 @@ class ClusterProfile(_serialization.Model): # pylint: disable=too-many-instance "pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$", }, "components": {"readonly": True}, - "identity_profile": {"required": True}, "authorization_profile": {"required": True}, "connectivity_profile": {"readonly": True}, } @@ -1742,15 +2577,18 @@ class ClusterProfile(_serialization.Model): # pylint: disable=too-many-instance "secrets_profile": {"key": "secretsProfile", "type": "SecretsProfile"}, "service_configs_profiles": {"key": "serviceConfigsProfiles", "type": "[ClusterServiceConfigsProfile]"}, "connectivity_profile": {"key": "connectivityProfile", "type": "ConnectivityProfile"}, + "cluster_access_profile": {"key": "clusterAccessProfile", "type": "ClusterAccessProfile"}, "log_analytics_profile": {"key": "logAnalyticsProfile", "type": "ClusterLogAnalyticsProfile"}, "prometheus_profile": {"key": "prometheusProfile", "type": "ClusterPrometheusProfile"}, "ssh_profile": {"key": "sshProfile", "type": "SshProfile"}, "autoscale_profile": {"key": "autoscaleProfile", "type": "AutoscaleProfile"}, - "kafka_profile": {"key": "kafkaProfile", "type": "{object}"}, + "ranger_plugin_profile": {"key": "rangerPluginProfile", "type": "ClusterRangerPluginProfile"}, + "kafka_profile": {"key": "kafkaProfile", "type": "KafkaProfile"}, "trino_profile": {"key": "trinoProfile", "type": "TrinoProfile"}, "llap_profile": {"key": "llapProfile", "type": "{object}"}, "flink_profile": {"key": "flinkProfile", "type": "FlinkProfile"}, "spark_profile": {"key": "sparkProfile", "type": "SparkProfile"}, + "ranger_profile": {"key": "rangerProfile", "type": "RangerProfile"}, "stub_profile": {"key": "stubProfile", "type": "{object}"}, "script_action_profiles": {"key": "scriptActionProfiles", "type": "[ScriptActionProfile]"}, } @@ -1760,19 +2598,22 @@ def __init__( *, cluster_version: str, oss_version: str, - identity_profile: "_models.IdentityProfile", authorization_profile: "_models.AuthorizationProfile", + identity_profile: Optional["_models.IdentityProfile"] = None, secrets_profile: Optional["_models.SecretsProfile"] = None, service_configs_profiles: Optional[List["_models.ClusterServiceConfigsProfile"]] = None, + cluster_access_profile: Optional["_models.ClusterAccessProfile"] = None, log_analytics_profile: Optional["_models.ClusterLogAnalyticsProfile"] = None, prometheus_profile: Optional["_models.ClusterPrometheusProfile"] = None, ssh_profile: Optional["_models.SshProfile"] = None, autoscale_profile: Optional["_models.AutoscaleProfile"] = None, - kafka_profile: Optional[Dict[str, Any]] = None, + ranger_plugin_profile: Optional["_models.ClusterRangerPluginProfile"] = None, + kafka_profile: Optional["_models.KafkaProfile"] = None, trino_profile: Optional["_models.TrinoProfile"] = None, llap_profile: Optional[Dict[str, Any]] = None, flink_profile: Optional["_models.FlinkProfile"] = None, spark_profile: Optional["_models.SparkProfile"] = None, + ranger_profile: Optional["_models.RangerProfile"] = None, stub_profile: Optional[Dict[str, Any]] = None, script_action_profiles: Optional[List["_models.ScriptActionProfile"]] = None, **kwargs: Any @@ -1782,7 +2623,8 @@ def __init__( :paramtype cluster_version: str :keyword oss_version: Version with three part. Required. :paramtype oss_version: str - :keyword identity_profile: Identity Profile with details of an MSI. Required. + :keyword identity_profile: This property is required by Trino, Spark and Flink cluster but is + optional for Kafka cluster. :paramtype identity_profile: ~azure.mgmt.hdinsightcontainers.models.IdentityProfile :keyword authorization_profile: Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. Required. @@ -1792,6 +2634,8 @@ def __init__( :keyword service_configs_profiles: The service configs profiles. :paramtype service_configs_profiles: list[~azure.mgmt.hdinsightcontainers.models.ClusterServiceConfigsProfile] + :keyword cluster_access_profile: Cluster access profile. + :paramtype cluster_access_profile: ~azure.mgmt.hdinsightcontainers.models.ClusterAccessProfile :keyword log_analytics_profile: Cluster log analytics profile to enable or disable OMS agent for cluster. :paramtype log_analytics_profile: @@ -1803,8 +2647,11 @@ def __init__( :keyword autoscale_profile: This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with Autoscale. :paramtype autoscale_profile: ~azure.mgmt.hdinsightcontainers.models.AutoscaleProfile - :keyword kafka_profile: Kafka cluster profile. - :paramtype kafka_profile: dict[str, any] + :keyword ranger_plugin_profile: Cluster Ranger plugin profile. + :paramtype ranger_plugin_profile: + ~azure.mgmt.hdinsightcontainers.models.ClusterRangerPluginProfile + :keyword kafka_profile: The Kafka cluster profile. + :paramtype kafka_profile: ~azure.mgmt.hdinsightcontainers.models.KafkaProfile :keyword trino_profile: Trino Cluster profile. :paramtype trino_profile: ~azure.mgmt.hdinsightcontainers.models.TrinoProfile :keyword llap_profile: LLAP cluster profile. @@ -1813,6 +2660,8 @@ def __init__( :paramtype flink_profile: ~azure.mgmt.hdinsightcontainers.models.FlinkProfile :keyword spark_profile: The spark cluster profile. :paramtype spark_profile: ~azure.mgmt.hdinsightcontainers.models.SparkProfile + :keyword ranger_profile: The ranger cluster profile. + :paramtype ranger_profile: ~azure.mgmt.hdinsightcontainers.models.RangerProfile :keyword stub_profile: Stub cluster profile. :paramtype stub_profile: dict[str, any] :keyword script_action_profiles: The script action profile list. @@ -1828,25 +2677,54 @@ def __init__( self.secrets_profile = secrets_profile self.service_configs_profiles = service_configs_profiles self.connectivity_profile = None + self.cluster_access_profile = cluster_access_profile self.log_analytics_profile = log_analytics_profile self.prometheus_profile = prometheus_profile self.ssh_profile = ssh_profile self.autoscale_profile = autoscale_profile + self.ranger_plugin_profile = ranger_plugin_profile self.kafka_profile = kafka_profile self.trino_profile = trino_profile self.llap_profile = llap_profile self.flink_profile = flink_profile self.spark_profile = spark_profile + self.ranger_profile = ranger_profile self.stub_profile = stub_profile self.script_action_profiles = script_action_profiles -class ClusterPrometheusProfile(_serialization.Model): - """Cluster Prometheus profile. +class ClusterPrometheusProfile(_serialization.Model): + """Cluster Prometheus profile. + + All required parameters must be populated in order to send to Azure. + + :ivar enabled: Enable Prometheus for cluster or not. Required. + :vartype enabled: bool + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: bool = False, **kwargs: Any) -> None: + """ + :keyword enabled: Enable Prometheus for cluster or not. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ClusterRangerPluginProfile(_serialization.Model): + """Cluster Ranger plugin profile. All required parameters must be populated in order to send to Azure. - :ivar enabled: Enable Prometheus for cluster or not. Required. + :ivar enabled: Enable ranger for cluster or not. Required. :vartype enabled: bool """ @@ -1860,7 +2738,7 @@ class ClusterPrometheusProfile(_serialization.Model): def __init__(self, *, enabled: bool = False, **kwargs: Any) -> None: """ - :keyword enabled: Enable Prometheus for cluster or not. Required. + :keyword enabled: Enable ranger for cluster or not. Required. :paramtype enabled: bool """ super().__init__(**kwargs) @@ -1997,6 +2875,32 @@ def __init__(self, *, service_name: str, configs: List["_models.ClusterServiceCo self.configs = configs +class ClusterUpgrade(_serialization.Model): + """Cluster Upgrade. + + All required parameters must be populated in order to send to Azure. + + :ivar properties: Properties of upgrading cluster. Required. + :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeProperties + """ + + _validation = { + "properties": {"required": True}, + } + + _attribute_map = { + "properties": {"key": "properties", "type": "ClusterUpgradeProperties"}, + } + + def __init__(self, *, properties: "_models.ClusterUpgradeProperties", **kwargs: Any) -> None: + """ + :keyword properties: Properties of upgrading cluster. Required. + :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeProperties + """ + super().__init__(**kwargs) + self.properties = properties + + class ClusterVersion(ProxyResource): """Available cluster version. @@ -2253,6 +3157,9 @@ class WebConnectivityEndpoint(_serialization.Model): :ivar fqdn: Web connectivity endpoint. Required. :vartype fqdn: str + :ivar private_fqdn: Private web connectivity endpoint. This property will only be returned when + enableInternalIngress is true. + :vartype private_fqdn: str """ _validation = { @@ -2261,15 +3168,20 @@ class WebConnectivityEndpoint(_serialization.Model): _attribute_map = { "fqdn": {"key": "fqdn", "type": "str"}, + "private_fqdn": {"key": "privateFqdn", "type": "str"}, } - def __init__(self, *, fqdn: str, **kwargs: Any) -> None: + def __init__(self, *, fqdn: str, private_fqdn: Optional[str] = None, **kwargs: Any) -> None: """ :keyword fqdn: Web connectivity endpoint. Required. :paramtype fqdn: str + :keyword private_fqdn: Private web connectivity endpoint. This property will only be returned + when enableInternalIngress is true. + :paramtype private_fqdn: str """ super().__init__(**kwargs) self.fqdn = fqdn + self.private_fqdn = private_fqdn class ConnectivityProfileWeb(WebConnectivityEndpoint): @@ -2279,6 +3191,9 @@ class ConnectivityProfileWeb(WebConnectivityEndpoint): :ivar fqdn: Web connectivity endpoint. Required. :vartype fqdn: str + :ivar private_fqdn: Private web connectivity endpoint. This property will only be returned when + enableInternalIngress is true. + :vartype private_fqdn: str """ _validation = { @@ -2287,14 +3202,59 @@ class ConnectivityProfileWeb(WebConnectivityEndpoint): _attribute_map = { "fqdn": {"key": "fqdn", "type": "str"}, + "private_fqdn": {"key": "privateFqdn", "type": "str"}, } - def __init__(self, *, fqdn: str, **kwargs: Any) -> None: + def __init__(self, *, fqdn: str, private_fqdn: Optional[str] = None, **kwargs: Any) -> None: """ :keyword fqdn: Web connectivity endpoint. Required. :paramtype fqdn: str + :keyword private_fqdn: Private web connectivity endpoint. This property will only be returned + when enableInternalIngress is true. + :paramtype private_fqdn: str + """ + super().__init__(fqdn=fqdn, private_fqdn=private_fqdn, **kwargs) + + +class DiskStorageProfile(_serialization.Model): + """Kafka disk storage profile. + + All required parameters must be populated in order to send to Azure. + + :ivar data_disk_size: Managed Disk size in GB. The maximum supported disk size for Standard and + Premium HDD/SSD is 32TB, except for Premium SSD v2, which supports up to 64TB. Required. + :vartype data_disk_size: int + :ivar data_disk_type: Managed Disk Type. Required. Known values are: "Standard_HDD_LRS", + "Standard_SSD_LRS", "Standard_SSD_ZRS", "Premium_SSD_LRS", "Premium_SSD_ZRS", and + "Premium_SSD_v2_LRS". + :vartype data_disk_type: str or ~azure.mgmt.hdinsightcontainers.models.DataDiskType + """ + + _validation = { + "data_disk_size": {"required": True}, + "data_disk_type": {"required": True}, + } + + _attribute_map = { + "data_disk_size": {"key": "dataDiskSize", "type": "int"}, + "data_disk_type": {"key": "dataDiskType", "type": "str"}, + } + + def __init__( + self, *, data_disk_size: int, data_disk_type: Union[str, "_models.DataDiskType"], **kwargs: Any + ) -> None: """ - super().__init__(fqdn=fqdn, **kwargs) + :keyword data_disk_size: Managed Disk size in GB. The maximum supported disk size for Standard + and Premium HDD/SSD is 32TB, except for Premium SSD v2, which supports up to 64TB. Required. + :paramtype data_disk_size: int + :keyword data_disk_type: Managed Disk Type. Required. Known values are: "Standard_HDD_LRS", + "Standard_SSD_LRS", "Standard_SSD_ZRS", "Premium_SSD_LRS", "Premium_SSD_ZRS", and + "Premium_SSD_v2_LRS". + :paramtype data_disk_type: str or ~azure.mgmt.hdinsightcontainers.models.DataDiskType + """ + super().__init__(**kwargs) + self.data_disk_size = data_disk_size + self.data_disk_type = data_disk_type class ErrorAdditionalInfo(_serialization.Model): @@ -2414,22 +3374,30 @@ class FlinkHiveCatalogOption(_serialization.Model): All required parameters must be populated in order to send to Azure. + :ivar metastore_db_connection_authentication_mode: The authentication mode to connect to your + Hive metastore database. More details: + https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization. + Known values are: "SqlAuth" and "IdentityAuth". + :vartype metastore_db_connection_authentication_mode: str or + ~azure.mgmt.hdinsightcontainers.models.MetastoreDbConnectionAuthenticationMode :ivar metastore_db_connection_password_secret: Secret reference name from - secretsProfile.secrets containing password for database connection. Required. + secretsProfile.secrets containing password for database connection. :vartype metastore_db_connection_password_secret: str :ivar metastore_db_connection_url: Connection string for hive metastore database. Required. :vartype metastore_db_connection_url: str - :ivar metastore_db_connection_user_name: User name for database connection. Required. + :ivar metastore_db_connection_user_name: User name for database connection. :vartype metastore_db_connection_user_name: str """ _validation = { - "metastore_db_connection_password_secret": {"required": True}, "metastore_db_connection_url": {"required": True}, - "metastore_db_connection_user_name": {"required": True}, } _attribute_map = { + "metastore_db_connection_authentication_mode": { + "key": "metastoreDbConnectionAuthenticationMode", + "type": "str", + }, "metastore_db_connection_password_secret": {"key": "metastoreDbConnectionPasswordSecret", "type": "str"}, "metastore_db_connection_url": {"key": "metastoreDbConnectionURL", "type": "str"}, "metastore_db_connection_user_name": {"key": "metastoreDbConnectionUserName", "type": "str"}, @@ -2438,26 +3406,118 @@ class FlinkHiveCatalogOption(_serialization.Model): def __init__( self, *, - metastore_db_connection_password_secret: str, metastore_db_connection_url: str, - metastore_db_connection_user_name: str, + metastore_db_connection_authentication_mode: Optional[ + Union[str, "_models.MetastoreDbConnectionAuthenticationMode"] + ] = None, + metastore_db_connection_password_secret: Optional[str] = None, + metastore_db_connection_user_name: Optional[str] = None, **kwargs: Any ) -> None: """ + :keyword metastore_db_connection_authentication_mode: The authentication mode to connect to + your Hive metastore database. More details: + https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization. + Known values are: "SqlAuth" and "IdentityAuth". + :paramtype metastore_db_connection_authentication_mode: str or + ~azure.mgmt.hdinsightcontainers.models.MetastoreDbConnectionAuthenticationMode :keyword metastore_db_connection_password_secret: Secret reference name from - secretsProfile.secrets containing password for database connection. Required. + secretsProfile.secrets containing password for database connection. :paramtype metastore_db_connection_password_secret: str :keyword metastore_db_connection_url: Connection string for hive metastore database. Required. :paramtype metastore_db_connection_url: str - :keyword metastore_db_connection_user_name: User name for database connection. Required. + :keyword metastore_db_connection_user_name: User name for database connection. :paramtype metastore_db_connection_user_name: str """ super().__init__(**kwargs) + self.metastore_db_connection_authentication_mode = metastore_db_connection_authentication_mode self.metastore_db_connection_password_secret = metastore_db_connection_password_secret self.metastore_db_connection_url = metastore_db_connection_url self.metastore_db_connection_user_name = metastore_db_connection_user_name +class FlinkJobProfile(_serialization.Model): + """Job specifications for flink clusters in application deployment mode. The specification is + immutable even if job properties are changed by calling the RunJob API, please use the ListJob + API to get the latest job information. + + All required parameters must be populated in order to send to Azure. + + :ivar job_jar_directory: A string property that specifies the directory where the job JAR is + located. Required. + :vartype job_jar_directory: str + :ivar jar_name: A string property that represents the name of the job JAR. Required. + :vartype jar_name: str + :ivar entry_class: A string property that specifies the entry class for the Flink job. + :vartype entry_class: str + :ivar args: A string property representing additional JVM arguments for the Flink job. It + should be space separated value. + :vartype args: str + :ivar save_point_name: A string property that represents the name of the savepoint for the + Flink job. + :vartype save_point_name: str + :ivar upgrade_mode: A string property that indicates the upgrade mode to be performed on the + Flink job. It can have one of the following enum values => STATELESS_UPDATE, SAVEPOINT, + LAST_STATE_UPDATE. Required. Known values are: "STATELESS_UPDATE", "UPDATE", and + "LAST_STATE_UPDATE". + :vartype upgrade_mode: str or ~azure.mgmt.hdinsightcontainers.models.UpgradeMode + """ + + _validation = { + "job_jar_directory": {"required": True}, + "jar_name": {"required": True}, + "upgrade_mode": {"required": True}, + } + + _attribute_map = { + "job_jar_directory": {"key": "jobJarDirectory", "type": "str"}, + "jar_name": {"key": "jarName", "type": "str"}, + "entry_class": {"key": "entryClass", "type": "str"}, + "args": {"key": "args", "type": "str"}, + "save_point_name": {"key": "savePointName", "type": "str"}, + "upgrade_mode": {"key": "upgradeMode", "type": "str"}, + } + + def __init__( + self, + *, + job_jar_directory: str, + jar_name: str, + upgrade_mode: Union[str, "_models.UpgradeMode"], + entry_class: Optional[str] = None, + args: Optional[str] = None, + save_point_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword job_jar_directory: A string property that specifies the directory where the job JAR is + located. Required. + :paramtype job_jar_directory: str + :keyword jar_name: A string property that represents the name of the job JAR. Required. + :paramtype jar_name: str + :keyword entry_class: A string property that specifies the entry class for the Flink job. + :paramtype entry_class: str + :keyword args: A string property representing additional JVM arguments for the Flink job. It + should be space separated value. + :paramtype args: str + :keyword save_point_name: A string property that represents the name of the savepoint for the + Flink job. + :paramtype save_point_name: str + :keyword upgrade_mode: A string property that indicates the upgrade mode to be performed on the + Flink job. It can have one of the following enum values => STATELESS_UPDATE, SAVEPOINT, + LAST_STATE_UPDATE. Required. Known values are: "STATELESS_UPDATE", "UPDATE", and + "LAST_STATE_UPDATE". + :paramtype upgrade_mode: str or ~azure.mgmt.hdinsightcontainers.models.UpgradeMode + """ + super().__init__(**kwargs) + self.job_jar_directory = job_jar_directory + self.jar_name = jar_name + self.entry_class = entry_class + self.args = args + self.save_point_name = save_point_name + self.upgrade_mode = upgrade_mode + + class FlinkJobProperties(ClusterJobProperties): # pylint: disable=too-many-instance-attributes """Properties of flink job. @@ -2467,7 +3527,9 @@ class FlinkJobProperties(ClusterJobProperties): # pylint: disable=too-many-inst :ivar job_type: Type of cluster job. Required. "FlinkJob" :vartype job_type: str or ~azure.mgmt.hdinsightcontainers.models.JobType - :ivar job_name: Name of job. Required. + :ivar run_id: Run id of job. + :vartype run_id: str + :ivar job_name: Name of job. :vartype job_name: str :ivar job_jar_directory: A string property that specifies the directory where the job JAR is located. @@ -2485,7 +3547,8 @@ class FlinkJobProperties(ClusterJobProperties): # pylint: disable=too-many-inst :ivar action: A string property that indicates the action to be performed on the Flink job. It can have one of the following enum values => NEW, UPDATE, STATELESS_UPDATE, STOP, START, CANCEL, SAVEPOINT, LIST_SAVEPOINT, or DELETE. Known values are: "NEW", "UPDATE", - "STATELESS_UPDATE", "STOP", "START", "CANCEL", "SAVEPOINT", "LIST_SAVEPOINT", and "DELETE". + "STATELESS_UPDATE", "STOP", "START", "CANCEL", "SAVEPOINT", "LIST_SAVEPOINT", "DELETE", + "LAST_STATE_UPDATE", and "RE_LAUNCH". :vartype action: str or ~azure.mgmt.hdinsightcontainers.models.Action :ivar flink_configuration: Additional properties used to configure Flink jobs. It allows users to set properties such as parallelism and jobSavePointDirectory. It accepts additional @@ -2505,7 +3568,6 @@ class FlinkJobProperties(ClusterJobProperties): # pylint: disable=too-many-inst _validation = { "job_type": {"required": True}, - "job_name": {"required": True}, "job_id": {"readonly": True}, "status": {"readonly": True}, "job_output": {"readonly": True}, @@ -2515,6 +3577,7 @@ class FlinkJobProperties(ClusterJobProperties): # pylint: disable=too-many-inst _attribute_map = { "job_type": {"key": "jobType", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, "job_name": {"key": "jobName", "type": "str"}, "job_jar_directory": {"key": "jobJarDirectory", "type": "str"}, "jar_name": {"key": "jarName", "type": "str"}, @@ -2533,7 +3596,8 @@ class FlinkJobProperties(ClusterJobProperties): # pylint: disable=too-many-inst def __init__( self, *, - job_name: str, + run_id: Optional[str] = None, + job_name: Optional[str] = None, job_jar_directory: Optional[str] = None, jar_name: Optional[str] = None, entry_class: Optional[str] = None, @@ -2544,7 +3608,9 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword job_name: Name of job. Required. + :keyword run_id: Run id of job. + :paramtype run_id: str + :keyword job_name: Name of job. :paramtype job_name: str :keyword job_jar_directory: A string property that specifies the directory where the job JAR is located. @@ -2562,7 +3628,8 @@ def __init__( :keyword action: A string property that indicates the action to be performed on the Flink job. It can have one of the following enum values => NEW, UPDATE, STATELESS_UPDATE, STOP, START, CANCEL, SAVEPOINT, LIST_SAVEPOINT, or DELETE. Known values are: "NEW", "UPDATE", - "STATELESS_UPDATE", "STOP", "START", "CANCEL", "SAVEPOINT", "LIST_SAVEPOINT", and "DELETE". + "STATELESS_UPDATE", "STOP", "START", "CANCEL", "SAVEPOINT", "LIST_SAVEPOINT", "DELETE", + "LAST_STATE_UPDATE", and "RE_LAUNCH". :paramtype action: str or ~azure.mgmt.hdinsightcontainers.models.Action :keyword flink_configuration: Additional properties used to configure Flink jobs. It allows users to set properties such as parallelism and jobSavePointDirectory. It accepts additional @@ -2571,6 +3638,7 @@ def __init__( """ super().__init__(**kwargs) self.job_type: str = "FlinkJob" + self.run_id = run_id self.job_name = job_name self.job_jar_directory = job_jar_directory self.jar_name = jar_name @@ -2603,6 +3671,14 @@ class FlinkProfile(_serialization.Model): :vartype task_manager: ~azure.mgmt.hdinsightcontainers.models.ComputeResourceDefinition :ivar catalog_options: Flink cluster catalog options. :vartype catalog_options: ~azure.mgmt.hdinsightcontainers.models.FlinkCatalogOptions + :ivar deployment_mode: A string property that indicates the deployment mode of Flink cluster. + It can have one of the following enum values => Application, Session. Default value is Session. + Known values are: "Application" and "Session". + :vartype deployment_mode: str or ~azure.mgmt.hdinsightcontainers.models.DeploymentMode + :ivar job_spec: Job specifications for flink clusters in application deployment mode. The + specification is immutable even if job properties are changed by calling the RunJob API, please + use the ListJob API to get the latest job information. + :vartype job_spec: ~azure.mgmt.hdinsightcontainers.models.FlinkJobProfile """ _validation = { @@ -2618,6 +3694,8 @@ class FlinkProfile(_serialization.Model): "history_server": {"key": "historyServer", "type": "ComputeResourceDefinition"}, "task_manager": {"key": "taskManager", "type": "ComputeResourceDefinition"}, "catalog_options": {"key": "catalogOptions", "type": "FlinkCatalogOptions"}, + "deployment_mode": {"key": "deploymentMode", "type": "str"}, + "job_spec": {"key": "jobSpec", "type": "FlinkJobProfile"}, } def __init__( @@ -2629,6 +3707,8 @@ def __init__( num_replicas: Optional[int] = None, history_server: Optional["_models.ComputeResourceDefinition"] = None, catalog_options: Optional["_models.FlinkCatalogOptions"] = None, + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, + job_spec: Optional["_models.FlinkJobProfile"] = None, **kwargs: Any ) -> None: """ @@ -2644,6 +3724,14 @@ def __init__( :paramtype task_manager: ~azure.mgmt.hdinsightcontainers.models.ComputeResourceDefinition :keyword catalog_options: Flink cluster catalog options. :paramtype catalog_options: ~azure.mgmt.hdinsightcontainers.models.FlinkCatalogOptions + :keyword deployment_mode: A string property that indicates the deployment mode of Flink + cluster. It can have one of the following enum values => Application, Session. Default value is + Session. Known values are: "Application" and "Session". + :paramtype deployment_mode: str or ~azure.mgmt.hdinsightcontainers.models.DeploymentMode + :keyword job_spec: Job specifications for flink clusters in application deployment mode. The + specification is immutable even if job properties are changed by calling the RunJob API, please + use the ListJob API to get the latest job information. + :paramtype job_spec: ~azure.mgmt.hdinsightcontainers.models.FlinkJobProfile """ super().__init__(**kwargs) self.storage = storage @@ -2652,6 +3740,8 @@ def __init__( self.history_server = history_server self.task_manager = task_manager self.catalog_options = catalog_options + self.deployment_mode = deployment_mode + self.job_spec = job_spec class FlinkStorageProfile(_serialization.Model): @@ -2667,7 +3757,7 @@ class FlinkStorageProfile(_serialization.Model): """ _validation = { - "storage_uri": {"required": True, "pattern": r"^(\w{4,5})://(.*)@(.*).\b(blob|dfs)\b\.core\.windows\.net$"}, + "storage_uri": {"required": True, "pattern": r"^(\w{4,5})://(.*)@(.*).\b(blob|dfs)\b.*$"}, } _attribute_map = { @@ -2695,12 +3785,18 @@ class HiveCatalogOption(_serialization.Model): :ivar catalog_name: Name of trino catalog which should use specified hive metastore. Required. :vartype catalog_name: str + :ivar metastore_db_connection_authentication_mode: The authentication mode to connect to your + Hive metastore database. More details: + https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization. + Known values are: "SqlAuth" and "IdentityAuth". + :vartype metastore_db_connection_authentication_mode: str or + ~azure.mgmt.hdinsightcontainers.models.MetastoreDbConnectionAuthenticationMode :ivar metastore_db_connection_password_secret: Secret reference name from - secretsProfile.secrets containing password for database connection. Required. + secretsProfile.secrets containing password for database connection. :vartype metastore_db_connection_password_secret: str :ivar metastore_db_connection_url: Connection string for hive metastore database. Required. :vartype metastore_db_connection_url: str - :ivar metastore_db_connection_user_name: User name for database connection. Required. + :ivar metastore_db_connection_user_name: User name for database connection. :vartype metastore_db_connection_user_name: str :ivar metastore_warehouse_dir: Metastore root directory URI, format: abfs[s]://@:code:``.dfs.core.windows.net/:code:``. More details: @@ -2711,14 +3807,16 @@ class HiveCatalogOption(_serialization.Model): _validation = { "catalog_name": {"required": True, "min_length": 1}, - "metastore_db_connection_password_secret": {"required": True}, "metastore_db_connection_url": {"required": True}, - "metastore_db_connection_user_name": {"required": True}, "metastore_warehouse_dir": {"required": True}, } _attribute_map = { "catalog_name": {"key": "catalogName", "type": "str"}, + "metastore_db_connection_authentication_mode": { + "key": "metastoreDbConnectionAuthenticationMode", + "type": "str", + }, "metastore_db_connection_password_secret": {"key": "metastoreDbConnectionPasswordSecret", "type": "str"}, "metastore_db_connection_url": {"key": "metastoreDbConnectionURL", "type": "str"}, "metastore_db_connection_user_name": {"key": "metastoreDbConnectionUserName", "type": "str"}, @@ -2729,22 +3827,31 @@ def __init__( self, *, catalog_name: str, - metastore_db_connection_password_secret: str, metastore_db_connection_url: str, - metastore_db_connection_user_name: str, metastore_warehouse_dir: str, + metastore_db_connection_authentication_mode: Optional[ + Union[str, "_models.MetastoreDbConnectionAuthenticationMode"] + ] = None, + metastore_db_connection_password_secret: Optional[str] = None, + metastore_db_connection_user_name: Optional[str] = None, **kwargs: Any ) -> None: """ :keyword catalog_name: Name of trino catalog which should use specified hive metastore. Required. :paramtype catalog_name: str + :keyword metastore_db_connection_authentication_mode: The authentication mode to connect to + your Hive metastore database. More details: + https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization. + Known values are: "SqlAuth" and "IdentityAuth". + :paramtype metastore_db_connection_authentication_mode: str or + ~azure.mgmt.hdinsightcontainers.models.MetastoreDbConnectionAuthenticationMode :keyword metastore_db_connection_password_secret: Secret reference name from - secretsProfile.secrets containing password for database connection. Required. + secretsProfile.secrets containing password for database connection. :paramtype metastore_db_connection_password_secret: str :keyword metastore_db_connection_url: Connection string for hive metastore database. Required. :paramtype metastore_db_connection_url: str - :keyword metastore_db_connection_user_name: User name for database connection. Required. + :keyword metastore_db_connection_user_name: User name for database connection. :paramtype metastore_db_connection_user_name: str :keyword metastore_warehouse_dir: Metastore root directory URI, format: abfs[s]://@:code:``.dfs.core.windows.net/:code:``. More details: @@ -2754,12 +3861,114 @@ def __init__( """ super().__init__(**kwargs) self.catalog_name = catalog_name + self.metastore_db_connection_authentication_mode = metastore_db_connection_authentication_mode self.metastore_db_connection_password_secret = metastore_db_connection_password_secret self.metastore_db_connection_url = metastore_db_connection_url self.metastore_db_connection_user_name = metastore_db_connection_user_name self.metastore_warehouse_dir = metastore_warehouse_dir +class KafkaConnectivityProfile(_serialization.Model): + """Kafka bootstrap server and broker related connectivity profile. + + :ivar bootstrap_server_endpoint: bootstrap server connectivity endpoint. + :vartype bootstrap_server_endpoint: str + :ivar broker_endpoints: Kafka broker endpoint list. + :vartype broker_endpoints: list[str] + """ + + _attribute_map = { + "bootstrap_server_endpoint": {"key": "bootstrapServerEndpoint", "type": "str"}, + "broker_endpoints": {"key": "brokerEndpoints", "type": "[str]"}, + } + + def __init__( + self, + *, + bootstrap_server_endpoint: Optional[str] = None, + broker_endpoints: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword bootstrap_server_endpoint: bootstrap server connectivity endpoint. + :paramtype bootstrap_server_endpoint: str + :keyword broker_endpoints: Kafka broker endpoint list. + :paramtype broker_endpoints: list[str] + """ + super().__init__(**kwargs) + self.bootstrap_server_endpoint = bootstrap_server_endpoint + self.broker_endpoints = broker_endpoints + + +class KafkaProfile(_serialization.Model): + """The Kafka cluster profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar enable_k_raft: Expose Kafka cluster in KRaft mode. + :vartype enable_k_raft: bool + :ivar enable_public_endpoints: Expose worker nodes as public endpoints. + :vartype enable_public_endpoints: bool + :ivar remote_storage_uri: Fully qualified path of Azure Storage container used for Tiered + Storage. + :vartype remote_storage_uri: str + :ivar disk_storage: Kafka disk storage profile. Required. + :vartype disk_storage: ~azure.mgmt.hdinsightcontainers.models.DiskStorageProfile + :ivar cluster_identity: Identity of the internal service components inside the Kafka cluster. + :vartype cluster_identity: ~azure.mgmt.hdinsightcontainers.models.IdentityProfile + :ivar kafka_connectivity_profile: Kafka bootstrap server and brokers related connectivity + profile. + :vartype kafka_connectivity_profile: + ~azure.mgmt.hdinsightcontainers.models.KafkaConnectivityProfile + """ + + _validation = { + "remote_storage_uri": {"pattern": r"^(https?|abfss?):\/\/[^/]+(?:\/|$)"}, + "disk_storage": {"required": True}, + "cluster_identity": {"readonly": True}, + "kafka_connectivity_profile": {"readonly": True}, + } + + _attribute_map = { + "enable_k_raft": {"key": "enableKRaft", "type": "bool"}, + "enable_public_endpoints": {"key": "enablePublicEndpoints", "type": "bool"}, + "remote_storage_uri": {"key": "remoteStorageUri", "type": "str"}, + "disk_storage": {"key": "diskStorage", "type": "DiskStorageProfile"}, + "cluster_identity": {"key": "clusterIdentity", "type": "IdentityProfile"}, + "kafka_connectivity_profile": {"key": "kafkaConnectivityProfile", "type": "KafkaConnectivityProfile"}, + } + + def __init__( + self, + *, + disk_storage: "_models.DiskStorageProfile", + enable_k_raft: bool = True, + enable_public_endpoints: bool = False, + remote_storage_uri: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword enable_k_raft: Expose Kafka cluster in KRaft mode. + :paramtype enable_k_raft: bool + :keyword enable_public_endpoints: Expose worker nodes as public endpoints. + :paramtype enable_public_endpoints: bool + :keyword remote_storage_uri: Fully qualified path of Azure Storage container used for Tiered + Storage. + :paramtype remote_storage_uri: str + :keyword disk_storage: Kafka disk storage profile. Required. + :paramtype disk_storage: ~azure.mgmt.hdinsightcontainers.models.DiskStorageProfile + """ + super().__init__(**kwargs) + self.enable_k_raft = enable_k_raft + self.enable_public_endpoints = enable_public_endpoints + self.remote_storage_uri = remote_storage_uri + self.disk_storage = disk_storage + self.cluster_identity = None + self.kafka_connectivity_profile = None + + class LoadBasedConfig(_serialization.Model): """Profile of load based Autoscale. @@ -3063,6 +4272,231 @@ def __init__(self, **kwargs: Any) -> None: self.next_link = None +class RangerAdminSpec(_serialization.Model): + """Specification for the Ranger Admin service. + + All required parameters must be populated in order to send to Azure. + + :ivar admins: List of usernames that should be marked as ranger admins. These usernames should + match the User principal name of the respective AAD users. Required. + :vartype admins: list[str] + :ivar database: Required. + :vartype database: ~azure.mgmt.hdinsightcontainers.models.RangerAdminSpecDatabase + """ + + _validation = { + "admins": {"required": True}, + "database": {"required": True}, + } + + _attribute_map = { + "admins": {"key": "admins", "type": "[str]"}, + "database": {"key": "database", "type": "RangerAdminSpecDatabase"}, + } + + def __init__(self, *, admins: List[str], database: "_models.RangerAdminSpecDatabase", **kwargs: Any) -> None: + """ + :keyword admins: List of usernames that should be marked as ranger admins. These usernames + should match the User principal name of the respective AAD users. Required. + :paramtype admins: list[str] + :keyword database: Required. + :paramtype database: ~azure.mgmt.hdinsightcontainers.models.RangerAdminSpecDatabase + """ + super().__init__(**kwargs) + self.admins = admins + self.database = database + + +class RangerAdminSpecDatabase(_serialization.Model): + """RangerAdminSpecDatabase. + + All required parameters must be populated in order to send to Azure. + + :ivar host: The database url. Required. + :vartype host: str + :ivar name: The database name. Required. + :vartype name: str + :ivar password_secret_ref: Reference for the database password. + :vartype password_secret_ref: str + :ivar username: The name of the database user. + :vartype username: str + """ + + _validation = { + "host": {"required": True}, + "name": {"required": True}, + } + + _attribute_map = { + "host": {"key": "host", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "password_secret_ref": {"key": "passwordSecretRef", "type": "str"}, + "username": {"key": "username", "type": "str"}, + } + + def __init__( + self, + *, + host: str, + name: str, + password_secret_ref: Optional[str] = None, + username: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword host: The database url. Required. + :paramtype host: str + :keyword name: The database name. Required. + :paramtype name: str + :keyword password_secret_ref: Reference for the database password. + :paramtype password_secret_ref: str + :keyword username: The name of the database user. + :paramtype username: str + """ + super().__init__(**kwargs) + self.host = host + self.name = name + self.password_secret_ref = password_secret_ref + self.username = username + + +class RangerAuditSpec(_serialization.Model): + """Properties required to describe audit log storage. + + :ivar storage_account: Azure storage location of the blobs. MSI should have read/write access + to this Storage account. + :vartype storage_account: str + """ + + _validation = { + "storage_account": {"min_length": 1, "pattern": r"^(https)|(abfss)://.*$"}, + } + + _attribute_map = { + "storage_account": {"key": "storageAccount", "type": "str"}, + } + + def __init__(self, *, storage_account: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword storage_account: Azure storage location of the blobs. MSI should have read/write + access to this Storage account. + :paramtype storage_account: str + """ + super().__init__(**kwargs) + self.storage_account = storage_account + + +class RangerProfile(_serialization.Model): + """The ranger cluster profile. + + All required parameters must be populated in order to send to Azure. + + :ivar ranger_admin: Specification for the Ranger Admin service. Required. + :vartype ranger_admin: ~azure.mgmt.hdinsightcontainers.models.RangerAdminSpec + :ivar ranger_audit: Properties required to describe audit log storage. + :vartype ranger_audit: ~azure.mgmt.hdinsightcontainers.models.RangerAuditSpec + :ivar ranger_usersync: Specification for the Ranger Usersync service. Required. + :vartype ranger_usersync: ~azure.mgmt.hdinsightcontainers.models.RangerUsersyncSpec + """ + + _validation = { + "ranger_admin": {"required": True}, + "ranger_usersync": {"required": True}, + } + + _attribute_map = { + "ranger_admin": {"key": "rangerAdmin", "type": "RangerAdminSpec"}, + "ranger_audit": {"key": "rangerAudit", "type": "RangerAuditSpec"}, + "ranger_usersync": {"key": "rangerUsersync", "type": "RangerUsersyncSpec"}, + } + + def __init__( + self, + *, + ranger_admin: "_models.RangerAdminSpec", + ranger_usersync: "_models.RangerUsersyncSpec", + ranger_audit: Optional["_models.RangerAuditSpec"] = None, + **kwargs: Any + ) -> None: + """ + :keyword ranger_admin: Specification for the Ranger Admin service. Required. + :paramtype ranger_admin: ~azure.mgmt.hdinsightcontainers.models.RangerAdminSpec + :keyword ranger_audit: Properties required to describe audit log storage. + :paramtype ranger_audit: ~azure.mgmt.hdinsightcontainers.models.RangerAuditSpec + :keyword ranger_usersync: Specification for the Ranger Usersync service. Required. + :paramtype ranger_usersync: ~azure.mgmt.hdinsightcontainers.models.RangerUsersyncSpec + """ + super().__init__(**kwargs) + self.ranger_admin = ranger_admin + self.ranger_audit = ranger_audit + self.ranger_usersync = ranger_usersync + + +class RangerUsersyncSpec(_serialization.Model): + """Specification for the Ranger Usersync service. + + :ivar enabled: Denotes whether usersync service should be enabled. + :vartype enabled: bool + :ivar groups: List of groups that should be synced. These group names should match the object + id of the respective AAD groups. + :vartype groups: list[str] + :ivar mode: User & groups can be synced automatically or via a static list that's refreshed. + Known values are: "static" and "automatic". + :vartype mode: str or ~azure.mgmt.hdinsightcontainers.models.RangerUsersyncMode + :ivar user_mapping_location: Azure storage location of a mapping file that lists user & group + associations. + :vartype user_mapping_location: str + :ivar users: List of user names that should be synced. These usernames should match the User + principal name of the respective AAD users. + :vartype users: list[str] + """ + + _validation = { + "user_mapping_location": {"min_length": 1, "pattern": r"^(https)|(abfss)://.*$"}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "groups": {"key": "groups", "type": "[str]"}, + "mode": {"key": "mode", "type": "str"}, + "user_mapping_location": {"key": "userMappingLocation", "type": "str"}, + "users": {"key": "users", "type": "[str]"}, + } + + def __init__( + self, + *, + enabled: bool = True, + groups: Optional[List[str]] = None, + mode: Union[str, "_models.RangerUsersyncMode"] = "automatic", + user_mapping_location: Optional[str] = None, + users: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Denotes whether usersync service should be enabled. + :paramtype enabled: bool + :keyword groups: List of groups that should be synced. These group names should match the + object id of the respective AAD groups. + :paramtype groups: list[str] + :keyword mode: User & groups can be synced automatically or via a static list that's refreshed. + Known values are: "static" and "automatic". + :paramtype mode: str or ~azure.mgmt.hdinsightcontainers.models.RangerUsersyncMode + :keyword user_mapping_location: Azure storage location of a mapping file that lists user & + group associations. + :paramtype user_mapping_location: str + :keyword users: List of user names that should be synced. These usernames should match the User + principal name of the respective AAD users. + :paramtype users: list[str] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.groups = groups + self.mode = mode + self.user_mapping_location = user_mapping_location + self.users = users + + class ScalingRule(_serialization.Model): """The scaling rule. @@ -3260,7 +4694,7 @@ class ScriptActionProfile(_serialization.Model): _validation = { "type": {"required": True}, "name": {"required": True}, - "url": {"required": True, "pattern": r"^(https)|(http)|(abfss)|(abfs)|(wasbs)|(wasb)://.*$"}, + "url": {"required": True, "pattern": r"^(https)|(http)://.*$"}, "services": {"required": True}, } @@ -3763,12 +5197,17 @@ class SparkMetastoreSpec(_serialization.Model): :vartype db_server_host: str :ivar db_name: The database name. Required. :vartype db_name: str - :ivar db_user_name: The database user name. Required. + :ivar db_connection_authentication_mode: The authentication mode to connect to your Hive + metastore database. More details: + https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization. + Known values are: "SqlAuth" and "IdentityAuth". + :vartype db_connection_authentication_mode: str or + ~azure.mgmt.hdinsightcontainers.models.DbConnectionAuthenticationMode + :ivar db_user_name: The database user name. :vartype db_user_name: str :ivar db_password_secret_name: The secret name which contains the database user password. - Required. :vartype db_password_secret_name: str - :ivar key_vault_id: The key vault resource id. Required. + :ivar key_vault_id: The key vault resource id. :vartype key_vault_id: str :ivar thrift_url: The thrift url. :vartype thrift_url: str @@ -3777,14 +5216,12 @@ class SparkMetastoreSpec(_serialization.Model): _validation = { "db_server_host": {"required": True}, "db_name": {"required": True}, - "db_user_name": {"required": True}, - "db_password_secret_name": {"required": True}, - "key_vault_id": {"required": True}, } _attribute_map = { "db_server_host": {"key": "dbServerHost", "type": "str"}, "db_name": {"key": "dbName", "type": "str"}, + "db_connection_authentication_mode": {"key": "dbConnectionAuthenticationMode", "type": "str"}, "db_user_name": {"key": "dbUserName", "type": "str"}, "db_password_secret_name": {"key": "dbPasswordSecretName", "type": "str"}, "key_vault_id": {"key": "keyVaultId", "type": "str"}, @@ -3796,9 +5233,10 @@ def __init__( *, db_server_host: str, db_name: str, - db_user_name: str, - db_password_secret_name: str, - key_vault_id: str, + db_connection_authentication_mode: Union[str, "_models.DbConnectionAuthenticationMode"] = "IdentityAuth", + db_user_name: Optional[str] = None, + db_password_secret_name: Optional[str] = None, + key_vault_id: Optional[str] = None, thrift_url: Optional[str] = None, **kwargs: Any ) -> None: @@ -3807,12 +5245,17 @@ def __init__( :paramtype db_server_host: str :keyword db_name: The database name. Required. :paramtype db_name: str - :keyword db_user_name: The database user name. Required. + :keyword db_connection_authentication_mode: The authentication mode to connect to your Hive + metastore database. More details: + https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization. + Known values are: "SqlAuth" and "IdentityAuth". + :paramtype db_connection_authentication_mode: str or + ~azure.mgmt.hdinsightcontainers.models.DbConnectionAuthenticationMode + :keyword db_user_name: The database user name. :paramtype db_user_name: str :keyword db_password_secret_name: The secret name which contains the database user password. - Required. :paramtype db_password_secret_name: str - :keyword key_vault_id: The key vault resource id. Required. + :keyword key_vault_id: The key vault resource id. :paramtype key_vault_id: str :keyword thrift_url: The thrift url. :paramtype thrift_url: str @@ -3820,6 +5263,7 @@ def __init__( super().__init__(**kwargs) self.db_server_host = db_server_host self.db_name = db_name + self.db_connection_authentication_mode = db_connection_authentication_mode self.db_user_name = db_user_name self.db_password_secret_name = db_password_secret_name self.key_vault_id = key_vault_id @@ -3918,6 +5362,9 @@ class SshConnectivityEndpoint(_serialization.Model): :ivar endpoint: SSH connectivity endpoint. Required. :vartype endpoint: str + :ivar private_ssh_endpoint: Private ssh connectivity endpoint. This property will only be + returned when enableInternalIngress is true. + :vartype private_ssh_endpoint: str """ _validation = { @@ -3926,15 +5373,20 @@ class SshConnectivityEndpoint(_serialization.Model): _attribute_map = { "endpoint": {"key": "endpoint", "type": "str"}, + "private_ssh_endpoint": {"key": "privateSshEndpoint", "type": "str"}, } - def __init__(self, *, endpoint: str, **kwargs: Any) -> None: + def __init__(self, *, endpoint: str, private_ssh_endpoint: Optional[str] = None, **kwargs: Any) -> None: """ :keyword endpoint: SSH connectivity endpoint. Required. :paramtype endpoint: str + :keyword private_ssh_endpoint: Private ssh connectivity endpoint. This property will only be + returned when enableInternalIngress is true. + :paramtype private_ssh_endpoint: str """ super().__init__(**kwargs) self.endpoint = endpoint + self.private_ssh_endpoint = private_ssh_endpoint class SshProfile(_serialization.Model): @@ -4347,6 +5799,11 @@ class UpdatableClusterProfile(_serialization.Model): ~azure.mgmt.hdinsightcontainers.models.ClusterLogAnalyticsProfile :ivar prometheus_profile: Cluster Prometheus profile. :vartype prometheus_profile: ~azure.mgmt.hdinsightcontainers.models.ClusterPrometheusProfile + :ivar ranger_plugin_profile: Cluster Ranger plugin profile. + :vartype ranger_plugin_profile: + ~azure.mgmt.hdinsightcontainers.models.ClusterRangerPluginProfile + :ivar ranger_profile: The ranger cluster profile. + :vartype ranger_profile: ~azure.mgmt.hdinsightcontainers.models.RangerProfile :ivar script_action_profiles: The script action profile list. :vartype script_action_profiles: list[~azure.mgmt.hdinsightcontainers.models.ScriptActionProfile] @@ -4359,6 +5816,8 @@ class UpdatableClusterProfile(_serialization.Model): "authorization_profile": {"key": "authorizationProfile", "type": "AuthorizationProfile"}, "log_analytics_profile": {"key": "logAnalyticsProfile", "type": "ClusterLogAnalyticsProfile"}, "prometheus_profile": {"key": "prometheusProfile", "type": "ClusterPrometheusProfile"}, + "ranger_plugin_profile": {"key": "rangerPluginProfile", "type": "ClusterRangerPluginProfile"}, + "ranger_profile": {"key": "rangerProfile", "type": "RangerProfile"}, "script_action_profiles": {"key": "scriptActionProfiles", "type": "[ScriptActionProfile]"}, } @@ -4371,6 +5830,8 @@ def __init__( authorization_profile: Optional["_models.AuthorizationProfile"] = None, log_analytics_profile: Optional["_models.ClusterLogAnalyticsProfile"] = None, prometheus_profile: Optional["_models.ClusterPrometheusProfile"] = None, + ranger_plugin_profile: Optional["_models.ClusterRangerPluginProfile"] = None, + ranger_profile: Optional["_models.RangerProfile"] = None, script_action_profiles: Optional[List["_models.ScriptActionProfile"]] = None, **kwargs: Any ) -> None: @@ -4392,6 +5853,11 @@ def __init__( ~azure.mgmt.hdinsightcontainers.models.ClusterLogAnalyticsProfile :keyword prometheus_profile: Cluster Prometheus profile. :paramtype prometheus_profile: ~azure.mgmt.hdinsightcontainers.models.ClusterPrometheusProfile + :keyword ranger_plugin_profile: Cluster Ranger plugin profile. + :paramtype ranger_plugin_profile: + ~azure.mgmt.hdinsightcontainers.models.ClusterRangerPluginProfile + :keyword ranger_profile: The ranger cluster profile. + :paramtype ranger_profile: ~azure.mgmt.hdinsightcontainers.models.RangerProfile :keyword script_action_profiles: The script action profile list. :paramtype script_action_profiles: list[~azure.mgmt.hdinsightcontainers.models.ScriptActionProfile] @@ -4403,4 +5869,6 @@ def __init__( self.authorization_profile = authorization_profile self.log_analytics_profile = log_analytics_profile self.prometheus_profile = prometheus_profile + self.ranger_plugin_profile = ranger_plugin_profile + self.ranger_profile = ranger_profile self.script_action_profiles = script_action_profiles diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/__init__.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/__init__.py index 3c44ccd0cd628..560926c82ae8c 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/__init__.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/__init__.py @@ -7,7 +7,9 @@ # -------------------------------------------------------------------------- from ._cluster_pools_operations import ClusterPoolsOperations +from ._cluster_pool_available_upgrades_operations import ClusterPoolAvailableUpgradesOperations from ._clusters_operations import ClustersOperations +from ._cluster_available_upgrades_operations import ClusterAvailableUpgradesOperations from ._cluster_jobs_operations import ClusterJobsOperations from ._locations_operations import LocationsOperations from ._operations import Operations @@ -20,7 +22,9 @@ __all__ = [ "ClusterPoolsOperations", + "ClusterPoolAvailableUpgradesOperations", "ClustersOperations", + "ClusterAvailableUpgradesOperations", "ClusterJobsOperations", "LocationsOperations", "Operations", diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_pool_versions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_pool_versions_operations.py index 8b97e3fd797ad..f21aff16f27f1 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_pool_versions_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_pool_versions_operations.py @@ -40,7 +40,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_versions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_versions_operations.py index 9d88656286d36..8317e62202fd7 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_versions_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_versions_operations.py @@ -40,7 +40,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_available_upgrades_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_available_upgrades_operations.py new file mode 100644 index 0000000000000..be9f007dd1bb6 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_available_upgrades_operations.py @@ -0,0 +1,187 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from 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 _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, cluster_pool_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/availableUpgrades", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterPoolName": _SERIALIZER.url("cluster_pool_name", cluster_pool_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ClusterAvailableUpgradesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s + :attr:`cluster_available_upgrades` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.ClusterAvailableUpgrade"]: + """List a cluster available upgrade. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_name: The name of the HDInsight cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ClusterAvailableUpgrade or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterAvailableUpgrade] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ClusterAvailableUpgradeList] = 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( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + cluster_name=cluster_name, + 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("ClusterAvailableUpgradeList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/availableUpgrades" + } diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_jobs_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_jobs_operations.py index d9e790018af2d..4f20abdc5df29 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_jobs_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_jobs_operations.py @@ -45,7 +45,7 @@ def build_run_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -77,12 +77,18 @@ def build_run_job_request( def build_list_request( - resource_group_name: str, cluster_pool_name: str, cluster_name: str, subscription_id: str, **kwargs: Any + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,6 +109,8 @@ def build_list_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -369,7 +377,12 @@ def get_long_running_output(pipeline_response): @distributed_trace def list( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + filter: Optional[str] = None, + **kwargs: Any ) -> Iterable["_models.ClusterJob"]: """Get jobs of HDInsight on AKS cluster. @@ -380,6 +393,9 @@ def list( :type cluster_pool_name: str :param cluster_name: The name of the HDInsight cluster. Required. :type cluster_name: str + :param filter: The system query option to filter job returned in the response. Allowed value is + 'jobName eq {jobName}' or 'jarName eq {jarName}'. Default value is None. + :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ClusterJob or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterJob] @@ -407,6 +423,7 @@ def prepare_request(next_link=None): cluster_pool_name=cluster_pool_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + filter=filter, api_version=api_version, template_url=self.list.metadata["url"], headers=_headers, diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pool_available_upgrades_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pool_available_upgrades_operations.py new file mode 100644 index 0000000000000..3c76a7c42dfc8 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pool_available_upgrades_operations.py @@ -0,0 +1,183 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from 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 _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, cluster_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/availableUpgrades", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterPoolName": _SERIALIZER.url("cluster_pool_name", cluster_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ClusterPoolAvailableUpgradesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s + :attr:`cluster_pool_available_upgrades` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, cluster_pool_name: str, **kwargs: Any + ) -> Iterable["_models.ClusterPoolAvailableUpgrade"]: + """List a cluster pool available upgrade. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ClusterPoolAvailableUpgrade or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterPoolAvailableUpgrade] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ClusterPoolAvailableUpgradeList] = 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( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + 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("ClusterPoolAvailableUpgradeList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/availableUpgrades" + } diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pools_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pools_operations.py index ea7f04028dcce..eb4a76fff4524 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pools_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pools_operations.py @@ -45,7 +45,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -114,7 +114,7 @@ def build_update_tags_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -150,7 +150,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +181,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +205,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -231,6 +231,42 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_upgrade_request( + resource_group_name: str, cluster_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) + 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.HDInsight/clusterpools/{clusterPoolName}/upgrade", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "clusterPoolName": _SERIALIZER.url("cluster_pool_name", cluster_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class ClusterPoolsOperations: """ .. warning:: @@ -808,7 +844,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -1057,3 +1093,234 @@ def get_next(next_link=None): list_by_resource_group.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools" } + + def _upgrade_initial( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_pool_upgrade_request: Union[_models.ClusterPoolUpgrade, IO], + **kwargs: Any + ) -> Optional[_models.ClusterPool]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ClusterPool]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cluster_pool_upgrade_request, (IOBase, bytes)): + _content = cluster_pool_upgrade_request + else: + _json = self._serialize.body(cluster_pool_upgrade_request, "ClusterPoolUpgrade") + + request = build_upgrade_request( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._upgrade_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("ClusterPool", 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 + + _upgrade_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/upgrade" + } + + @overload + def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_pool_upgrade_request: _models.ClusterPoolUpgrade, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ClusterPool]: + """Upgrade a cluster pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_pool_upgrade_request: Upgrade a cluster pool. Required. + :type cluster_pool_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgrade + :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 ClusterPool or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_pool_upgrade_request: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ClusterPool]: + """Upgrade a cluster pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_pool_upgrade_request: Upgrade a cluster pool. Required. + :type cluster_pool_upgrade_request: 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 ClusterPool or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_pool_upgrade_request: Union[_models.ClusterPoolUpgrade, IO], + **kwargs: Any + ) -> LROPoller[_models.ClusterPool]: + """Upgrade a cluster pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_pool_upgrade_request: Upgrade a cluster pool. Is either a ClusterPoolUpgrade + type or a IO type. Required. + :type cluster_pool_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgrade + 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 ClusterPool or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterPool] = 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._upgrade_initial( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + cluster_pool_upgrade_request=cluster_pool_upgrade_request, + 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("ClusterPool", 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_upgrade.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/upgrade" + } diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_clusters_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_clusters_operations.py index cf53997ee1124..341d42cbc2ecd 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_clusters_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_clusters_operations.py @@ -45,7 +45,7 @@ def build_list_by_cluster_pool_name_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,13 +72,50 @@ def build_list_by_cluster_pool_name_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_upgrade_request( + resource_group_name: str, cluster_pool_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) + 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.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/upgrade", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "clusterPoolName": _SERIALIZER.url("cluster_pool_name", cluster_pool_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_resize_request( resource_group_name: str, cluster_pool_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -115,7 +152,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +186,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -186,7 +223,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -223,7 +260,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +294,7 @@ def build_list_service_configs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -291,7 +328,7 @@ def build_list_instance_views_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -325,7 +362,7 @@ def build_get_instance_view_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -464,6 +501,245 @@ def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters" } + def _upgrade_initial( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + cluster_upgrade_request: Union[_models.ClusterUpgrade, IO], + **kwargs: Any + ) -> Optional[_models.Cluster]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Cluster]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cluster_upgrade_request, (IOBase, bytes)): + _content = cluster_upgrade_request + else: + _json = self._serialize.body(cluster_upgrade_request, "ClusterUpgrade") + + request = build_upgrade_request( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._upgrade_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("Cluster", 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 + + _upgrade_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/upgrade" + } + + @overload + def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + cluster_upgrade_request: _models.ClusterUpgrade, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Upgrade a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_name: The name of the HDInsight cluster. Required. + :type cluster_name: str + :param cluster_upgrade_request: Upgrade a cluster. Required. + :type cluster_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgrade + :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 Cluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hdinsightcontainers.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + cluster_upgrade_request: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Upgrade a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_name: The name of the HDInsight cluster. Required. + :type cluster_name: str + :param cluster_upgrade_request: Upgrade a cluster. Required. + :type cluster_upgrade_request: 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 Cluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hdinsightcontainers.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_upgrade( + self, + resource_group_name: str, + cluster_pool_name: str, + cluster_name: str, + cluster_upgrade_request: Union[_models.ClusterUpgrade, IO], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Upgrade a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_pool_name: The name of the cluster pool. Required. + :type cluster_pool_name: str + :param cluster_name: The name of the HDInsight cluster. Required. + :type cluster_name: str + :param cluster_upgrade_request: Upgrade a cluster. Is either a ClusterUpgrade type or a IO + type. Required. + :type cluster_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgrade 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 Cluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hdinsightcontainers.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = 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._upgrade_initial( + resource_group_name=resource_group_name, + cluster_pool_name=cluster_pool_name, + cluster_name=cluster_name, + cluster_upgrade_request=cluster_upgrade_request, + 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("Cluster", 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_upgrade.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/upgrade" + } + def _resize_initial( self, resource_group_name: str, @@ -1285,7 +1561,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_locations_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_locations_operations.py index 63ab515d1e0b7..3b5a2da0c2124 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_locations_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_locations_operations.py @@ -39,7 +39,7 @@ def build_check_name_availability_request(location: str, subscription_id: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_operations.py index 8936cca4e18a4..857717ab5fead 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_operations.py @@ -40,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_autoscale_cluster.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_autoscale_cluster.py index cd500842bd616..58b4c931ca85b 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_autoscale_cluster.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_autoscale_cluster.py @@ -77,11 +77,11 @@ def main(): "msiObjectId": "40491351-c240-4042-91e0-f644a1d2b441", "msiResourceId": "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi", }, - "kafkaProfile": {}, "ossVersion": "2.4.1", "sshProfile": {"count": 2}, + "trinoProfile": {}, }, - "clusterType": "kafka", + "clusterType": "trino", "computeProfile": {"nodes": [{"count": 4, "type": "worker", "vmSize": "Standard_D3_v2"}]}, }, }, @@ -89,6 +89,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/CreateAutoscaleCluster.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/CreateAutoscaleCluster.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool.py index 637b5bf1bd6f6..d738147e13d11 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/CreateClusterPool.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/CreateClusterPool.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool_with_private_aks.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool_with_private_aks.py new file mode 100644 index 0000000000000..3a5d15b459013 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool_with_private_aks.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python create_cluster_pool_with_private_aks.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.cluster_pools.begin_create_or_update( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + cluster_pool={ + "location": "West US 2", + "properties": { + "clusterPoolProfile": {"clusterPoolVersion": "1.2"}, + "computeProfile": {"vmSize": "Standard_D3_v2"}, + "networkProfile": { + "enablePrivateApiServer": True, + "subnetId": "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/CreateClusterPoolWithPrivateAks.json +if __name__ == "__main__": + main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool_with_udr_aks.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool_with_udr_aks.py new file mode 100644 index 0000000000000..2e4fc3c974bd3 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool_with_udr_aks.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python create_cluster_pool_with_udr_aks.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.cluster_pools.begin_create_or_update( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + cluster_pool={ + "location": "West US 2", + "properties": { + "clusterPoolProfile": {"clusterPoolVersion": "1.2"}, + "computeProfile": {"vmSize": "Standard_D3_v2"}, + "networkProfile": { + "outboundType": "userDefinedRouting", + "subnetId": "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/CreateClusterPoolWithUDRAks.json +if __name__ == "__main__": + main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_ranger_cluster.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_ranger_cluster.py new file mode 100644 index 0000000000000..9fca1c120fe54 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_ranger_cluster.py @@ -0,0 +1,77 @@ +# 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.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python create_ranger_cluster.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.clusters.begin_create( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + cluster_name="cluster1", + hd_insight_cluster={ + "location": "West US 2", + "properties": { + "clusterProfile": { + "authorizationProfile": {"userIds": ["testuser1", "testuser2"]}, + "clusterVersion": "0.0.1", + "identityProfile": { + "msiClientId": "de91f1d8-767f-460a-ac11-3cf103f74b34", + "msiObjectId": "40491351-c240-4042-91e0-f644a1d2b441", + "msiResourceId": "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi", + }, + "ossVersion": "2.2.3", + "rangerProfile": { + "rangerAdmin": { + "admins": ["testuser1@contoso.com", "testuser2@contoso.com"], + "database": { + "host": "testsqlserver.database.windows.net", + "name": "testdb", + "passwordSecretRef": "https://testkv.vault.azure.net/secrets/mysecret/5df6584d9c25418c8d900240aa6c3452", + "username": "admin", + }, + }, + "rangerAudit": {"storageAccount": "https://teststorage.blob.core.windows.net/testblob"}, + "rangerUsersync": { + "enabled": True, + "groups": ["0a53828f-36c9-44c3-be3d-99a7fce977ad", "13be6971-79db-4f33-9d41-b25589ca25ac"], + "mode": "automatic", + "users": ["testuser1@contoso.com", "testuser2@contoso.com"], + }, + }, + }, + "clusterType": "ranger", + "computeProfile": {"nodes": [{"count": 2, "type": "head", "vmSize": "Standard_D3_v2"}]}, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/CreateRangerCluster.json +if __name__ == "__main__": + main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_spark_cluster.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_spark_cluster.py index 05c601b44b805..1b7f9541d768e 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_spark_cluster.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_spark_cluster.py @@ -45,6 +45,7 @@ def main(): "msiResourceId": "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi", }, "ossVersion": "2.2.3", + "rangerPluginProfile": {"enabled": False}, "serviceConfigsProfiles": [ { "configs": [ @@ -93,6 +94,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/CreateSparkCluster.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/CreateSparkCluster.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_spark_cluster_with_internal_ingress.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_spark_cluster_with_internal_ingress.py new file mode 100644 index 0000000000000..7c55b08e7fd86 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_spark_cluster_with_internal_ingress.py @@ -0,0 +1,99 @@ +# 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.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python create_spark_cluster_with_internal_ingress.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.clusters.begin_create( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + cluster_name="cluster1", + hd_insight_cluster={ + "location": "West US 2", + "properties": { + "clusterProfile": { + "authorizationProfile": {"userIds": ["testuser1", "testuser2"]}, + "clusterAccessProfile": {"enableInternalIngress": True}, + "clusterVersion": "0.0.1", + "identityProfile": { + "msiClientId": "de91f1d8-767f-460a-ac11-3cf103f74b34", + "msiObjectId": "40491351-c240-4042-91e0-f644a1d2b441", + "msiResourceId": "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi", + }, + "ossVersion": "2.2.3", + "serviceConfigsProfiles": [ + { + "configs": [ + { + "component": "spark-config", + "files": [ + { + "fileName": "spark-defaults.conf", + "values": {"spark.eventLog.enabled": "true"}, + } + ], + } + ], + "serviceName": "spark-service", + }, + { + "configs": [ + { + "component": "yarn-config", + "files": [ + { + "fileName": "core-site.xml", + "values": { + "fs.defaultFS": "wasb://testcontainer@teststorage.dfs.core.windows.net/", + "storage.container": "testcontainer", + "storage.key": "test key", + "storage.name": "teststorage", + "storage.protocol": "wasb", + }, + }, + {"fileName": "yarn-site.xml", "values": {"yarn.webapp.ui2.enable": "false"}}, + ], + } + ], + "serviceName": "yarn-service", + }, + ], + "sparkProfile": {}, + "sshProfile": {"count": 2}, + }, + "clusterType": "spark", + "computeProfile": {"nodes": [{"count": 4, "type": "worker", "vmSize": "Standard_D3_v2"}]}, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/CreateSparkClusterWithInternalIngress.json +if __name__ == "__main__": + main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/delete_cluster.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/delete_cluster.py index a697bb5416023..195dd1ba9bf0d 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/delete_cluster.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/delete_cluster.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/DeleteCluster.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/DeleteCluster.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/delete_cluster_pool.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/delete_cluster_pool.py index 8fe0f8ed31b7a..be84a02b7c793 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/delete_cluster_pool.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/delete_cluster_pool.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/DeleteClusterPool.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/DeleteClusterPool.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster.py index 68d881372b07b..8034582c236d9 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/GetCluster.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/GetCluster.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster_instance_view.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster_instance_view.py index a78dbc9997fda..45d740d65e7dd 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster_instance_view.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster_instance_view.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/GetClusterInstanceView.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/GetClusterInstanceView.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster_pool.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster_pool.py index 5c41cfea1cdf1..6adb3a259dd9e 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster_pool.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster_pool.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/GetClusterPool.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/GetClusterPool.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_operations.py index d317bdb16171f..04408233f36cc 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_operations.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/GetOperations.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/GetOperations.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_available_cluster_pool_versions.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_available_cluster_pool_versions.py index 8295889c67e21..aec3bc181b51a 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_available_cluster_pool_versions.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_available_cluster_pool_versions.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListAvailableClusterPoolVersions.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ListAvailableClusterPoolVersions.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_available_cluster_versions.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_available_cluster_versions.py index db58bfbd1eb07..cec30f2f69f04 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_available_cluster_versions.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_available_cluster_versions.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListAvailableClusterVersions.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ListAvailableClusterVersions.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_available_upgrades.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_available_upgrades.py new file mode 100644 index 0000000000000..e17e695425d88 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_available_upgrades.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.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python list_cluster_available_upgrades.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.cluster_available_upgrades.list( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + cluster_name="cluster1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ListClusterAvailableUpgrades.json +if __name__ == "__main__": + main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_instance_views.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_instance_views.py index f69197b066f84..7b44313ef7d8e 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_instance_views.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_instance_views.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClusterInstanceViews.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ListClusterInstanceViews.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_jobs.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_jobs.py index 906fcb6af36b1..de0dc0c5858f8 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_jobs.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_jobs.py @@ -26,7 +26,7 @@ def main(): client = HDInsightContainersMgmtClient( credential=DefaultAzureCredential(), - subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + subscription_id="00000000-0000-0000-0000-000000000000", ) response = client.cluster_jobs.list( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClusterJobs.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ListClusterJobs.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pool_available_upgrades.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pool_available_upgrades.py new file mode 100644 index 0000000000000..031c98f381727 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pool_available_upgrades.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python list_cluster_pool_available_upgrades.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.cluster_pool_available_upgrades.list( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ListClusterPoolAvailableUpgrades.json +if __name__ == "__main__": + main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pools.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pools.py index 7fb85f4f0e1b8..0b9c63ee889f0 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pools.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pools.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClusterPools.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ListClusterPools.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pools_subscription.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pools_subscription.py index c0a71acd68f6b..4c43880c39757 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pools_subscription.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pools_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClusterPoolsSubscription.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ListClusterPoolsSubscription.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_service_configs.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_service_configs.py index df3131ebd7a68..eab4988064a58 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_service_configs.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_service_configs.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClusterServiceConfigs.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ListClusterServiceConfigs.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_clusters_by_cluster_pool_name.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_clusters_by_cluster_pool_name.py index 52a60c9c27d86..f0a92b7ee6a07 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_clusters_by_cluster_pool_name.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_clusters_by_cluster_pool_name.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClustersByClusterPoolName.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ListClustersByClusterPoolName.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/locations_name_availability.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/locations_name_availability.py index bef0252f1b02f..9ab2bb530eb0b 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/locations_name_availability.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/locations_name_availability.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/LocationsNameAvailability.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/LocationsNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_cluster.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_cluster.py index b7d00c61d5e36..7245c1cf40d77 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_cluster.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_cluster.py @@ -61,6 +61,7 @@ def main(): "enabled": True, "metricsEnabled": True, }, + "rangerPluginProfile": {"enabled": True}, "serviceConfigsProfiles": [ { "configs": [ @@ -108,6 +109,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/PatchCluster.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/PatchCluster.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_cluster_pool.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_cluster_pool.py index 1fe46d99dcd61..2b3a6b8911329 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_cluster_pool.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_cluster_pool.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/PatchClusterPool.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/PatchClusterPool.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_ranger_cluster.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_ranger_cluster.py new file mode 100644 index 0000000000000..aa1f9f4eb8b11 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_ranger_cluster.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python patch_ranger_cluster.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.clusters.begin_update( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + cluster_name="cluster1", + cluster_patch_request={ + "location": "West US 2", + "properties": { + "clusterProfile": { + "rangerProfile": { + "rangerAdmin": { + "admins": ["testuser1@contoso.com", "testuser2@contoso.com"], + "database": { + "host": "testsqlserver.database.windows.net", + "name": "testdb", + "passwordSecretRef": "https://testkv.vault.azure.net/secrets/mysecret/5df6584d9c25418c8d900240aa6c3452", + "username": "admin", + }, + }, + "rangerAudit": {"storageAccount": "https://teststorage.blob.core.windows.net/testblob"}, + "rangerUsersync": { + "enabled": True, + "groups": ["0a53828f-36c9-44c3-be3d-99a7fce977ad", "13be6971-79db-4f33-9d41-b25589ca25ac"], + "mode": "automatic", + "users": ["testuser1@contoso.com", "testuser2@contoso.com"], + }, + } + } + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/PatchRangerCluster.json +if __name__ == "__main__": + main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/resize_cluster.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/resize_cluster.py index 3c474b9d2f2bd..724bb3269ab33 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/resize_cluster.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/resize_cluster.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ResizeCluster.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ResizeCluster.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/run_cluster_job.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/run_cluster_job.py index 38dc5edaa31b4..05f1aa74c1f3f 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/run_cluster_job.py +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/run_cluster_job.py @@ -26,7 +26,7 @@ def main(): client = HDInsightContainersMgmtClient( credential=DefaultAzureCredential(), - subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + subscription_id="00000000-0000-0000-0000-000000000000", ) response = client.cluster_jobs.begin_run_job( @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/RunClusterJob.json +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/RunClusterJob.json if __name__ == "__main__": main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_aks_patch_version_for_cluster.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_aks_patch_version_for_cluster.py new file mode 100644 index 0000000000000..0c2bdc97b9b9d --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_aks_patch_version_for_cluster.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.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python upgrade_aks_patch_version_for_cluster.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.clusters.begin_upgrade( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + cluster_name="cluster1", + cluster_upgrade_request={"properties": {"upgradeType": "AKSPatchUpgrade"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/UpgradeAKSPatchVersionForCluster.json +if __name__ == "__main__": + main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_aks_patch_version_for_cluster_pool.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_aks_patch_version_for_cluster_pool.py new file mode 100644 index 0000000000000..486406bfcf1d3 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_aks_patch_version_for_cluster_pool.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python upgrade_aks_patch_version_for_cluster_pool.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.cluster_pools.begin_upgrade( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + cluster_pool_upgrade_request={ + "properties": { + "upgradeAllClusterNodes": False, + "upgradeClusterPool": True, + "upgradeType": "AKSPatchUpgrade", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/UpgradeAKSPatchVersionForClusterPool.json +if __name__ == "__main__": + main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_hotfix_for_cluster.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_hotfix_for_cluster.py new file mode 100644 index 0000000000000..cefd249589d26 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_hotfix_for_cluster.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python upgrade_hotfix_for_cluster.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.clusters.begin_upgrade( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + cluster_name="cluster1", + cluster_upgrade_request={ + "properties": { + "componentName": "historyserver", + "targetBuildNumber": "3", + "targetClusterVersion": "1.0.6", + "targetOssVersion": "1.16.0", + "upgradeType": "HotfixUpgrade", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/UpgradeHotfixForCluster.json +if __name__ == "__main__": + main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_node_os_for_cluster_pool.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_node_os_for_cluster_pool.py new file mode 100644 index 0000000000000..ad222dfaeb78c --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_node_os_for_cluster_pool.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hdinsightcontainers +# USAGE + python upgrade_node_os_for_cluster_pool.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 = HDInsightContainersMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="10e32bab-26da-4cc4-a441-52b318f824e6", + ) + + response = client.cluster_pools.begin_upgrade( + resource_group_name="hiloResourcegroup", + cluster_pool_name="clusterpool1", + cluster_pool_upgrade_request={"properties": {"upgradeType": "NodeOsUpgrade"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/UpgradeNodeOsForClusterPool.json +if __name__ == "__main__": + main()