diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/CHANGELOG.md b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/CHANGELOG.md deleted file mode 100644 index 6a60a790ca7a..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/CHANGELOG.md +++ /dev/null @@ -1,178 +0,0 @@ -# Release History - -## 1.0.0b3 (2024-08-26) - -### Features Added - - - The 'HDInsightContainersMgmtClient' client had operation group 'cluster_pool_upgrade_histories' added in the current version - - The 'HDInsightContainersMgmtClient' client had operation group 'cluster_upgrade_histories' added in the current version - - The 'HDInsightContainersMgmtClient' client had operation group 'cluster_libraries' added in the current version - - The 'ClustersOperations' method 'begin_upgrade_manual_rollback' was added in the current version - - The model or publicly exposed class 'ClusterLibrariesOperations' was added in the current version - - The model or publicly exposed class 'ClusterPoolUpgradeHistoriesOperations' was added in the current version - - The model or publicly exposed class 'ClusterUpgradeHistoriesOperations' was added in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeType' had property 'PATCH_VERSION_UPGRADE' added in the current version - - The model or publicly exposed class 'ClusterPoolComputeProfile' had property 'availability_zones' added in the current version - - The model or publicly exposed class 'ClusterPoolProfile' had property 'public_ip_tag' added in the current version - - The model or publicly exposed class 'ClusterPoolResourcePropertiesClusterPoolProfile' had property 'public_ip_tag' added in the current version - - The model or publicly exposed class 'ClusterPoolResourcePropertiesComputeProfile' had property 'availability_zones' added in the current version - - The model or publicly exposed class 'ClusterProfile' had property 'managed_identity_profile' added in the current version - - The model or publicly exposed class 'ClusterUpgradeType' had property 'PATCH_VERSION_UPGRADE' added in the current version - - The model or publicly exposed class 'ComputeProfile' had property 'availability_zones' added in the current version - - The model or publicly exposed class 'SshProfile' had property 'vm_size' added in the current version - - The model or publicly exposed class 'UpdatableClusterProfile' had property 'secrets_profile' added in the current version - - The model or publicly exposed class 'UpdatableClusterProfile' had property 'trino_profile' added in the current version - - The model or publicly exposed class 'Category' was added in the current version - - The model or publicly exposed class 'ClusterAksPatchUpgradeHistoryProperties' was added in the current version - - The model or publicly exposed class 'ClusterAvailableInPlaceUpgradeProperties' was added in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradePatchVersionUpgradeProperties' was added in the current version - - The model or publicly exposed class 'ClusterHotfixUpgradeHistoryProperties' was added in the current version - - The model or publicly exposed class 'ClusterHotfixUpgradeRollbackHistoryProperties' was added in the current version - - The model or publicly exposed class 'ClusterInPlaceUpgradeHistoryProperties' was added in the current version - - The model or publicly exposed class 'ClusterInPlaceUpgradeProperties' was added in the current version - - The model or publicly exposed class 'ClusterLibrary' was added in the current version - - The model or publicly exposed class 'ClusterLibraryList' was added in the current version - - The model or publicly exposed class 'ClusterLibraryManagementOperation' was added in the current version - - The model or publicly exposed class 'ClusterLibraryManagementOperationProperties' was added in the current version - - The model or publicly exposed class 'ClusterLibraryProperties' was added in the current version - - The model or publicly exposed class 'ClusterPatchVersionUpgradeHistoryProperties' was added in the current version - - The model or publicly exposed class 'ClusterPatchVersionUpgradeProperties' was added in the current version - - The model or publicly exposed class 'ClusterPatchVersionUpgradeRollbackHistoryProperties' was added in the current version - - The model or publicly exposed class 'ClusterPoolAksPatchUpgradeHistoryProperties' was added in the current version - - The model or publicly exposed class 'ClusterPoolNodeOsUpgradeHistoryProperties' was added in the current version - - The model or publicly exposed class 'ClusterPoolUpgradeHistory' was added in the current version - - The model or publicly exposed class 'ClusterPoolUpgradeHistoryListResult' was added in the current version - - The model or publicly exposed class 'ClusterPoolUpgradeHistoryProperties' was added in the current version - - The model or publicly exposed class 'ClusterPoolUpgradeHistoryType' was added in the current version - - The model or publicly exposed class 'ClusterPoolUpgradeHistoryUpgradeResultType' was added in the current version - - The model or publicly exposed class 'ClusterUpgradeHistory' was added in the current version - - The model or publicly exposed class 'ClusterUpgradeHistoryListResult' was added in the current version - - The model or publicly exposed class 'ClusterUpgradeHistoryProperties' was added in the current version - - The model or publicly exposed class 'ClusterUpgradeHistorySeverityType' was added in the current version - - The model or publicly exposed class 'ClusterUpgradeHistoryType' was added in the current version - - The model or publicly exposed class 'ClusterUpgradeHistoryUpgradeResultType' was added in the current version - - The model or publicly exposed class 'ClusterUpgradeRollback' was added in the current version - - The model or publicly exposed class 'ClusterUpgradeRollbackProperties' was added in the current version - - The model or publicly exposed class 'IpTag' was added in the current version - - The model or publicly exposed class 'LibraryManagementAction' was added in the current version - - The model or publicly exposed class 'ManagedIdentityProfile' was added in the current version - - The model or publicly exposed class 'ManagedIdentitySpec' was added in the current version - - The model or publicly exposed class 'ManagedIdentityType' was added in the current version - - The model or publicly exposed class 'MavenLibraryProperties' was added in the current version - - The model or publicly exposed class 'PyPiLibraryProperties' was added in the current version - - The model or publicly exposed class 'Status' was added in the current version - - The model or publicly exposed class 'Type' was added in the current version - -### Breaking Changes - - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'description' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'source_oss_version' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'source_cluster_version' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'source_build_number' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'target_oss_version' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'target_cluster_version' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'target_build_number' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'component_name' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'severity' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'extended_properties' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterAvailableUpgradeHotfixUpgradeProperties' had its instance variable 'created_time' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterHotfixUpgradeProperties' had its instance variable 'target_oss_version' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterHotfixUpgradeProperties' had its instance variable 'target_cluster_version' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterHotfixUpgradeProperties' had its instance variable 'target_build_number' deleted or renamed in the current version - - The model or publicly exposed class 'ClusterHotfixUpgradeProperties' had its instance variable 'component_name' deleted or renamed in the current version - - The model or publicly exposed class 'KafkaProfile' had its instance variable 'cluster_identity' deleted or renamed in the current version - -## 1.0.0b2 (2024-04-07) - -### Features Added - - - Added operation ClusterPoolsOperations.begin_upgrade - - Added operation ClustersOperations.begin_upgrade - - Added operation group ClusterAvailableUpgradesOperations - - Added operation group ClusterPoolAvailableUpgradesOperations - - Model Cluster has a new parameter properties - - Model ClusterPatch has a new parameter properties - - Model ClusterPool has a new parameter properties - - Model ClusterPoolNetworkProfile has a new parameter api_server_authorized_ip_ranges - - Model ClusterPoolNetworkProfile has a new parameter enable_private_api_server - - Model ClusterPoolNetworkProfile has a new parameter outbound_type - - Model ClusterPoolResourcePropertiesNetworkProfile has a new parameter api_server_authorized_ip_ranges - - Model ClusterPoolResourcePropertiesNetworkProfile has a new parameter enable_private_api_server - - Model ClusterPoolResourcePropertiesNetworkProfile has a new parameter outbound_type - - Model ClusterPoolVersion has a new parameter properties - - Model ClusterProfile has a new parameter cluster_access_profile - - Model ClusterProfile has a new parameter ranger_plugin_profile - - Model ClusterProfile has a new parameter ranger_profile - - Model ClusterResizeData has a new parameter properties - - Model ClusterVersion has a new parameter properties - - Model ConnectivityProfileWeb has a new parameter private_fqdn - - Model FlinkHiveCatalogOption has a new parameter metastore_db_connection_authentication_mode - - Model FlinkJobProperties has a new parameter run_id - - Model FlinkProfile has a new parameter deployment_mode - - Model FlinkProfile has a new parameter job_spec - - Model HiveCatalogOption has a new parameter metastore_db_connection_authentication_mode - - Model ServiceConfigResult has a new parameter properties - - Model SparkMetastoreSpec has a new parameter db_connection_authentication_mode - - Model SshConnectivityEndpoint has a new parameter private_ssh_endpoint - - Model TrinoCoordinator has a new parameter debug - - Model TrinoWorker has a new parameter debug - - Model UpdatableClusterProfile has a new parameter ranger_plugin_profile - - Model UpdatableClusterProfile has a new parameter ranger_profile - - Model WebConnectivityEndpoint has a new parameter private_fqdn - - Operation ClusterJobsOperations.list has a new optional parameter filter - -### Breaking Changes - - - Model Cluster no longer has parameter cluster_profile - - Model Cluster no longer has parameter cluster_type - - Model Cluster no longer has parameter compute_profile - - Model Cluster no longer has parameter deployment_id - - Model Cluster no longer has parameter provisioning_state - - Model Cluster no longer has parameter status - - Model ClusterInstanceViewResult has a new required parameter properties - - Model ClusterInstanceViewResult no longer has parameter service_statuses - - Model ClusterInstanceViewResult no longer has parameter status - - Model ClusterPatch no longer has parameter cluster_profile - - Model ClusterPatch no longer has parameter id - - Model ClusterPatch no longer has parameter location - - Model ClusterPatch no longer has parameter name - - Model ClusterPatch no longer has parameter system_data - - Model ClusterPatch no longer has parameter type - - Model ClusterPool no longer has parameter aks_cluster_profile - - Model ClusterPool no longer has parameter aks_managed_resource_group_name - - Model ClusterPool no longer has parameter cluster_pool_profile - - Model ClusterPool no longer has parameter compute_profile - - Model ClusterPool no longer has parameter deployment_id - - Model ClusterPool no longer has parameter log_analytics_profile - - Model ClusterPool no longer has parameter managed_resource_group_name - - Model ClusterPool no longer has parameter network_profile - - Model ClusterPool no longer has parameter provisioning_state - - Model ClusterPool no longer has parameter status - - Model ClusterPoolVersion no longer has parameter aks_version - - Model ClusterPoolVersion no longer has parameter cluster_pool_version - - Model ClusterPoolVersion no longer has parameter is_preview - - Model ClusterResizeData no longer has parameter target_worker_node_count - - Model ClusterVersion no longer has parameter cluster_pool_version - - Model ClusterVersion no longer has parameter cluster_type - - Model ClusterVersion no longer has parameter cluster_version - - Model ClusterVersion no longer has parameter components - - Model ClusterVersion no longer has parameter is_preview - - Model ClusterVersion no longer has parameter oss_version - - Model ServiceConfigResult no longer has parameter component_name - - Model ServiceConfigResult no longer has parameter content - - Model ServiceConfigResult no longer has parameter custom_keys - - Model ServiceConfigResult no longer has parameter default_keys - - Model ServiceConfigResult no longer has parameter file_name - - Model ServiceConfigResult no longer has parameter path - - Model ServiceConfigResult no longer has parameter service_name - - Model ServiceConfigResult no longer has parameter type - - Model TrinoCoordinator no longer has parameter enable - - Model TrinoCoordinator no longer has parameter port - - Model TrinoCoordinator no longer has parameter suspend - - Model TrinoWorker no longer has parameter enable - - Model TrinoWorker no longer has parameter port - - Model TrinoWorker no longer has parameter suspend - -## 1.0.0b1 (2023-08-18) - -* Initial Release diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/LICENSE b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/LICENSE deleted file mode 100644 index b2f52a2bad4e..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) Microsoft Corporation. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/MANIFEST.in b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/MANIFEST.in deleted file mode 100644 index af775d8e2f16..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/MANIFEST.in +++ /dev/null @@ -1,8 +0,0 @@ -include _meta.json -recursive-include tests *.py *.json -recursive-include samples *.py *.md -include *.md -include azure/__init__.py -include azure/mgmt/__init__.py -include LICENSE -include azure/mgmt/hdinsightcontainers/py.typed diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/README.md b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/README.md deleted file mode 100644 index 904cc6e9e00d..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# Microsoft Azure SDK for Python - -This is the Microsoft Azure Hdinsightcontainers Management Client Library. -This package has been tested with Python 3.8+. -For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). - -## _Disclaimer_ - -_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ - -## Getting started - -### Prerequisites - -- Python 3.8+ is required to use this package. -- [Azure subscription](https://azure.microsoft.com/free/) - -### Install the package - -```bash -pip install azure-mgmt-hdinsightcontainers -pip install azure-identity -``` - -### Authentication - -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` for Azure client secret. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, client can be authenticated by following code: - -```python -from azure.identity import DefaultAzureCredential -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient -import os - -sub_id = os.getenv("AZURE_SUBSCRIPTION_ID") -client = HDInsightContainersMgmtClient(credential=DefaultAzureCredential(), subscription_id=sub_id) -``` - -## Examples - -Code samples for this package can be found at: -- [Search Hdinsightcontainers Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com -- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) - - -## Troubleshooting - -## Next steps - -## Provide Feedback - -If you encounter any bugs or have suggestions, please file an issue in the -[Issues](https://github.com/Azure/azure-sdk-for-python/issues) -section of the project. diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/_meta.json b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/_meta.json deleted file mode 100644 index aeff1e281cbd..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "0219f9da9de5833fc380f57d6b026f68b5df6f93", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.17.0", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/readme.md --generate-sample=True --generate-test=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.17.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --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/__init__.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/__init__.py deleted file mode 100644 index 8db66d3d0f0f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/__init__.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/__init__.py deleted file mode 100644 index 8db66d3d0f0f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/__init__.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/__init__.py deleted file mode 100644 index 260046703a8d..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# 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 ._hd_insight_containers_mgmt_client import HDInsightContainersMgmtClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "HDInsightContainersMgmtClient", -] -__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/_configuration.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_configuration.py deleted file mode 100644 index 8f615c86364a..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_configuration.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class HDInsightContainersMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for HDInsightContainersMgmtClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :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 "2024-05-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: - api_version: str = kwargs.pop("api_version", "2024-05-01-preview") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-hdinsightcontainers/{}".format(VERSION)) - self.polling_interval = kwargs.get("polling_interval", 30) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) 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 deleted file mode 100644 index 6dd4a4f632e9..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_hd_insight_containers_mgmt_client.py +++ /dev/null @@ -1,179 +0,0 @@ -# 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 copy import deepcopy -from typing import Any, TYPE_CHECKING -from typing_extensions import Self - -from azure.core.pipeline import policies -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient -from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy - -from . import models as _models -from ._configuration import HDInsightContainersMgmtClientConfiguration -from ._serialization import Deserializer, Serializer -from .operations import ( - AvailableClusterPoolVersionsOperations, - AvailableClusterVersionsOperations, - ClusterAvailableUpgradesOperations, - ClusterJobsOperations, - ClusterLibrariesOperations, - ClusterPoolAvailableUpgradesOperations, - ClusterPoolUpgradeHistoriesOperations, - ClusterPoolsOperations, - ClusterUpgradeHistoriesOperations, - ClustersOperations, - LocationsOperations, - Operations, -) - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class HDInsightContainersMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """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 cluster_pool_upgrade_histories: ClusterPoolUpgradeHistoriesOperations operations - :vartype cluster_pool_upgrade_histories: - azure.mgmt.hdinsightcontainers.operations.ClusterPoolUpgradeHistoriesOperations - :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_upgrade_histories: ClusterUpgradeHistoriesOperations operations - :vartype cluster_upgrade_histories: - azure.mgmt.hdinsightcontainers.operations.ClusterUpgradeHistoriesOperations - :ivar cluster_jobs: ClusterJobsOperations operations - :vartype cluster_jobs: azure.mgmt.hdinsightcontainers.operations.ClusterJobsOperations - :ivar locations: LocationsOperations operations - :vartype locations: azure.mgmt.hdinsightcontainers.operations.LocationsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.hdinsightcontainers.operations.Operations - :ivar available_cluster_pool_versions: AvailableClusterPoolVersionsOperations operations - :vartype available_cluster_pool_versions: - azure.mgmt.hdinsightcontainers.operations.AvailableClusterPoolVersionsOperations - :ivar available_cluster_versions: AvailableClusterVersionsOperations operations - :vartype available_cluster_versions: - azure.mgmt.hdinsightcontainers.operations.AvailableClusterVersionsOperations - :ivar cluster_libraries: ClusterLibrariesOperations operations - :vartype cluster_libraries: - azure.mgmt.hdinsightcontainers.operations.ClusterLibrariesOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2024-05-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 - Retry-After header is present. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = HDInsightContainersMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - ARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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.cluster_pool_upgrade_histories = ClusterPoolUpgradeHistoriesOperations( - 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_upgrade_histories = ClusterUpgradeHistoriesOperations( - 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) - self.available_cluster_pool_versions = AvailableClusterPoolVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.available_cluster_versions = AvailableClusterVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.cluster_libraries = ClusterLibrariesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> Self: - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_patch.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_serialization.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_serialization.py deleted file mode 100644 index 8139854b97bb..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_serialization.py +++ /dev/null @@ -1,2000 +0,0 @@ -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# pylint: skip-file -# pyright: reportUnnecessaryTypeIgnoreComment=false - -from base64 import b64decode, b64encode -import calendar -import datetime -import decimal -import email -from enum import Enum -import json -import logging -import re -import sys -import codecs -from typing import ( - Dict, - Any, - cast, - Optional, - Union, - AnyStr, - IO, - Mapping, - Callable, - TypeVar, - MutableMapping, - Type, - List, - Mapping, -) - -try: - from urllib import quote # type: ignore -except ImportError: - from urllib.parse import quote -import xml.etree.ElementTree as ET - -import isodate # type: ignore - -from azure.core.exceptions import DeserializationError, SerializationError -from azure.core.serialization import NULL as CoreNull - -_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") - -ModelType = TypeVar("ModelType", bound="Model") -JSON = MutableMapping[str, Any] - - -class RawDeserializer: - - # Accept "text" because we're open minded people... - JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") - - # Name used in context - CONTEXT_NAME = "deserialized_data" - - @classmethod - def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: - """Decode data according to content-type. - - Accept a stream of data as well, but will be load at once in memory for now. - - If no content-type, will return the string version (not bytes, not stream) - - :param data: Input, could be bytes or stream (will be decoded with UTF8) or text - :type data: str or bytes or IO - :param str content_type: The content type. - """ - if hasattr(data, "read"): - # Assume a stream - data = cast(IO, data).read() - - if isinstance(data, bytes): - data_as_str = data.decode(encoding="utf-8-sig") - else: - # Explain to mypy the correct type. - data_as_str = cast(str, data) - - # Remove Byte Order Mark if present in string - data_as_str = data_as_str.lstrip(_BOM) - - if content_type is None: - return data - - if cls.JSON_REGEXP.match(content_type): - try: - return json.loads(data_as_str) - except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) - elif "xml" in (content_type or []): - try: - - try: - if isinstance(data, unicode): # type: ignore - # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string - data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore - except NameError: - pass - - return ET.fromstring(data_as_str) # nosec - except ET.ParseError as err: - # It might be because the server has an issue, and returned JSON with - # content-type XML.... - # So let's try a JSON load, and if it's still broken - # let's flow the initial exception - def _json_attemp(data): - try: - return True, json.loads(data) - except ValueError: - return False, None # Don't care about this one - - success, json_result = _json_attemp(data) - if success: - return json_result - # If i'm here, it's not JSON, it's not XML, let's scream - # and raise the last context in this block (the XML exception) - # The function hack is because Py2.7 messes up with exception - # context otherwise. - _LOGGER.critical("Wasn't XML not JSON, failing") - raise DeserializationError("XML is invalid") from err - elif content_type.startswith("text/"): - return data_as_str - raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) - - @classmethod - def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: - """Deserialize from HTTP response. - - Use bytes and headers to NOT use any requests/aiohttp or whatever - specific implementation. - Headers will tested for "content-type" - """ - # Try to use content-type from headers if available - content_type = None - if "content-type" in headers: - content_type = headers["content-type"].split(";")[0].strip().lower() - # Ouch, this server did not declare what it sent... - # Let's guess it's JSON... - # Also, since Autorest was considering that an empty body was a valid JSON, - # need that test as well.... - else: - content_type = "application/json" - - if body_bytes: - return cls.deserialize_from_text(body_bytes, content_type) - return None - - -_LOGGER = logging.getLogger(__name__) - -try: - _long_type = long # type: ignore -except NameError: - _long_type = int - - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0.""" - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation.""" - return "Z" - - def dst(self, dt): - """No daylight saving for UTC.""" - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore - -_FLATTEN = re.compile(r"(? None: - self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: - if k not in self._attribute_map: - _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) - elif k in self._validation and self._validation[k].get("readonly", False): - _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) - else: - setattr(self, k, kwargs[k]) - - def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" - if isinstance(other, self.__class__): - return self.__dict__ == other.__dict__ - return False - - def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" - return not self.__eq__(other) - - def __str__(self) -> str: - return str(self.__dict__) - - @classmethod - def enable_additional_properties_sending(cls) -> None: - cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} - - @classmethod - def is_xml_model(cls) -> bool: - try: - cls._xml_map # type: ignore - except AttributeError: - return False - return True - - @classmethod - def _create_xml_node(cls): - """Create XML node.""" - try: - xml_map = cls._xml_map # type: ignore - except AttributeError: - xml_map = {} - - return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - - def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: - """Return the JSON that would be sent to server from this model. - - This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. - - If you want XML serialization, you can pass the kwargs is_xml=True. - - :param bool keep_readonly: If you want to serialize the readonly attributes - :returns: A dict JSON compatible object - :rtype: dict - """ - serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore - - def as_dict( - self, - keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, - **kwargs: Any - ) -> JSON: - """Return a dict that can be serialized using json.dump. - - Advanced usage might optionally use a callback as parameter: - - .. code::python - - def my_key_transformer(key, attr_desc, value): - return key - - Key is the attribute name used in Python. Attr_desc - is a dict of metadata. Currently contains 'type' with the - msrest type and 'key' with the RestAPI encoded key. - Value is the current value in this object. - - The string returned will be used to serialize the key. - If the return type is a list, this is considered hierarchical - result dict. - - See the three examples in this file: - - - attribute_transformer - - full_restapi_key_transformer - - last_restapi_key_transformer - - If you want XML serialization, you can pass the kwargs is_xml=True. - - :param function key_transformer: A key transformer function. - :returns: A dict JSON compatible object - :rtype: dict - """ - serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore - - @classmethod - def _infer_class_models(cls): - try: - str_models = cls.__module__.rsplit(".", 1)[0] - models = sys.modules[str_models] - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - if cls.__name__ not in client_models: - raise ValueError("Not Autorest generated code") - except Exception: - # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. - client_models = {cls.__name__: cls} - return client_models - - @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: - """Parse a str using the RestAPI syntax and return a model. - - :param str data: A str using RestAPI structure. JSON by default. - :param str content_type: JSON by default, set application/xml if XML. - :returns: An instance of this model - :raises: DeserializationError if something went wrong - """ - deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) # type: ignore - - @classmethod - def from_dict( - cls: Type[ModelType], - data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, - content_type: Optional[str] = None, - ) -> ModelType: - """Parse a dict using given key extractor return a model. - - By default consider key - extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor - and last_rest_key_case_insensitive_extractor) - - :param dict data: A dict using RestAPI structure - :param str content_type: JSON by default, set application/xml if XML. - :returns: An instance of this model - :raises: DeserializationError if something went wrong - """ - deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( # type: ignore - [ # type: ignore - attribute_key_case_insensitive_extractor, - rest_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor, - ] - if key_extractors is None - else key_extractors - ) - return deserializer(cls.__name__, data, content_type=content_type) # type: ignore - - @classmethod - def _flatten_subtype(cls, key, objects): - if "_subtype_map" not in cls.__dict__: - return {} - result = dict(cls._subtype_map[key]) - for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) - return result - - @classmethod - def _classify(cls, response, objects): - """Check the class _subtype_map for any child classes. - We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. - """ - for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): - subtype_value = None - - if not isinstance(response, ET.Element): - rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) - else: - subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) - if subtype_value: - # Try to match base class. Can be class name only - # (bug to fix in Autorest to support x-ms-discriminator-name) - if cls.__name__ == subtype_value: - return cls - flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) - try: - return objects[flatten_mapping_type[subtype_value]] # type: ignore - except KeyError: - _LOGGER.warning( - "Subtype value %s has no mapping, use base class %s.", - subtype_value, - cls.__name__, - ) - break - else: - _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) - break - return cls - - @classmethod - def _get_rest_key_parts(cls, attr_key): - """Get the RestAPI key of this attr, split it and decode part - :param str attr_key: Attribute key must be in attribute_map. - :returns: A list of RestAPI part - :rtype: list - """ - rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) - return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] - - -def _decode_attribute_map_key(key): - """This decode a key in an _attribute_map to the actual key we want to look at - inside the received data. - - :param str key: A key string from the generated code - """ - return key.replace("\\.", ".") - - -class Serializer(object): - """Request object model serializer.""" - - basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - - _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} - days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} - months = { - 1: "Jan", - 2: "Feb", - 3: "Mar", - 4: "Apr", - 5: "May", - 6: "Jun", - 7: "Jul", - 8: "Aug", - 9: "Sep", - 10: "Oct", - 11: "Nov", - 12: "Dec", - } - validation = { - "min_length": lambda x, y: len(x) < y, - "max_length": lambda x, y: len(x) > y, - "minimum": lambda x, y: x < y, - "maximum": lambda x, y: x > y, - "minimum_ex": lambda x, y: x <= y, - "maximum_ex": lambda x, y: x >= y, - "min_items": lambda x, y: len(x) < y, - "max_items": lambda x, y: len(x) > y, - "pattern": lambda x, y: not re.match(y, x, re.UNICODE), - "unique": lambda x, y: len(x) != len(set(x)), - "multiple": lambda x, y: x % y != 0, - } - - def __init__(self, classes: Optional[Mapping[str, type]] = None): - self.serialize_type = { - "iso-8601": Serializer.serialize_iso, - "rfc-1123": Serializer.serialize_rfc, - "unix-time": Serializer.serialize_unix, - "duration": Serializer.serialize_duration, - "date": Serializer.serialize_date, - "time": Serializer.serialize_time, - "decimal": Serializer.serialize_decimal, - "long": Serializer.serialize_long, - "bytearray": Serializer.serialize_bytearray, - "base64": Serializer.serialize_base64, - "object": self.serialize_object, - "[]": self.serialize_iter, - "{}": self.serialize_dict, - } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} - self.key_transformer = full_restapi_key_transformer - self.client_side_validation = True - - def _serialize(self, target_obj, data_type=None, **kwargs): - """Serialize data into a string according to type. - - :param target_obj: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str, dict - :raises: SerializationError if serialization fails. - """ - key_transformer = kwargs.get("key_transformer", self.key_transformer) - keep_readonly = kwargs.get("keep_readonly", False) - if target_obj is None: - return None - - attr_name = None - class_name = target_obj.__class__.__name__ - - if data_type: - return self.serialize_data(target_obj, data_type, **kwargs) - - if not hasattr(target_obj, "_attribute_map"): - data_type = type(target_obj).__name__ - if data_type in self.basic_types.values(): - return self.serialize_data(target_obj, data_type, **kwargs) - - # Force "is_xml" kwargs if we detect a XML model - try: - is_xml_model_serialization = kwargs["is_xml"] - except KeyError: - is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) - - serialized = {} - if is_xml_model_serialization: - serialized = target_obj._create_xml_node() - try: - attributes = target_obj._attribute_map - for attr, attr_desc in attributes.items(): - attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): - continue - - if attr_name == "additional_properties" and attr_desc["key"] == "": - if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) - continue - try: - - orig_attr = getattr(target_obj, attr) - if is_xml_model_serialization: - pass # Don't provide "transformer" for XML for now. Keep "orig_attr" - else: # JSON - keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) - keys = keys if isinstance(keys, list) else [keys] - - kwargs["serialization_ctxt"] = attr_desc - new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) - - if is_xml_model_serialization: - xml_desc = attr_desc.get("xml", {}) - xml_name = xml_desc.get("name", attr_desc["key"]) - xml_prefix = xml_desc.get("prefix", None) - xml_ns = xml_desc.get("ns", None) - if xml_desc.get("attr", False): - if xml_ns: - ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) # type: ignore - continue - if xml_desc.get("text", False): - serialized.text = new_attr # type: ignore - continue - if isinstance(new_attr, list): - serialized.extend(new_attr) # type: ignore - elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. - if "name" not in getattr(orig_attr, "_xml_map", {}): - splitted_tag = new_attr.tag.split("}") - if len(splitted_tag) == 2: # Namespace - new_attr.tag = "}".join([splitted_tag[0], xml_name]) - else: - new_attr.tag = xml_name - serialized.append(new_attr) # type: ignore - else: # That's a basic type - # Integrate namespace if necessary - local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) - local_node.text = str(new_attr) - serialized.append(local_node) # type: ignore - else: # JSON - for k in reversed(keys): # type: ignore - new_attr = {k: new_attr} - - _new_attr = new_attr - _serialized = serialized - for k in keys: # type: ignore - if k not in _serialized: - _serialized.update(_new_attr) # type: ignore - _new_attr = _new_attr[k] # type: ignore - _serialized = _serialized[k] - except ValueError as err: - if isinstance(err, SerializationError): - raise - - except (AttributeError, KeyError, TypeError) as err: - msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) - raise SerializationError(msg) from err - else: - return serialized - - def body(self, data, data_type, **kwargs): - """Serialize data intended for a request body. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None - """ - - # Just in case this is a dict - internal_data_type_str = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type_str, None) - try: - is_xml_model_serialization = kwargs["is_xml"] - except KeyError: - if internal_data_type and issubclass(internal_data_type, Model): - is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) - else: - is_xml_model_serialization = False - if internal_data_type and not isinstance(internal_data_type, Enum): - try: - deserializer = Deserializer(self.dependencies) - # Since it's on serialization, it's almost sure that format is not JSON REST - # We're not able to deal with additional properties for now. - deserializer.additional_properties_detection = False - if is_xml_model_serialization: - deserializer.key_extractors = [ # type: ignore - attribute_key_case_insensitive_extractor, - ] - else: - deserializer.key_extractors = [ - rest_key_case_insensitive_extractor, - attribute_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor, - ] - data = deserializer._deserialize(data_type, data) - except DeserializationError as err: - raise SerializationError("Unable to build a model: " + str(err)) from err - - return self._serialize(data, data_type, **kwargs) - - def url(self, name, data, data_type, **kwargs): - """Serialize data intended for a URL path. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None - """ - try: - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - - if kwargs.get("skip_quote") is True: - output = str(output) - output = output.replace("{", quote("{")).replace("}", quote("}")) - else: - output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output - - def query(self, name, data, data_type, **kwargs): - """Serialize data intended for a URL query. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :keyword bool skip_quote: Whether to skip quote the serialized result. - Defaults to False. - :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None - """ - try: - # Treat the list aside, since we don't want to encode the div separator - if data_type.startswith("["): - internal_data_type = data_type[1:-1] - do_quote = not kwargs.get("skip_quote", False) - return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) - - # Not a list, regular serialization - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - if kwargs.get("skip_quote") is True: - output = str(output) - else: - output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) - - def header(self, name, data, data_type, **kwargs): - """Serialize data intended for a request header. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None - """ - try: - if data_type in ["[str]"]: - data = ["" if d is None else d for d in data] - - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) - - def serialize_data(self, data, data_type, **kwargs): - """Serialize generic data according to supplied data type. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. - """ - if data is None: - raise ValueError("No value for given attribute") - - try: - if data is CoreNull: - return None - if data_type in self.basic_types.values(): - return self.serialize_basic(data, data_type, **kwargs) - - elif data_type in self.serialize_type: - return self.serialize_type[data_type](data, **kwargs) - - # If dependencies is empty, try with current data class - # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) - if issubclass(enum_type, Enum): - return Serializer.serialize_enum(data, enum_obj=enum_type) - - iter_type = data_type[0] + data_type[-1] - if iter_type in self.serialize_type: - return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) - - except (ValueError, TypeError) as err: - msg = "Unable to serialize value: {!r} as type: {!r}." - raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) - - @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): - custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) - if custom_serializer: - return custom_serializer - if kwargs.get("is_xml", False): - return cls._xml_basic_types_serializers.get(data_type) - - @classmethod - def serialize_basic(cls, data, data_type, **kwargs): - """Serialize basic builting data type. - Serializes objects to str, int, float or bool. - - Possible kwargs: - - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - - is_xml bool : If set, use xml_basic_types_serializers - - :param data: Object to be serialized. - :param str data_type: Type of object in the iterable. - """ - custom_serializer = cls._get_custom_serializers(data_type, **kwargs) - if custom_serializer: - return custom_serializer(data) - if data_type == "str": - return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec - - @classmethod - def serialize_unicode(cls, data): - """Special handling for serializing unicode strings in Py2. - Encode to UTF-8 if unicode, otherwise handle as a str. - - :param data: Object to be serialized. - :rtype: str - """ - try: # If I received an enum, return its value - return data.value - except AttributeError: - pass - - try: - if isinstance(data, unicode): # type: ignore - # Don't change it, JSON and XML ElementTree are totally able - # to serialize correctly u'' strings - return data - except NameError: - return str(data) - else: - return str(data) - - def serialize_iter(self, data, iter_type, div=None, **kwargs): - """Serialize iterable. - - Supported kwargs: - - serialization_ctxt dict : The current entry of _attribute_map, or same format. - serialization_ctxt['type'] should be same as data_type. - - is_xml bool : If set, serialize as XML - - :param list attr: Object to be serialized. - :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - not be None or empty. - :param str div: If set, this str will be used to combine the elements - in the iterable into a combined string. Default is 'None'. - :keyword bool do_quote: Whether to quote the serialized result of each iterable element. - Defaults to False. - :rtype: list, str - """ - if isinstance(data, str): - raise SerializationError("Refuse str type as a valid iter type.") - - serialization_ctxt = kwargs.get("serialization_ctxt", {}) - is_xml = kwargs.get("is_xml", False) - - serialized = [] - for d in data: - try: - serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError as err: - if isinstance(err, SerializationError): - raise - serialized.append(None) - - if kwargs.get("do_quote", False): - serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] - - if div: - serialized = ["" if s is None else str(s) for s in serialized] - serialized = div.join(serialized) - - if "xml" in serialization_ctxt or is_xml: - # XML serialization is more complicated - xml_desc = serialization_ctxt.get("xml", {}) - xml_name = xml_desc.get("name") - if not xml_name: - xml_name = serialization_ctxt["key"] - - # Create a wrap node if necessary (use the fact that Element and list have "append") - is_wrapped = xml_desc.get("wrapped", False) - node_name = xml_desc.get("itemsName", xml_name) - if is_wrapped: - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - else: - final_result = [] - # All list elements to "local_node" - for el in serialized: - if isinstance(el, ET.Element): - el_node = el - else: - el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - if el is not None: # Otherwise it writes "None" :-p - el_node.text = str(el) - final_result.append(el_node) - return final_result - return serialized - - def serialize_dict(self, attr, dict_type, **kwargs): - """Serialize a dictionary of objects. - - :param dict attr: Object to be serialized. - :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. - :rtype: dict - """ - serialization_ctxt = kwargs.get("serialization_ctxt", {}) - serialized = {} - for key, value in attr.items(): - try: - serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError as err: - if isinstance(err, SerializationError): - raise - serialized[self.serialize_unicode(key)] = None - - if "xml" in serialization_ctxt: - # XML serialization is more complicated - xml_desc = serialization_ctxt["xml"] - xml_name = xml_desc["name"] - - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - for key, value in serialized.items(): - ET.SubElement(final_result, key).text = value - return final_result - - return serialized - - def serialize_object(self, attr, **kwargs): - """Serialize a generic object. - This will be handled as a dictionary. If object passed in is not - a basic type (str, int, float, dict, list) it will simply be - cast to str. - - :param dict attr: Object to be serialized. - :rtype: dict or str - """ - if attr is None: - return None - if isinstance(attr, ET.Element): - return attr - obj_type = type(attr) - if obj_type in self.basic_types: - return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) - if obj_type is _long_type: - return self.serialize_long(attr) - if obj_type is str: - return self.serialize_unicode(attr) - if obj_type is datetime.datetime: - return self.serialize_iso(attr) - if obj_type is datetime.date: - return self.serialize_date(attr) - if obj_type is datetime.time: - return self.serialize_time(attr) - if obj_type is datetime.timedelta: - return self.serialize_duration(attr) - if obj_type is decimal.Decimal: - return self.serialize_decimal(attr) - - # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): - return self._serialize(attr) - - if obj_type == dict: - serialized = {} - for key, value in attr.items(): - try: - serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) - except ValueError: - serialized[self.serialize_unicode(key)] = None - return serialized - - if obj_type == list: - serialized = [] - for obj in attr: - try: - serialized.append(self.serialize_object(obj, **kwargs)) - except ValueError: - pass - return serialized - return str(attr) - - @staticmethod - def serialize_enum(attr, enum_obj=None): - try: - result = attr.value - except AttributeError: - result = attr - try: - enum_obj(result) # type: ignore - return result - except ValueError: - for enum_value in enum_obj: # type: ignore - if enum_value.value.lower() == str(attr).lower(): - return enum_value.value - error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) - - @staticmethod - def serialize_bytearray(attr, **kwargs): - """Serialize bytearray into base-64 string. - - :param attr: Object to be serialized. - :rtype: str - """ - return b64encode(attr).decode() - - @staticmethod - def serialize_base64(attr, **kwargs): - """Serialize str into base-64 string. - - :param attr: Object to be serialized. - :rtype: str - """ - encoded = b64encode(attr).decode("ascii") - return encoded.strip("=").replace("+", "-").replace("/", "_") - - @staticmethod - def serialize_decimal(attr, **kwargs): - """Serialize Decimal object to float. - - :param attr: Object to be serialized. - :rtype: float - """ - return float(attr) - - @staticmethod - def serialize_long(attr, **kwargs): - """Serialize long (Py2) or int (Py3). - - :param attr: Object to be serialized. - :rtype: int/long - """ - return _long_type(attr) - - @staticmethod - def serialize_date(attr, **kwargs): - """Serialize Date object into ISO-8601 formatted string. - - :param Date attr: Object to be serialized. - :rtype: str - """ - if isinstance(attr, str): - attr = isodate.parse_date(attr) - t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) - return t - - @staticmethod - def serialize_time(attr, **kwargs): - """Serialize Time object into ISO-8601 formatted string. - - :param datetime.time attr: Object to be serialized. - :rtype: str - """ - if isinstance(attr, str): - attr = isodate.parse_time(attr) - t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) - if attr.microsecond: - t += ".{:02}".format(attr.microsecond) - return t - - @staticmethod - def serialize_duration(attr, **kwargs): - """Serialize TimeDelta object into ISO-8601 formatted string. - - :param TimeDelta attr: Object to be serialized. - :rtype: str - """ - if isinstance(attr, str): - attr = isodate.parse_duration(attr) - return isodate.duration_isoformat(attr) - - @staticmethod - def serialize_rfc(attr, **kwargs): - """Serialize Datetime object into RFC-1123 formatted string. - - :param Datetime attr: Object to be serialized. - :rtype: str - :raises: TypeError if format invalid. - """ - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") - - return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( - Serializer.days[utc.tm_wday], - utc.tm_mday, - Serializer.months[utc.tm_mon], - utc.tm_year, - utc.tm_hour, - utc.tm_min, - utc.tm_sec, - ) - - @staticmethod - def serialize_iso(attr, **kwargs): - """Serialize Datetime object into ISO-8601 formatted string. - - :param Datetime attr: Object to be serialized. - :rtype: str - :raises: SerializationError if format invalid. - """ - if isinstance(attr, str): - attr = isodate.parse_datetime(attr) - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - utc = attr.utctimetuple() - if utc.tm_year > 9999 or utc.tm_year < 1: - raise OverflowError("Hit max or min date") - - microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") - if microseconds: - microseconds = "." + microseconds - date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( - utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec - ) - return date + microseconds + "Z" - except (ValueError, OverflowError) as err: - msg = "Unable to serialize datetime object." - raise SerializationError(msg) from err - except AttributeError as err: - msg = "ISO-8601 object must be valid Datetime object." - raise TypeError(msg) from err - - @staticmethod - def serialize_unix(attr, **kwargs): - """Serialize Datetime object into IntTime format. - This is represented as seconds. - - :param Datetime attr: Object to be serialized. - :rtype: int - :raises: SerializationError if format invalid - """ - if isinstance(attr, int): - return attr - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") - - -def rest_key_extractor(attr, attr_desc, data): - key = attr_desc["key"] - working_data = data - - while "." in key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) - if len(dict_keys) == 1: - key = _decode_attribute_map_key(dict_keys[0]) - break - working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = working_data.get(working_key, data) - if working_data is None: - # If at any point while following flatten JSON path see None, it means - # that all properties under are None as well - return None - key = ".".join(dict_keys[1:]) - - return working_data.get(key) - - -def rest_key_case_insensitive_extractor(attr, attr_desc, data): - key = attr_desc["key"] - working_data = data - - while "." in key: - dict_keys = _FLATTEN.split(key) - if len(dict_keys) == 1: - key = _decode_attribute_map_key(dict_keys[0]) - break - working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) - if working_data is None: - # If at any point while following flatten JSON path see None, it means - # that all properties under are None as well - return None - key = ".".join(dict_keys[1:]) - - if working_data: - return attribute_key_case_insensitive_extractor(key, None, working_data) - - -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" - key = attr_desc["key"] - dict_keys = _FLATTEN.split(key) - return attribute_key_extractor(dict_keys[-1], None, data) - - -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key. - - This is the case insensitive version of "last_rest_key_extractor" - """ - key = attr_desc["key"] - dict_keys = _FLATTEN.split(key) - return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) - - -def attribute_key_extractor(attr, _, data): - return data.get(attr) - - -def attribute_key_case_insensitive_extractor(attr, _, data): - found_key = None - lower_attr = attr.lower() - for key in data: - if lower_attr == key.lower(): - found_key = key - break - - return data.get(found_key) - - -def _extract_name_from_internal_type(internal_type): - """Given an internal type XML description, extract correct XML name with namespace. - - :param dict internal_type: An model type - :rtype: tuple - :returns: A tuple XML name + namespace dict - """ - internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - xml_name = internal_type_xml_map.get("name", internal_type.__name__) - xml_ns = internal_type_xml_map.get("ns", None) - if xml_ns: - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - return xml_name - - -def xml_key_extractor(attr, attr_desc, data): - if isinstance(data, dict): - return None - - # Test if this model is XML ready first - if not isinstance(data, ET.Element): - return None - - xml_desc = attr_desc.get("xml", {}) - xml_name = xml_desc.get("name", attr_desc["key"]) - - # Look for a children - is_iter_type = attr_desc["type"].startswith("[") - is_wrapped = xml_desc.get("wrapped", False) - internal_type = attr_desc.get("internalType", None) - internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - - # Integrate namespace if necessary - xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) - if xml_ns: - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - - # If it's an attribute, that's simple - if xml_desc.get("attr", False): - return data.get(xml_name) - - # If it's x-ms-text, that's simple too - if xml_desc.get("text", False): - return data.text - - # Scenario where I take the local name: - # - Wrapped node - # - Internal type is an enum (considered basic types) - # - Internal type has no XML/Name node - if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): - children = data.findall(xml_name) - # If internal type has a local name and it's not a list, I use that name - elif not is_iter_type and internal_type and "name" in internal_type_xml_map: - xml_name = _extract_name_from_internal_type(internal_type) - children = data.findall(xml_name) - # That's an array - else: - if internal_type: # Complex type, ignore itemsName and use the complex type name - items_name = _extract_name_from_internal_type(internal_type) - else: - items_name = xml_desc.get("itemsName", xml_name) - children = data.findall(items_name) - - if len(children) == 0: - if is_iter_type: - if is_wrapped: - return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list - return None # Assume it's not there, maybe an optional node. - - # If is_iter_type and not wrapped, return all found children - if is_iter_type: - if not is_wrapped: - return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) - ) - return list(children[0]) # Might be empty list and that's ok. - - # Here it's not a itertype, we should have found one element only or empty - if len(children) > 1: - raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) - return children[0] - - -class Deserializer(object): - """Response object model deserializer. - - :param dict classes: Class type dictionary for deserializing complex types. - :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. - """ - - basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - - def __init__(self, classes: Optional[Mapping[str, type]] = None): - self.deserialize_type = { - "iso-8601": Deserializer.deserialize_iso, - "rfc-1123": Deserializer.deserialize_rfc, - "unix-time": Deserializer.deserialize_unix, - "duration": Deserializer.deserialize_duration, - "date": Deserializer.deserialize_date, - "time": Deserializer.deserialize_time, - "decimal": Deserializer.deserialize_decimal, - "long": Deserializer.deserialize_long, - "bytearray": Deserializer.deserialize_bytearray, - "base64": Deserializer.deserialize_base64, - "object": self.deserialize_object, - "[]": self.deserialize_iter, - "{}": self.deserialize_dict, - } - self.deserialize_expected_types = { - "duration": (isodate.Duration, datetime.timedelta), - "iso-8601": (datetime.datetime), - } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} - self.key_extractors = [rest_key_extractor, xml_key_extractor] - # Additional properties only works if the "rest_key_extractor" is used to - # extract the keys. Making it to work whatever the key extractor is too much - # complicated, with no real scenario for now. - # So adding a flag to disable additional properties detection. This flag should be - # used if your expect the deserialization to NOT come from a JSON REST syntax. - # Otherwise, result are unexpected - self.additional_properties_detection = True - - def __call__(self, target_obj, response_data, content_type=None): - """Call the deserializer to process a REST response. - - :param str target_obj: Target data type to deserialize to. - :param requests.Response response_data: REST response object. - :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. - :return: Deserialized object. - """ - data = self._unpack_content(response_data, content_type) - return self._deserialize(target_obj, data) - - def _deserialize(self, target_obj, data): - """Call the deserializer on a model. - - Data needs to be already deserialized as JSON or XML ElementTree - - :param str target_obj: Target data type to deserialize to. - :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. - :return: Deserialized object. - """ - # This is already a model, go recursive just in case - if hasattr(data, "_attribute_map"): - constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] - try: - for attr, mapconfig in data._attribute_map.items(): - if attr in constants: - continue - value = getattr(data, attr) - if value is None: - continue - local_type = mapconfig["type"] - internal_data_type = local_type.strip("[]{}") - if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): - continue - setattr(data, attr, self._deserialize(local_type, value)) - return data - except AttributeError: - return - - response, class_name = self._classify_target(target_obj, data) - - if isinstance(response, str): - return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): - return self.deserialize_enum(data, response) - - if data is None or data is CoreNull: - return data - try: - attributes = response._attribute_map # type: ignore - d_attrs = {} - for attr, attr_desc in attributes.items(): - # Check empty string. If it's not empty, someone has a real "additionalProperties"... - if attr == "additional_properties" and attr_desc["key"] == "": - continue - raw_value = None - # Enhance attr_desc with some dynamic data - attr_desc = attr_desc.copy() # Do a copy, do not change the real one - internal_data_type = attr_desc["type"].strip("[]{}") - if internal_data_type in self.dependencies: - attr_desc["internalType"] = self.dependencies[internal_data_type] - - for key_extractor in self.key_extractors: - found_value = key_extractor(attr, attr_desc, data) - if found_value is not None: - if raw_value is not None and raw_value != found_value: - msg = ( - "Ignoring extracted value '%s' from %s for key '%s'" - " (duplicate extraction, follow extractors order)" - ) - _LOGGER.warning(msg, found_value, key_extractor, attr) - continue - raw_value = found_value - - value = self.deserialize_data(raw_value, attr_desc["type"]) - d_attrs[attr] = value - except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name # type: ignore - raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) - - def _build_additional_properties(self, attribute_map, data): - if not self.additional_properties_detection: - return None - if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": - # Check empty string. If it's not empty, someone has a real "additionalProperties" - return None - if isinstance(data, ET.Element): - data = {el.tag: el.text for el in data} - - known_keys = { - _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) - for desc in attribute_map.values() - if desc["key"] != "" - } - present_keys = set(data.keys()) - missing_keys = present_keys - known_keys - return {key: data[key] for key in missing_keys} - - def _classify_target(self, target, data): - """Check to see whether the deserialization target object can - be classified into a subclass. - Once classification has been determined, initialize object. - - :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deserialize. - """ - if target is None: - return None, None - - if isinstance(target, str): - try: - target = self.dependencies[target] - except KeyError: - return target, target - - try: - target = target._classify(data, self.dependencies) # type: ignore - except AttributeError: - pass # Target is not a Model, no classify - return target, target.__class__.__name__ # type: ignore - - def failsafe_deserialize(self, target_obj, data, content_type=None): - """Ignores any errors encountered in deserialization, - and falls back to not deserializing the object. Recommended - for use in error deserialization, as we want to return the - HttpResponseError to users, and not have them deal with - a deserialization error. - - :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deserialize. - :param str content_type: Swagger "produces" if available. - """ - try: - return self(target_obj, data, content_type=content_type) - except: - _LOGGER.debug( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - @staticmethod - def _unpack_content(raw_data, content_type=None): - """Extract the correct structure for deserialization. - - If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. - if we can't, raise. Your Pipeline should have a RawDeserializer. - - If not a pipeline response and raw_data is bytes or string, use content-type - to decode it. If no content-type, try JSON. - - If raw_data is something else, bypass all logic and return it directly. - - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. - :raises JSONDecodeError: If JSON is requested and parsing is impossible. - :raises UnicodeDecodeError: If bytes is not UTF8 - """ - # Assume this is enough to detect a Pipeline Response without importing it - context = getattr(raw_data, "context", {}) - if context: - if RawDeserializer.CONTEXT_NAME in context: - return context[RawDeserializer.CONTEXT_NAME] - raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") - - # Assume this is enough to recognize universal_http.ClientResponse without importing it - if hasattr(raw_data, "body"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) - - # Assume this enough to recognize requests.Response without importing it. - if hasattr(raw_data, "_content_consumed"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) - - if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore - return raw_data - - def _instantiate_model(self, response, attrs, additional_properties=None): - """Instantiate a response model passing in deserialized args. - - :param response: The response model class. - :param d_attrs: The deserialized response attributes. - """ - if callable(response): - subtype = getattr(response, "_subtype_map", {}) - try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] - kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} - response_obj = response(**kwargs) - for attr in readonly: - setattr(response_obj, attr, attrs.get(attr)) - if additional_properties: - response_obj.additional_properties = additional_properties - return response_obj - except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) - else: - try: - for attr, value in attrs.items(): - setattr(response, attr, value) - return response - except Exception as exp: - msg = "Unable to populate response model. " - msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) - - def deserialize_data(self, data, data_type): - """Process data for deserialization according to data type. - - :param str data: The response string to be deserialized. - :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. - :return: Deserialized object. - """ - if data is None: - return data - - try: - if not data_type: - return data - if data_type in self.basic_types.values(): - return self.deserialize_basic(data, data_type) - if data_type in self.deserialize_type: - if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): - return data - - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] - if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: - return None - data_val = self.deserialize_type[data_type](data) - return data_val - - iter_type = data_type[0] + data_type[-1] - if iter_type in self.deserialize_type: - return self.deserialize_type[iter_type](data, data_type[1:-1]) - - obj_type = self.dependencies[data_type] - if issubclass(obj_type, Enum): - if isinstance(data, ET.Element): - data = data.text - return self.deserialize_enum(data, obj_type) - - except (ValueError, TypeError, AttributeError) as err: - msg = "Unable to deserialize response data." - msg += " Data: {}, {}".format(data, data_type) - raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) - - def deserialize_iter(self, attr, iter_type): - """Deserialize an iterable. - - :param list attr: Iterable to be deserialized. - :param str iter_type: The type of object in the iterable. - :rtype: list - """ - if attr is None: - return None - if isinstance(attr, ET.Element): # If I receive an element here, get the children - attr = list(attr) - if not isinstance(attr, (list, set)): - raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) - return [self.deserialize_data(a, iter_type) for a in attr] - - def deserialize_dict(self, attr, dict_type): - """Deserialize a dictionary. - - :param dict/list attr: Dictionary to be deserialized. Also accepts - a list of key, value pairs. - :param str dict_type: The object type of the items in the dictionary. - :rtype: dict - """ - if isinstance(attr, list): - return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} - - if isinstance(attr, ET.Element): - # Transform value into {"Key": "value"} - attr = {el.tag: el.text for el in attr} - return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - - def deserialize_object(self, attr, **kwargs): - """Deserialize a generic object. - This will be handled as a dictionary. - - :param dict attr: Dictionary to be deserialized. - :rtype: dict - :raises: TypeError if non-builtin datatype encountered. - """ - if attr is None: - return None - if isinstance(attr, ET.Element): - # Do no recurse on XML, just return the tree as-is - return attr - if isinstance(attr, str): - return self.deserialize_basic(attr, "str") - obj_type = type(attr) - if obj_type in self.basic_types: - return self.deserialize_basic(attr, self.basic_types[obj_type]) - if obj_type is _long_type: - return self.deserialize_long(attr) - - if obj_type == dict: - deserialized = {} - for key, value in attr.items(): - try: - deserialized[key] = self.deserialize_object(value, **kwargs) - except ValueError: - deserialized[key] = None - return deserialized - - if obj_type == list: - deserialized = [] - for obj in attr: - try: - deserialized.append(self.deserialize_object(obj, **kwargs)) - except ValueError: - pass - return deserialized - - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) - - def deserialize_basic(self, attr, data_type): - """Deserialize basic builtin data type from string. - Will attempt to convert to str, int, float and bool. - This function will also accept '1', '0', 'true' and 'false' as - valid bool values. - - :param str attr: response string to be deserialized. - :param str data_type: deserialization data type. - :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. - """ - # If we're here, data is supposed to be a basic type. - # If it's still an XML node, take the text - if isinstance(attr, ET.Element): - attr = attr.text - if not attr: - if data_type == "str": - # None or '', node is empty string. - return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None - - if data_type == "bool": - if attr in [True, False, 1, 0]: - return bool(attr) - elif isinstance(attr, str): - if attr.lower() in ["true", "1"]: - return True - elif attr.lower() in ["false", "0"]: - return False - raise TypeError("Invalid boolean value: {}".format(attr)) - - if data_type == "str": - return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec - - @staticmethod - def deserialize_unicode(data): - """Preserve unicode objects in Python 2, otherwise return data - as a string. - - :param str data: response string to be deserialized. - :rtype: str or unicode - """ - # We might be here because we have an enum modeled as string, - # and we try to deserialize a partial dict with enum inside - if isinstance(data, Enum): - return data - - # Consider this is real string - try: - if isinstance(data, unicode): # type: ignore - return data - except NameError: - return str(data) - else: - return str(data) - - @staticmethod - def deserialize_enum(data, enum_obj): - """Deserialize string into enum object. - - If the string is not a valid enum value it will be returned as-is - and a warning will be logged. - - :param str data: Response string to be deserialized. If this value is - None or invalid it will be returned as-is. - :param Enum enum_obj: Enum object to deserialize to. - :rtype: Enum - """ - if isinstance(data, enum_obj) or data is None: - return data - if isinstance(data, Enum): - data = data.value - if isinstance(data, int): - # Workaround. We might consider remove it in the future. - try: - return list(enum_obj.__members__.values())[data] - except IndexError: - error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) - try: - return enum_obj(str(data)) - except ValueError: - for enum_value in enum_obj: - if enum_value.value.lower() == str(data).lower(): - return enum_value - # We don't fail anymore for unknown value, we deserialize as a string - _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) - return Deserializer.deserialize_unicode(data) - - @staticmethod - def deserialize_bytearray(attr): - """Deserialize string into bytearray. - - :param str attr: response string to be deserialized. - :rtype: bytearray - :raises: TypeError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - return bytearray(b64decode(attr)) # type: ignore - - @staticmethod - def deserialize_base64(attr): - """Deserialize base64 encoded string into string. - - :param str attr: response string to be deserialized. - :rtype: bytearray - :raises: TypeError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore - attr = attr + padding # type: ignore - encoded = attr.replace("-", "+").replace("_", "/") - return b64decode(encoded) - - @staticmethod - def deserialize_decimal(attr): - """Deserialize string into Decimal object. - - :param str attr: response string to be deserialized. - :rtype: Decimal - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - return decimal.Decimal(str(attr)) # type: ignore - except decimal.DecimalException as err: - msg = "Invalid decimal {}".format(attr) - raise DeserializationError(msg) from err - - @staticmethod - def deserialize_long(attr): - """Deserialize string into long (Py2) or int (Py3). - - :param str attr: response string to be deserialized. - :rtype: long or int - :raises: ValueError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - return _long_type(attr) # type: ignore - - @staticmethod - def deserialize_duration(attr): - """Deserialize ISO-8601 formatted string into TimeDelta object. - - :param str attr: response string to be deserialized. - :rtype: TimeDelta - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - duration = isodate.parse_duration(attr) - except (ValueError, OverflowError, AttributeError) as err: - msg = "Cannot deserialize duration object." - raise DeserializationError(msg) from err - else: - return duration - - @staticmethod - def deserialize_date(attr): - """Deserialize ISO-8601 formatted string into Date object. - - :param str attr: response string to be deserialized. - :rtype: Date - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) - # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - return isodate.parse_date(attr, defaultmonth=0, defaultday=0) - - @staticmethod - def deserialize_time(attr): - """Deserialize ISO-8601 formatted string into time object. - - :param str attr: response string to be deserialized. - :rtype: datetime.time - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) - return isodate.parse_time(attr) - - @staticmethod - def deserialize_rfc(attr): - """Deserialize RFC-1123 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: Datetime - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - parsed_date = email.utils.parsedate_tz(attr) # type: ignore - date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) - ) - if not date_obj.tzinfo: - date_obj = date_obj.astimezone(tz=TZ_UTC) - except ValueError as err: - msg = "Cannot deserialize to rfc datetime object." - raise DeserializationError(msg) from err - else: - return date_obj - - @staticmethod - def deserialize_iso(attr): - """Deserialize ISO-8601 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: Datetime - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - attr = attr.upper() # type: ignore - match = Deserializer.valid_date.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - check_decimal = attr.split(".") - if len(check_decimal) > 1: - decimal_str = "" - for digit in check_decimal[1]: - if digit.isdigit(): - decimal_str += digit - else: - break - if len(decimal_str) > 6: - attr = attr.replace(decimal_str, decimal_str[0:6]) - - date_obj = isodate.parse_datetime(attr) - test_utc = date_obj.utctimetuple() - if test_utc.tm_year > 9999 or test_utc.tm_year < 1: - raise OverflowError("Hit max or min date") - except (ValueError, OverflowError, AttributeError) as err: - msg = "Cannot deserialize datetime object." - raise DeserializationError(msg) from err - else: - return date_obj - - @staticmethod - def deserialize_unix(attr): - """Serialize Datetime object into IntTime format. - This is represented as seconds. - - :param int attr: Object to be serialized. - :rtype: Datetime - :raises: DeserializationError if format invalid - """ - if isinstance(attr, ET.Element): - attr = int(attr.text) # type: ignore - try: - attr = int(attr) - date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) - except ValueError as err: - msg = "Cannot deserialize to unix datetime object." - raise DeserializationError(msg) from err - else: - return date_obj diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_version.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_version.py deleted file mode 100644 index 20971492f129..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -VERSION = "1.0.0b3" diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/__init__.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/__init__.py deleted file mode 100644 index a7cacb1c1174..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# 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 ._hd_insight_containers_mgmt_client import HDInsightContainersMgmtClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "HDInsightContainersMgmtClient", -] -__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/aio/_configuration.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_configuration.py deleted file mode 100644 index a627fff3f566..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_configuration.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class HDInsightContainersMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for HDInsightContainersMgmtClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :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 "2024-05-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: - api_version: str = kwargs.pop("api_version", "2024-05-01-preview") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-hdinsightcontainers/{}".format(VERSION)) - self.polling_interval = kwargs.get("polling_interval", 30) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) 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 deleted file mode 100644 index eb238d50bf34..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_hd_insight_containers_mgmt_client.py +++ /dev/null @@ -1,181 +0,0 @@ -# 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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING -from typing_extensions import Self - -from azure.core.pipeline import policies -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient -from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy - -from .. import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import HDInsightContainersMgmtClientConfiguration -from .operations import ( - AvailableClusterPoolVersionsOperations, - AvailableClusterVersionsOperations, - ClusterAvailableUpgradesOperations, - ClusterJobsOperations, - ClusterLibrariesOperations, - ClusterPoolAvailableUpgradesOperations, - ClusterPoolUpgradeHistoriesOperations, - ClusterPoolsOperations, - ClusterUpgradeHistoriesOperations, - ClustersOperations, - LocationsOperations, - Operations, -) - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class HDInsightContainersMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """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 cluster_pool_upgrade_histories: ClusterPoolUpgradeHistoriesOperations operations - :vartype cluster_pool_upgrade_histories: - azure.mgmt.hdinsightcontainers.aio.operations.ClusterPoolUpgradeHistoriesOperations - :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_upgrade_histories: ClusterUpgradeHistoriesOperations operations - :vartype cluster_upgrade_histories: - azure.mgmt.hdinsightcontainers.aio.operations.ClusterUpgradeHistoriesOperations - :ivar cluster_jobs: ClusterJobsOperations operations - :vartype cluster_jobs: azure.mgmt.hdinsightcontainers.aio.operations.ClusterJobsOperations - :ivar locations: LocationsOperations operations - :vartype locations: azure.mgmt.hdinsightcontainers.aio.operations.LocationsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.hdinsightcontainers.aio.operations.Operations - :ivar available_cluster_pool_versions: AvailableClusterPoolVersionsOperations operations - :vartype available_cluster_pool_versions: - azure.mgmt.hdinsightcontainers.aio.operations.AvailableClusterPoolVersionsOperations - :ivar available_cluster_versions: AvailableClusterVersionsOperations operations - :vartype available_cluster_versions: - azure.mgmt.hdinsightcontainers.aio.operations.AvailableClusterVersionsOperations - :ivar cluster_libraries: ClusterLibrariesOperations operations - :vartype cluster_libraries: - azure.mgmt.hdinsightcontainers.aio.operations.ClusterLibrariesOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2024-05-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 - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = HDInsightContainersMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - AsyncARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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.cluster_pool_upgrade_histories = ClusterPoolUpgradeHistoriesOperations( - 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_upgrade_histories = ClusterUpgradeHistoriesOperations( - 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) - self.available_cluster_pool_versions = AvailableClusterPoolVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.available_cluster_versions = AvailableClusterVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.cluster_libraries = ClusterLibrariesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - def _send_request( - self, request: HttpRequest, *, stream: bool = False, **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> Self: - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_patch.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ 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 deleted file mode 100644 index 6f4eb6caeb35..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ._cluster_pools_operations import ClusterPoolsOperations -from ._cluster_pool_available_upgrades_operations import ClusterPoolAvailableUpgradesOperations -from ._cluster_pool_upgrade_histories_operations import ClusterPoolUpgradeHistoriesOperations -from ._clusters_operations import ClustersOperations -from ._cluster_available_upgrades_operations import ClusterAvailableUpgradesOperations -from ._cluster_upgrade_histories_operations import ClusterUpgradeHistoriesOperations -from ._cluster_jobs_operations import ClusterJobsOperations -from ._locations_operations import LocationsOperations -from ._operations import Operations -from ._available_cluster_pool_versions_operations import AvailableClusterPoolVersionsOperations -from ._available_cluster_versions_operations import AvailableClusterVersionsOperations -from ._cluster_libraries_operations import ClusterLibrariesOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ClusterPoolsOperations", - "ClusterPoolAvailableUpgradesOperations", - "ClusterPoolUpgradeHistoriesOperations", - "ClustersOperations", - "ClusterAvailableUpgradesOperations", - "ClusterUpgradeHistoriesOperations", - "ClusterJobsOperations", - "LocationsOperations", - "Operations", - "AvailableClusterPoolVersionsOperations", - "AvailableClusterVersionsOperations", - "ClusterLibrariesOperations", -] -__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/aio/operations/_available_cluster_pool_versions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_available_cluster_pool_versions_operations.py deleted file mode 100644 index db9acdfd44b4..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_available_cluster_pool_versions_operations.py +++ /dev/null @@ -1,135 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.rest import AsyncHttpResponse, 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 ...operations._available_cluster_pool_versions_operations import build_list_by_location_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AvailableClusterPoolVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s - :attr:`available_cluster_pool_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ClusterPoolVersion"]: - """Returns a list of available cluster pool versions. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either ClusterPoolVersion or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterPoolVersion] - :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.ClusterPoolVersionsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterPoolVersionsListResult", 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) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_available_cluster_versions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_available_cluster_versions_operations.py deleted file mode 100644 index 096d2706239f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_available_cluster_versions_operations.py +++ /dev/null @@ -1,135 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.rest import AsyncHttpResponse, 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 ...operations._available_cluster_versions_operations import build_list_by_location_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AvailableClusterVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s - :attr:`available_cluster_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ClusterVersion"]: - """Returns a list of available cluster versions. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either ClusterVersion or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterVersion] - :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.ClusterVersionsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterVersionsListResult", 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) 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 deleted file mode 100644 index 43bdb33cf05f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_available_upgrades_operations.py +++ /dev/null @@ -1,145 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.rest import AsyncHttpResponse, 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 ...operations._cluster_available_upgrades_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -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 - :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: MutableMapping[int, Type[HttpResponseError]] = { - 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, - headers=_headers, - params=_params, - ) - _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.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) 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 deleted file mode 100644 index bb6e89b7b6a4..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_jobs_operations.py +++ /dev/null @@ -1,369 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._cluster_jobs_operations import build_list_request, build_run_job_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ClusterJobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s - :attr:`cluster_jobs` 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") - - async def _run_job_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_job: Union[_models.ClusterJob, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_job, (IOBase, bytes)): - _content = cluster_job - else: - _json = self._serialize.body(cluster_job, "ClusterJob") - - _request = build_run_job_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_run_job( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_job: _models.ClusterJob, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterJob]: - """Operations on jobs of HDInsight on AKS 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_job: The Cluster job. Required. - :type cluster_job: ~azure.mgmt.hdinsightcontainers.models.ClusterJob - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ClusterJob or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterJob] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_run_job( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_job: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterJob]: - """Operations on jobs of HDInsight on AKS 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_job: The Cluster job. Required. - :type cluster_job: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ClusterJob or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterJob] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_run_job( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_job: Union[_models.ClusterJob, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterJob]: - """Operations on jobs of HDInsight on AKS 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_job: The Cluster job. Is either a ClusterJob type or a IO[bytes] type. Required. - :type cluster_job: ~azure.mgmt.hdinsightcontainers.models.ClusterJob or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ClusterJob or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterJob] - :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.ClusterJob] = 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._run_job_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - cluster_job=cluster_job, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClusterJob", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.ClusterJob].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ClusterJob]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list( - 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. - - :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 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 - :return: An iterator like instance of either ClusterJob or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterJob] - :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.ClusterJobList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterJobList", 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) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_libraries_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_libraries_operations.py deleted file mode 100644 index abc8f73ffc16..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_libraries_operations.py +++ /dev/null @@ -1,363 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._cluster_libraries_operations import build_list_request, build_manage_libraries_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ClusterLibrariesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s - :attr:`cluster_libraries` 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, - category: Union[str, _models.Category], - **kwargs: Any - ) -> AsyncIterable["_models.ClusterLibrary"]: - """Get all libraries of HDInsight on AKS 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 category: The system query option to filter libraries returned in the response. Allowed - value is 'custom' or 'predefined'. Known values are: "custom" and "predefined". Required. - :type category: str or ~azure.mgmt.hdinsightcontainers.models.Category - :return: An iterator like instance of either ClusterLibrary or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterLibrary] - :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.ClusterLibraryList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - category=category, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterLibraryList", 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) - - async def _manage_libraries_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - operation: Union[_models.ClusterLibraryManagementOperation, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(operation, (IOBase, bytes)): - _content = operation - else: - _json = self._serialize.body(operation, "ClusterLibraryManagementOperation") - - _request = build_manage_libraries_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_manage_libraries( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - operation: _models.ClusterLibraryManagementOperation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Library management operations on HDInsight on AKS 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 operation: The library management operation. Required. - :type operation: ~azure.mgmt.hdinsightcontainers.models.ClusterLibraryManagementOperation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_manage_libraries( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - operation: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Library management operations on HDInsight on AKS 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 operation: The library management operation. Required. - :type operation: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_manage_libraries( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - operation: Union[_models.ClusterLibraryManagementOperation, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Library management operations on HDInsight on AKS 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 operation: The library management operation. Is either a - ClusterLibraryManagementOperation type or a IO[bytes] type. Required. - :type operation: ~azure.mgmt.hdinsightcontainers.models.ClusterLibraryManagementOperation or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = 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[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._manage_libraries_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - operation=operation, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 93b1e0e6e622..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pool_available_upgrades_operations.py +++ /dev/null @@ -1,142 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.rest import AsyncHttpResponse, 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 ...operations._cluster_pool_available_upgrades_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -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 - :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: MutableMapping[int, Type[HttpResponseError]] = { - 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, - headers=_headers, - params=_params, - ) - _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.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) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pool_upgrade_histories_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pool_upgrade_histories_operations.py deleted file mode 100644 index 7cc9f523a71c..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pool_upgrade_histories_operations.py +++ /dev/null @@ -1,142 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.rest import AsyncHttpResponse, 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 ...operations._cluster_pool_upgrade_histories_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ClusterPoolUpgradeHistoriesOperations: - """ - .. 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_upgrade_histories` 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.ClusterPoolUpgradeHistory"]: - """Returns a list of upgrade history. - - :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 - :return: An iterator like instance of either ClusterPoolUpgradeHistory or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistory] - :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.ClusterPoolUpgradeHistoryListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterPoolUpgradeHistoryListResult", 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) 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 deleted file mode 100644 index d27d163b9102..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_pools_operations.py +++ /dev/null @@ -1,988 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._cluster_pools_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_tags_request, - build_upgrade_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ClusterPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s - :attr:`cluster_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, resource_group_name: str, cluster_pool_name: str, **kwargs: Any) -> _models.ClusterPool: - """Gets 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 - :return: ClusterPool or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.ClusterPool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterPool] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ClusterPool", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool: Union[_models.ClusterPool, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_pool, (IOBase, bytes)): - _content = cluster_pool - else: - _json = self._serialize.body(cluster_pool, "ClusterPool") - - _request = build_create_or_update_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - 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 = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool: _models.ClusterPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterPool]: - """Creates or updates 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: The Cluster Pool to create. Required. - :type cluster_pool: ~azure.mgmt.hdinsightcontainers.models.ClusterPool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_create_or_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterPool]: - """Creates or updates 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: The Cluster Pool to create. Required. - :type cluster_pool: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_create_or_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool: Union[_models.ClusterPool, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterPool]: - """Creates or updates 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: The Cluster Pool to create. Is either a ClusterPool type or a IO[bytes] - type. Required. - :type cluster_pool: ~azure.mgmt.hdinsightcontainers.models.ClusterPool or IO[bytes] - :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._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_pool=cluster_pool, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClusterPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ClusterPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ClusterPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_tags_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool_tags: Union[_models.TagsObject, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_pool_tags, (IOBase, bytes)): - _content = cluster_pool_tags - else: - _json = self._serialize.body(cluster_pool_tags, "TagsObject") - - _request = build_update_tags_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update_tags( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool_tags: _models.TagsObject, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterPool]: - """Updates an existing Cluster Pool Tags. - - :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_tags: Parameters supplied to update tags. Required. - :type cluster_pool_tags: ~azure.mgmt.hdinsightcontainers.models.TagsObject - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_update_tags( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool_tags: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterPool]: - """Updates an existing Cluster Pool Tags. - - :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_tags: Parameters supplied to update tags. Required. - :type cluster_pool_tags: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_update_tags( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool_tags: Union[_models.TagsObject, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterPool]: - """Updates an existing Cluster Pool Tags. - - :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_tags: Parameters supplied to update tags. Is either a TagsObject type or a - IO[bytes] type. Required. - :type cluster_pool_tags: ~azure.mgmt.hdinsightcontainers.models.TagsObject or IO[bytes] - :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._update_tags_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_pool_tags=cluster_pool_tags, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClusterPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ClusterPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ClusterPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, cluster_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes 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 - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ClusterPool"]: - """Gets the list of Cluster Pools within a Subscription. - - :return: An iterator like instance of either ClusterPool or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterPool] - :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.ClusterPoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterPoolListResult", 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) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ClusterPool"]: - """Lists the HDInsight cluster pools under a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either ClusterPool or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterPool] - :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.ClusterPoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterPoolListResult", 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) - - async def _upgrade_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool_upgrade_request: Union[_models.ClusterPoolUpgrade, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[AsyncIterator[bytes]] = 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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @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 - :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[bytes], - *, - 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[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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[bytes]], - **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[bytes] type. Required. - :type cluster_pool_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgrade - or IO[bytes] - :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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClusterPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.ClusterPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ClusterPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_upgrade_histories_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_upgrade_histories_operations.py deleted file mode 100644 index 30cd762dcb9f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_cluster_upgrade_histories_operations.py +++ /dev/null @@ -1,145 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.rest import AsyncHttpResponse, 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 ...operations._cluster_upgrade_histories_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ClusterUpgradeHistoriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s - :attr:`cluster_upgrade_histories` 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.ClusterUpgradeHistory"]: - """Returns a list of upgrade history. - - :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 - :return: An iterator like instance of either ClusterUpgradeHistory or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistory] - :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.ClusterUpgradeHistoryListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterUpgradeHistoryListResult", 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) 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 deleted file mode 100644 index 0560307a98c9..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_clusters_operations.py +++ /dev/null @@ -1,1631 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._clusters_operations import ( - build_create_request, - build_delete_request, - build_get_instance_view_request, - build_get_request, - build_list_by_cluster_pool_name_request, - build_list_instance_views_request, - build_list_service_configs_request, - build_resize_request, - build_update_request, - build_upgrade_manual_rollback_request, - build_upgrade_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ClustersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s - :attr:`clusters` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cluster_pool_name( - self, resource_group_name: str, cluster_pool_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Cluster"]: - """Lists the HDInsight cluster pools under a resource group. - - :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 - :return: An iterator like instance of either Cluster or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.Cluster] - :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.ClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_cluster_pool_name_request( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterListResult", 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) - - async def _upgrade_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_upgrade_request: Union[_models.ClusterUpgrade, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[AsyncIterator[bytes]] = 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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @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 - :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[bytes], - *, - 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[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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[bytes]], - **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[bytes] type. Required. - :type cluster_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgrade or - IO[bytes] - :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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _upgrade_manual_rollback_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_rollback_upgrade_request: Union[_models.ClusterUpgradeRollback, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_rollback_upgrade_request, (IOBase, bytes)): - _content = cluster_rollback_upgrade_request - else: - _json = self._serialize.body(cluster_rollback_upgrade_request, "ClusterUpgradeRollback") - - _request = build_upgrade_manual_rollback_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_upgrade_manual_rollback( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_rollback_upgrade_request: _models.ClusterUpgradeRollback, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Manual rollback upgrade for 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_rollback_upgrade_request: Manual rollback upgrade for a cluster. Required. - :type cluster_rollback_upgrade_request: - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeRollback - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_manual_rollback( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_rollback_upgrade_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Manual rollback upgrade for 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_rollback_upgrade_request: Manual rollback upgrade for a cluster. Required. - :type cluster_rollback_upgrade_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_manual_rollback( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_rollback_upgrade_request: Union[_models.ClusterUpgradeRollback, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Manual rollback upgrade for 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_rollback_upgrade_request: Manual rollback upgrade for a cluster. Is either a - ClusterUpgradeRollback type or a IO[bytes] type. Required. - :type cluster_rollback_upgrade_request: - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeRollback or IO[bytes] - :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_manual_rollback_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - cluster_rollback_upgrade_request=cluster_rollback_upgrade_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _resize_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_resize_request: Union[_models.ClusterResizeData, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_resize_request, (IOBase, bytes)): - _content = cluster_resize_request - else: - _json = self._serialize.body(cluster_resize_request, "ClusterResizeData") - - _request = build_resize_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_resize( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_resize_request: _models.ClusterResizeData, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Resize an existing 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_resize_request: Resize a cluster. Required. - :type cluster_resize_request: ~azure.mgmt.hdinsightcontainers.models.ClusterResizeData - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_resize( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_resize_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Resize an existing 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_resize_request: Resize a cluster. Required. - :type cluster_resize_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_resize( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_resize_request: Union[_models.ClusterResizeData, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Resize an existing 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_resize_request: Resize a cluster. Is either a ClusterResizeData type or a - IO[bytes] type. Required. - :type cluster_resize_request: ~azure.mgmt.hdinsightcontainers.models.ClusterResizeData or - IO[bytes] - :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._resize_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - cluster_resize_request=cluster_resize_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> _models.Cluster: - """Gets a HDInsight 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 - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - _request = build_get_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - hd_insight_cluster: Union[_models.Cluster, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(hd_insight_cluster, (IOBase, bytes)): - _content = hd_insight_cluster - else: - _json = self._serialize.body(hd_insight_cluster, "Cluster") - - _request = build_create_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - 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 = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - hd_insight_cluster: _models.Cluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Creates 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 hd_insight_cluster: The cluster to create. Required. - :type hd_insight_cluster: ~azure.mgmt.hdinsightcontainers.models.Cluster - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_create( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - hd_insight_cluster: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Creates 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 hd_insight_cluster: The cluster to create. Required. - :type hd_insight_cluster: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_create( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - hd_insight_cluster: Union[_models.Cluster, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Creates 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 hd_insight_cluster: The cluster to create. Is either a Cluster type or a IO[bytes] type. - Required. - :type hd_insight_cluster: ~azure.mgmt.hdinsightcontainers.models.Cluster or IO[bytes] - :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._create_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - hd_insight_cluster=hd_insight_cluster, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_patch_request: Union[_models.ClusterPatch, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_patch_request, (IOBase, bytes)): - _content = cluster_patch_request - else: - _json = self._serialize.body(cluster_patch_request, "ClusterPatch") - - _request = build_update_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_patch_request: _models.ClusterPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Updates an existing 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_patch_request: Patch a cluster. Required. - :type cluster_patch_request: ~azure.mgmt.hdinsightcontainers.models.ClusterPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_patch_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Updates an existing 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_patch_request: Patch a cluster. Required. - :type cluster_patch_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_patch_request: Union[_models.ClusterPatch, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Updates an existing 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_patch_request: Patch a cluster. Is either a ClusterPatch type or a IO[bytes] - type. Required. - :type cluster_patch_request: ~azure.mgmt.hdinsightcontainers.models.ClusterPatch or IO[bytes] - :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._update_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - cluster_patch_request=cluster_patch_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes 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 - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_service_configs( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ServiceConfigResult"]: - """Lists the config dump of all services running in 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 - :return: An iterator like instance of either ServiceConfigResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ServiceConfigResult] - :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.ServiceConfigListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_service_configs_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, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServiceConfigListResult", 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) - - @distributed_trace - def list_instance_views( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ClusterInstanceViewResult"]: - """Lists the lists of instance views. - - :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 - :return: An iterator like instance of either ClusterInstanceViewResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewResult] - :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.ClusterInstanceViewsResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_instance_views_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, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterInstanceViewsResult", 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) - - @distributed_trace_async - async def get_instance_view( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> _models.ClusterInstanceViewResult: - """Gets the status of a cluster instance. - - :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 - :return: ClusterInstanceViewResult or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterInstanceViewResult] = kwargs.pop("cls", None) - - _request = build_get_instance_view_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ClusterInstanceViewResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_locations_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_locations_operations.py deleted file mode 100644 index 40753db7444a..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_locations_operations.py +++ /dev/null @@ -1,175 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._locations_operations import build_check_name_availability_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class LocationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s - :attr:`locations` 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") - - @overload - async def check_name_availability( - self, - location: str, - name_availability_parameters: _models.NameAvailabilityParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.NameAvailabilityResult: - """Check the availability of the resource name. - - :param location: The name of the Azure region. Required. - :type location: str - :param name_availability_parameters: The name and type of the resource. Required. - :type name_availability_parameters: - ~azure.mgmt.hdinsightcontainers.models.NameAvailabilityParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.NameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def check_name_availability( - self, - location: str, - name_availability_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.NameAvailabilityResult: - """Check the availability of the resource name. - - :param location: The name of the Azure region. Required. - :type location: str - :param name_availability_parameters: The name and type of the resource. Required. - :type name_availability_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: NameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.NameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def check_name_availability( - self, - location: str, - name_availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], - **kwargs: Any - ) -> _models.NameAvailabilityResult: - """Check the availability of the resource name. - - :param location: The name of the Azure region. Required. - :type location: str - :param name_availability_parameters: The name and type of the resource. Is either a - NameAvailabilityParameters type or a IO[bytes] type. Required. - :type name_availability_parameters: - ~azure.mgmt.hdinsightcontainers.models.NameAvailabilityParameters or IO[bytes] - :return: NameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.NameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NameAvailabilityResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(name_availability_parameters, (IOBase, bytes)): - _content = name_availability_parameters - else: - _json = self._serialize.body(name_availability_parameters, "NameAvailabilityParameters") - - _request = build_check_name_availability_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NameAvailabilityResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_operations.py deleted file mode 100644 index 171587f57907..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_operations.py +++ /dev/null @@ -1,131 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.rest import AsyncHttpResponse, 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 ...operations._operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.aio.HDInsightContainersMgmtClient`'s - :attr:`operations` 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, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """Returns list of operations. - - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hdinsightcontainers.models.Operation] - :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.OperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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( - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", 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) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_patch.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ 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 deleted file mode 100644 index 076a62577a18..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/__init__.py +++ /dev/null @@ -1,411 +0,0 @@ -# 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 ._models_py3 import AksClusterProfile -from ._models_py3 import AksClusterProfileAksClusterAgentPoolIdentityProfile -from ._models_py3 import AuthorizationProfile -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 ClusterAksPatchUpgradeHistoryProperties -from ._models_py3 import ClusterAvailableInPlaceUpgradeProperties -from ._models_py3 import ClusterAvailableUpgrade -from ._models_py3 import ClusterAvailableUpgradeAksPatchUpgradeProperties -from ._models_py3 import ClusterAvailableUpgradeHotfixUpgradeProperties -from ._models_py3 import ClusterAvailableUpgradeList -from ._models_py3 import ClusterAvailableUpgradePatchVersionUpgradeProperties -from ._models_py3 import ClusterAvailableUpgradeProperties -from ._models_py3 import ClusterComponentsItem -from ._models_py3 import ClusterConfigFile -from ._models_py3 import ClusterHotfixUpgradeHistoryProperties -from ._models_py3 import ClusterHotfixUpgradeProperties -from ._models_py3 import ClusterHotfixUpgradeRollbackHistoryProperties -from ._models_py3 import ClusterInPlaceUpgradeHistoryProperties -from ._models_py3 import ClusterInPlaceUpgradeProperties -from ._models_py3 import ClusterInstanceViewProperties -from ._models_py3 import ClusterInstanceViewPropertiesStatus -from ._models_py3 import ClusterInstanceViewResult -from ._models_py3 import ClusterInstanceViewResultProperties -from ._models_py3 import ClusterInstanceViewStatus -from ._models_py3 import ClusterInstanceViewsResult -from ._models_py3 import ClusterJob -from ._models_py3 import ClusterJobList -from ._models_py3 import ClusterJobProperties -from ._models_py3 import ClusterLibrary -from ._models_py3 import ClusterLibraryList -from ._models_py3 import ClusterLibraryManagementOperation -from ._models_py3 import ClusterLibraryManagementOperationProperties -from ._models_py3 import ClusterLibraryProperties -from ._models_py3 import ClusterListResult -from ._models_py3 import ClusterLogAnalyticsApplicationLogs -from ._models_py3 import ClusterLogAnalyticsProfile -from ._models_py3 import ClusterPatch -from ._models_py3 import ClusterPatchProperties -from ._models_py3 import ClusterPatchVersionUpgradeHistoryProperties -from ._models_py3 import ClusterPatchVersionUpgradeProperties -from ._models_py3 import ClusterPatchVersionUpgradeRollbackHistoryProperties -from ._models_py3 import ClusterPool -from ._models_py3 import ClusterPoolAKSPatchVersionUpgradeProperties -from ._models_py3 import ClusterPoolAksPatchUpgradeHistoryProperties -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 ClusterPoolNodeOsUpgradeHistoryProperties -from ._models_py3 import ClusterPoolProfile -from ._models_py3 import ClusterPoolResourceProperties -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 ClusterPoolUpgradeHistory -from ._models_py3 import ClusterPoolUpgradeHistoryListResult -from ._models_py3 import ClusterPoolUpgradeHistoryProperties -from ._models_py3 import ClusterPoolUpgradeProperties -from ._models_py3 import ClusterPoolVersion -from ._models_py3 import ClusterPoolVersionProperties -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 ClusterResizeProperties -from ._models_py3 import ClusterResourceProperties -from ._models_py3 import ClusterServiceConfig -from ._models_py3 import ClusterServiceConfigsProfile -from ._models_py3 import ClusterUpgrade -from ._models_py3 import ClusterUpgradeHistory -from ._models_py3 import ClusterUpgradeHistoryListResult -from ._models_py3 import ClusterUpgradeHistoryProperties -from ._models_py3 import ClusterUpgradeProperties -from ._models_py3 import ClusterUpgradeRollback -from ._models_py3 import ClusterUpgradeRollbackProperties -from ._models_py3 import ClusterVersion -from ._models_py3 import ClusterVersionProperties -from ._models_py3 import ClusterVersionsListResult -from ._models_py3 import ComparisonRule -from ._models_py3 import ComputeProfile -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 IpTag -from ._models_py3 import KafkaConnectivityEndpoints -from ._models_py3 import KafkaProfile -from ._models_py3 import LoadBasedConfig -from ._models_py3 import ManagedIdentityProfile -from ._models_py3 import ManagedIdentitySpec -from ._models_py3 import MavenLibraryProperties -from ._models_py3 import NameAvailabilityParameters -from ._models_py3 import NameAvailabilityResult -from ._models_py3 import NodeProfile -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationListResult -from ._models_py3 import ProxyResource -from ._models_py3 import PyPiLibraryProperties -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 -from ._models_py3 import ScheduleBasedConfig -from ._models_py3 import ScriptActionProfile -from ._models_py3 import SecretReference -from ._models_py3 import SecretsProfile -from ._models_py3 import ServiceConfigListResult -from ._models_py3 import ServiceConfigListResultProperties -from ._models_py3 import ServiceConfigListResultValueEntity -from ._models_py3 import ServiceConfigResult -from ._models_py3 import ServiceConfigResultProperties -from ._models_py3 import ServiceStatus -from ._models_py3 import SparkMetastoreSpec -from ._models_py3 import SparkProfile -from ._models_py3 import SparkUserPlugin -from ._models_py3 import SparkUserPlugins -from ._models_py3 import SshConnectivityEndpoint -from ._models_py3 import SshProfile -from ._models_py3 import SystemData -from ._models_py3 import TagsObject -from ._models_py3 import TrackedResource -from ._models_py3 import TrinoCoordinator -from ._models_py3 import TrinoDebugConfig -from ._models_py3 import TrinoProfile -from ._models_py3 import TrinoTelemetryConfig -from ._models_py3 import TrinoUserPlugin -from ._models_py3 import TrinoUserPlugins -from ._models_py3 import TrinoUserTelemetry -from ._models_py3 import TrinoWorker -from ._models_py3 import UpdatableClusterProfile -from ._models_py3 import WebConnectivityEndpoint - -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 Category -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 ClusterPoolUpgradeHistoryType -from ._hd_insight_containers_mgmt_client_enums import ClusterPoolUpgradeHistoryUpgradeResultType -from ._hd_insight_containers_mgmt_client_enums import ClusterPoolUpgradeType -from ._hd_insight_containers_mgmt_client_enums import ClusterUpgradeHistorySeverityType -from ._hd_insight_containers_mgmt_client_enums import ClusterUpgradeHistoryType -from ._hd_insight_containers_mgmt_client_enums import ClusterUpgradeHistoryUpgradeResultType -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 LibraryManagementAction -from ._hd_insight_containers_mgmt_client_enums import ManagedIdentityType -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 Status -from ._hd_insight_containers_mgmt_client_enums import Type -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 - -__all__ = [ - "AksClusterProfile", - "AksClusterProfileAksClusterAgentPoolIdentityProfile", - "AuthorizationProfile", - "AutoscaleProfile", - "CatalogOptions", - "Cluster", - "ClusterAKSPatchVersionUpgradeProperties", - "ClusterAccessProfile", - "ClusterAksPatchUpgradeHistoryProperties", - "ClusterAvailableInPlaceUpgradeProperties", - "ClusterAvailableUpgrade", - "ClusterAvailableUpgradeAksPatchUpgradeProperties", - "ClusterAvailableUpgradeHotfixUpgradeProperties", - "ClusterAvailableUpgradeList", - "ClusterAvailableUpgradePatchVersionUpgradeProperties", - "ClusterAvailableUpgradeProperties", - "ClusterComponentsItem", - "ClusterConfigFile", - "ClusterHotfixUpgradeHistoryProperties", - "ClusterHotfixUpgradeProperties", - "ClusterHotfixUpgradeRollbackHistoryProperties", - "ClusterInPlaceUpgradeHistoryProperties", - "ClusterInPlaceUpgradeProperties", - "ClusterInstanceViewProperties", - "ClusterInstanceViewPropertiesStatus", - "ClusterInstanceViewResult", - "ClusterInstanceViewResultProperties", - "ClusterInstanceViewStatus", - "ClusterInstanceViewsResult", - "ClusterJob", - "ClusterJobList", - "ClusterJobProperties", - "ClusterLibrary", - "ClusterLibraryList", - "ClusterLibraryManagementOperation", - "ClusterLibraryManagementOperationProperties", - "ClusterLibraryProperties", - "ClusterListResult", - "ClusterLogAnalyticsApplicationLogs", - "ClusterLogAnalyticsProfile", - "ClusterPatch", - "ClusterPatchProperties", - "ClusterPatchVersionUpgradeHistoryProperties", - "ClusterPatchVersionUpgradeProperties", - "ClusterPatchVersionUpgradeRollbackHistoryProperties", - "ClusterPool", - "ClusterPoolAKSPatchVersionUpgradeProperties", - "ClusterPoolAksPatchUpgradeHistoryProperties", - "ClusterPoolAvailableUpgrade", - "ClusterPoolAvailableUpgradeAksPatchUpgradeProperties", - "ClusterPoolAvailableUpgradeList", - "ClusterPoolAvailableUpgradeNodeOsUpgradeProperties", - "ClusterPoolAvailableUpgradeProperties", - "ClusterPoolComputeProfile", - "ClusterPoolListResult", - "ClusterPoolLogAnalyticsProfile", - "ClusterPoolNetworkProfile", - "ClusterPoolNodeOsImageUpdateProperties", - "ClusterPoolNodeOsUpgradeHistoryProperties", - "ClusterPoolProfile", - "ClusterPoolResourceProperties", - "ClusterPoolResourcePropertiesAksClusterProfile", - "ClusterPoolResourcePropertiesClusterPoolProfile", - "ClusterPoolResourcePropertiesComputeProfile", - "ClusterPoolResourcePropertiesLogAnalyticsProfile", - "ClusterPoolResourcePropertiesNetworkProfile", - "ClusterPoolUpgrade", - "ClusterPoolUpgradeHistory", - "ClusterPoolUpgradeHistoryListResult", - "ClusterPoolUpgradeHistoryProperties", - "ClusterPoolUpgradeProperties", - "ClusterPoolVersion", - "ClusterPoolVersionProperties", - "ClusterPoolVersionsListResult", - "ClusterProfile", - "ClusterPrometheusProfile", - "ClusterRangerPluginProfile", - "ClusterResizeData", - "ClusterResizeProperties", - "ClusterResourceProperties", - "ClusterServiceConfig", - "ClusterServiceConfigsProfile", - "ClusterUpgrade", - "ClusterUpgradeHistory", - "ClusterUpgradeHistoryListResult", - "ClusterUpgradeHistoryProperties", - "ClusterUpgradeProperties", - "ClusterUpgradeRollback", - "ClusterUpgradeRollbackProperties", - "ClusterVersion", - "ClusterVersionProperties", - "ClusterVersionsListResult", - "ComparisonRule", - "ComputeProfile", - "ComputeResourceDefinition", - "ConnectivityProfile", - "ConnectivityProfileWeb", - "DiskStorageProfile", - "ErrorAdditionalInfo", - "ErrorDetail", - "ErrorResponse", - "FlinkCatalogOptions", - "FlinkHiveCatalogOption", - "FlinkJobProfile", - "FlinkJobProperties", - "FlinkProfile", - "FlinkStorageProfile", - "HiveCatalogOption", - "IdentityProfile", - "IpTag", - "KafkaConnectivityEndpoints", - "KafkaProfile", - "LoadBasedConfig", - "ManagedIdentityProfile", - "ManagedIdentitySpec", - "MavenLibraryProperties", - "NameAvailabilityParameters", - "NameAvailabilityResult", - "NodeProfile", - "Operation", - "OperationDisplay", - "OperationListResult", - "ProxyResource", - "PyPiLibraryProperties", - "RangerAdminSpec", - "RangerAdminSpecDatabase", - "RangerAuditSpec", - "RangerProfile", - "RangerUsersyncSpec", - "Resource", - "ScalingRule", - "Schedule", - "ScheduleBasedConfig", - "ScriptActionProfile", - "SecretReference", - "SecretsProfile", - "ServiceConfigListResult", - "ServiceConfigListResultProperties", - "ServiceConfigListResultValueEntity", - "ServiceConfigResult", - "ServiceConfigResultProperties", - "ServiceStatus", - "SparkMetastoreSpec", - "SparkProfile", - "SparkUserPlugin", - "SparkUserPlugins", - "SshConnectivityEndpoint", - "SshProfile", - "SystemData", - "TagsObject", - "TrackedResource", - "TrinoCoordinator", - "TrinoDebugConfig", - "TrinoProfile", - "TrinoTelemetryConfig", - "TrinoUserPlugin", - "TrinoUserPlugins", - "TrinoUserTelemetry", - "TrinoWorker", - "UpdatableClusterProfile", - "WebConnectivityEndpoint", - "Action", - "ActionType", - "AutoscaleType", - "Category", - "ClusterAvailableUpgradeType", - "ClusterPoolAvailableUpgradeType", - "ClusterPoolUpgradeHistoryType", - "ClusterPoolUpgradeHistoryUpgradeResultType", - "ClusterPoolUpgradeType", - "ClusterUpgradeHistorySeverityType", - "ClusterUpgradeHistoryType", - "ClusterUpgradeHistoryUpgradeResultType", - "ClusterUpgradeType", - "ComparisonOperator", - "ContentEncoding", - "CreatedByType", - "CurrentClusterAksVersionStatus", - "CurrentClusterPoolAksVersionStatus", - "DataDiskType", - "DbConnectionAuthenticationMode", - "DeploymentMode", - "JobType", - "KeyVaultObjectType", - "LibraryManagementAction", - "ManagedIdentityType", - "MetastoreDbConnectionAuthenticationMode", - "Origin", - "OutboundType", - "ProvisioningStatus", - "RangerUsersyncMode", - "ScaleActionType", - "ScheduleDay", - "Severity", - "Status", - "Type", - "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 deleted file mode 100644 index 6804c4bc47d5..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_hd_insight_containers_mgmt_client_enums.py +++ /dev/null @@ -1,324 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class Action(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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. - """ - - NEW = "NEW" - UPDATE = "UPDATE" - STATELESS_UPDATE = "STATELESS_UPDATE" - STOP = "STOP" - START = "START" - CANCEL = "CANCEL" - SAVEPOINT = "SAVEPOINT" - LIST_SAVEPOINT = "LIST_SAVEPOINT" - DELETE = "DELETE" - LAST_STATE_UPDATE = "LAST_STATE_UPDATE" - RE_LAUNCH = "RE_LAUNCH" - - -class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" - - INTERNAL = "Internal" - - -class AutoscaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """User to specify which type of Autoscale to be implemented - Scheduled Based or Load Based.""" - - SCHEDULE_BASED = "ScheduleBased" - LOAD_BASED = "LoadBased" - - -class Category(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category.""" - - CUSTOM = "custom" - PREDEFINED = "predefined" - - -class ClusterAvailableUpgradeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of upgrade.""" - - AKS_PATCH_UPGRADE = "AKSPatchUpgrade" - HOTFIX_UPGRADE = "HotfixUpgrade" - PATCH_VERSION_UPGRADE = "PatchVersionUpgrade" - - -class ClusterPoolAvailableUpgradeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of upgrade.""" - - AKS_PATCH_UPGRADE = "AKSPatchUpgrade" - NODE_OS_UPGRADE = "NodeOsUpgrade" - - -class ClusterPoolUpgradeHistoryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of upgrade.""" - - AKS_PATCH_UPGRADE = "AKSPatchUpgrade" - NODE_OS_UPGRADE = "NodeOsUpgrade" - - -class ClusterPoolUpgradeHistoryUpgradeResultType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Result of this upgrade.""" - - SUCCEED = "Succeed" - FAILED = "Failed" - - -class ClusterPoolUpgradeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of upgrade.""" - - AKS_PATCH_UPGRADE = "AKSPatchUpgrade" - NODE_OS_UPGRADE = "NodeOsUpgrade" - - -class ClusterUpgradeHistorySeverityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Severity of this upgrade.""" - - LOW = "low" - MEDIUM = "medium" - HIGH = "high" - CRITICAL = "critical" - - -class ClusterUpgradeHistoryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of upgrade.""" - - AKS_PATCH_UPGRADE = "AKSPatchUpgrade" - HOTFIX_UPGRADE = "HotfixUpgrade" - HOTFIX_UPGRADE_ROLLBACK = "HotfixUpgradeRollback" - PATCH_VERSION_UPGRADE = "PatchVersionUpgrade" - PATCH_VERSION_UPGRADE_ROLLBACK = "PatchVersionUpgradeRollback" - - -class ClusterUpgradeHistoryUpgradeResultType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Result of this upgrade.""" - - SUCCEED = "Succeed" - FAILED = "Failed" - - -class ClusterUpgradeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of upgrade.""" - - AKS_PATCH_UPGRADE = "AKSPatchUpgrade" - HOTFIX_UPGRADE = "HotfixUpgrade" - PATCH_VERSION_UPGRADE = "PatchVersionUpgrade" - - -class ComparisonOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The comparison operator.""" - - GREATER_THAN = "greaterThan" - GREATER_THAN_OR_EQUAL = "greaterThanOrEqual" - LESS_THAN = "lessThan" - LESS_THAN_OR_EQUAL = "lessThanOrEqual" - - -class ContentEncoding(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This property indicates if the content is encoded and is case-insensitive. Please set the value - to base64 if the content is base64 encoded. Set it to none or skip it if the content is plain - text. - """ - - BASE64 = "Base64" - NONE = "None" - - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - 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.""" - - FLINK_JOB = "FlinkJob" - - -class KeyVaultObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of key vault object: secret, key or certificate.""" - - KEY = "Key" - SECRET = "Secret" - CERTIFICATE = "Certificate" - - -class LibraryManagementAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The library management action.""" - - INSTALL = "Install" - UNINSTALL = "Uninstall" - - -class ManagedIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of managed identity.""" - - CLUSTER = "cluster" - USER = "user" - INTERNAL = "internal" - - -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". - """ - - USER = "user" - SYSTEM = "system" - 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.""" - - ACCEPTED = "Accepted" - SUCCEEDED = "Succeeded" - CANCELED = "Canceled" - 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.""" - - SCALEUP = "scaleup" - SCALEDOWN = "scaledown" - - -class ScheduleDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ScheduleDay.""" - - SUNDAY = "Sunday" - MONDAY = "Monday" - TUESDAY = "Tuesday" - WEDNESDAY = "Wednesday" - 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 Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the library.""" - - INSTALLING = "INSTALLING" - INSTALLED = "INSTALLED" - INSTALL_FAILED = "INSTALL_FAILED" - UNINSTALLING = "UNINSTALLING" - UNINSTALL_FAILED = "UNINSTALL_FAILED" - - -class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the library.""" - - PYPI = "pypi" - MAVEN = "maven" - - -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, UPDATE, 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 deleted file mode 100644 index 16507aa59eec..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_models_py3.py +++ /dev/null @@ -1,7690 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union - -from .. import _serialization - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models - - -class AksClusterProfile(_serialization.Model): - """Properties of the cluster pool underlying AKS cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar aks_cluster_resource_id: ARM Resource ID of the AKS cluster. - :vartype aks_cluster_resource_id: str - :ivar aks_cluster_agent_pool_identity_profile: Identity properties of the AKS cluster agentpool - MSI. - :vartype aks_cluster_agent_pool_identity_profile: - ~azure.mgmt.hdinsightcontainers.models.AksClusterProfileAksClusterAgentPoolIdentityProfile - :ivar aks_version: AKS control plane and default node pool version of this ClusterPool. - :vartype aks_version: str - """ - - _validation = { - "aks_version": {"readonly": True}, - } - - _attribute_map = { - "aks_cluster_resource_id": {"key": "aksClusterResourceId", "type": "str"}, - "aks_cluster_agent_pool_identity_profile": { - "key": "aksClusterAgentPoolIdentityProfile", - "type": "AksClusterProfileAksClusterAgentPoolIdentityProfile", - }, - "aks_version": {"key": "aksVersion", "type": "str"}, - } - - def __init__( - self, - *, - aks_cluster_resource_id: Optional[str] = None, - aks_cluster_agent_pool_identity_profile: Optional[ - "_models.AksClusterProfileAksClusterAgentPoolIdentityProfile" - ] = None, - **kwargs: Any - ) -> None: - """ - :keyword aks_cluster_resource_id: ARM Resource ID of the AKS cluster. - :paramtype aks_cluster_resource_id: str - :keyword aks_cluster_agent_pool_identity_profile: Identity properties of the AKS cluster - agentpool MSI. - :paramtype aks_cluster_agent_pool_identity_profile: - ~azure.mgmt.hdinsightcontainers.models.AksClusterProfileAksClusterAgentPoolIdentityProfile - """ - super().__init__(**kwargs) - self.aks_cluster_resource_id = aks_cluster_resource_id - self.aks_cluster_agent_pool_identity_profile = aks_cluster_agent_pool_identity_profile - self.aks_version = None - - -class IdentityProfile(_serialization.Model): - """Identity Profile with details of an MSI. - - All required parameters must be populated in order to send to server. - - :ivar msi_resource_id: ResourceId of the MSI. Required. - :vartype msi_resource_id: str - :ivar msi_client_id: ClientId of the MSI. Required. - :vartype msi_client_id: str - :ivar msi_object_id: ObjectId of the MSI. Required. - :vartype msi_object_id: str - """ - - _validation = { - "msi_resource_id": {"required": True}, - "msi_client_id": { - "required": True, - "pattern": r"^[{(]?[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}[)}]?$", - }, - "msi_object_id": { - "required": True, - "pattern": r"^[{(]?[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}[)}]?$", - }, - } - - _attribute_map = { - "msi_resource_id": {"key": "msiResourceId", "type": "str"}, - "msi_client_id": {"key": "msiClientId", "type": "str"}, - "msi_object_id": {"key": "msiObjectId", "type": "str"}, - } - - def __init__(self, *, msi_resource_id: str, msi_client_id: str, msi_object_id: str, **kwargs: Any) -> None: - """ - :keyword msi_resource_id: ResourceId of the MSI. Required. - :paramtype msi_resource_id: str - :keyword msi_client_id: ClientId of the MSI. Required. - :paramtype msi_client_id: str - :keyword msi_object_id: ObjectId of the MSI. Required. - :paramtype msi_object_id: str - """ - super().__init__(**kwargs) - self.msi_resource_id = msi_resource_id - self.msi_client_id = msi_client_id - self.msi_object_id = msi_object_id - - -class AksClusterProfileAksClusterAgentPoolIdentityProfile(IdentityProfile): # pylint: disable=name-too-long - """Identity properties of the AKS cluster agentpool MSI. - - All required parameters must be populated in order to send to server. - - :ivar msi_resource_id: ResourceId of the MSI. Required. - :vartype msi_resource_id: str - :ivar msi_client_id: ClientId of the MSI. Required. - :vartype msi_client_id: str - :ivar msi_object_id: ObjectId of the MSI. Required. - :vartype msi_object_id: str - """ - - -class AuthorizationProfile(_serialization.Model): - """Authorization profile with details of AAD user Ids and group Ids authorized for data plane - access. - - :ivar user_ids: AAD user Ids authorized for data plane access. - :vartype user_ids: list[str] - :ivar group_ids: AAD group Ids authorized for data plane access. - :vartype group_ids: list[str] - """ - - _attribute_map = { - "user_ids": {"key": "userIds", "type": "[str]"}, - "group_ids": {"key": "groupIds", "type": "[str]"}, - } - - def __init__( - self, *, user_ids: Optional[List[str]] = None, group_ids: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword user_ids: AAD user Ids authorized for data plane access. - :paramtype user_ids: list[str] - :keyword group_ids: AAD group Ids authorized for data plane access. - :paramtype group_ids: list[str] - """ - super().__init__(**kwargs) - self.user_ids = user_ids - self.group_ids = group_ids - - -class AutoscaleProfile(_serialization.Model): - """This is the Autoscale profile for the cluster. This will allow customer to create cluster - enabled with Autoscale. - - All required parameters must be populated in order to send to server. - - :ivar enabled: This indicates whether auto scale is enabled on HDInsight on AKS cluster. - Required. - :vartype enabled: bool - :ivar graceful_decommission_timeout: This property is for graceful decommission timeout; It has - a default setting of 3600 seconds before forced shutdown takes place. This is the maximal time - to wait for running containers and applications to complete before transition a DECOMMISSIONING - node into DECOMMISSIONED. The default value is 3600 seconds. Negative value (like -1) is - handled as infinite timeout. - :vartype graceful_decommission_timeout: int - :ivar autoscale_type: User to specify which type of Autoscale to be implemented - Scheduled - Based or Load Based. Known values are: "ScheduleBased" and "LoadBased". - :vartype autoscale_type: str or ~azure.mgmt.hdinsightcontainers.models.AutoscaleType - :ivar schedule_based_config: Profiles of schedule based Autoscale. - :vartype schedule_based_config: ~azure.mgmt.hdinsightcontainers.models.ScheduleBasedConfig - :ivar load_based_config: Profiles of load based Autoscale. - :vartype load_based_config: ~azure.mgmt.hdinsightcontainers.models.LoadBasedConfig - """ - - _validation = { - "enabled": {"required": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "graceful_decommission_timeout": {"key": "gracefulDecommissionTimeout", "type": "int"}, - "autoscale_type": {"key": "autoscaleType", "type": "str"}, - "schedule_based_config": {"key": "scheduleBasedConfig", "type": "ScheduleBasedConfig"}, - "load_based_config": {"key": "loadBasedConfig", "type": "LoadBasedConfig"}, - } - - def __init__( - self, - *, - enabled: bool, - graceful_decommission_timeout: Optional[int] = None, - autoscale_type: Optional[Union[str, "_models.AutoscaleType"]] = None, - schedule_based_config: Optional["_models.ScheduleBasedConfig"] = None, - load_based_config: Optional["_models.LoadBasedConfig"] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: This indicates whether auto scale is enabled on HDInsight on AKS cluster. - Required. - :paramtype enabled: bool - :keyword graceful_decommission_timeout: This property is for graceful decommission timeout; It - has a default setting of 3600 seconds before forced shutdown takes place. This is the maximal - time to wait for running containers and applications to complete before transition a - DECOMMISSIONING node into DECOMMISSIONED. The default value is 3600 seconds. Negative value - (like -1) is handled as infinite timeout. - :paramtype graceful_decommission_timeout: int - :keyword autoscale_type: User to specify which type of Autoscale to be implemented - Scheduled - Based or Load Based. Known values are: "ScheduleBased" and "LoadBased". - :paramtype autoscale_type: str or ~azure.mgmt.hdinsightcontainers.models.AutoscaleType - :keyword schedule_based_config: Profiles of schedule based Autoscale. - :paramtype schedule_based_config: ~azure.mgmt.hdinsightcontainers.models.ScheduleBasedConfig - :keyword load_based_config: Profiles of load based Autoscale. - :paramtype load_based_config: ~azure.mgmt.hdinsightcontainers.models.LoadBasedConfig - """ - super().__init__(**kwargs) - self.enabled = enabled - self.graceful_decommission_timeout = graceful_decommission_timeout - self.autoscale_type = autoscale_type - self.schedule_based_config = schedule_based_config - self.load_based_config = load_based_config - - -class CatalogOptions(_serialization.Model): - """Trino cluster catalog options. - - :ivar hive: hive catalog options. - :vartype hive: list[~azure.mgmt.hdinsightcontainers.models.HiveCatalogOption] - """ - - _attribute_map = { - "hive": {"key": "hive", "type": "[HiveCatalogOption]"}, - } - - def __init__(self, *, hive: Optional[List["_models.HiveCatalogOption"]] = None, **kwargs: Any) -> None: - """ - :keyword hive: hive catalog options. - :paramtype hive: list[~azure.mgmt.hdinsightcontainers.models.HiveCatalogOption] - """ - super().__init__(**kwargs) - self.hive = hive - - -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - -class Cluster(TrackedResource): - """The 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 server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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. - :vartype location: str - :ivar properties: Gets or sets the properties. Define cluster specific properties. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterResourceProperties - """ - - _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"}, - "properties": {"key": "properties", "type": "ClusterResourceProperties"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.ClusterResourceProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: Gets or sets the properties. Define cluster specific properties. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterResourceProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -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 server. - - :ivar enable_internal_ingress: Whether to create cluster using private IP instead of public IP. - This property must be set at create time. 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. This property must be set at create time. Required. - :paramtype enable_internal_ingress: bool - """ - super().__init__(**kwargs) - self.enable_internal_ingress = enable_internal_ingress - self.private_link_service_id = None - - -class ClusterUpgradeHistoryProperties(_serialization.Model): - """Properties of cluster upgrade history. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ClusterAksPatchUpgradeHistoryProperties, ClusterInPlaceUpgradeHistoryProperties - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", "HotfixUpgradeRollback", "PatchVersionUpgrade", and - "PatchVersionUpgradeRollback". - :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryType - :ivar utc_time: Time when created this upgrade history. Required. - :vartype utc_time: str - :ivar upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :vartype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - """ - - _validation = { - "upgrade_type": {"required": True}, - "utc_time": {"required": True}, - "upgrade_result": {"required": True}, - } - - _attribute_map = { - "upgrade_type": {"key": "upgradeType", "type": "str"}, - "utc_time": {"key": "utcTime", "type": "str"}, - "upgrade_result": {"key": "upgradeResult", "type": "str"}, - } - - _subtype_map = { - "upgrade_type": { - "AKSPatchUpgrade": "ClusterAksPatchUpgradeHistoryProperties", - "ClusterInPlaceUpgradeHistoryProperties": "ClusterInPlaceUpgradeHistoryProperties", - } - } - - def __init__( - self, - *, - utc_time: str, - upgrade_result: Union[str, "_models.ClusterUpgradeHistoryUpgradeResultType"], - **kwargs: Any - ) -> None: - """ - :keyword utc_time: Time when created this upgrade history. Required. - :paramtype utc_time: str - :keyword upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :paramtype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - """ - super().__init__(**kwargs) - self.upgrade_type: Optional[str] = None - self.utc_time = utc_time - self.upgrade_result = upgrade_result - - -class ClusterAksPatchUpgradeHistoryProperties(ClusterUpgradeHistoryProperties): - """Cluster aks patch upgrade history properties. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", "HotfixUpgradeRollback", "PatchVersionUpgrade", and - "PatchVersionUpgradeRollback". - :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryType - :ivar utc_time: Time when created this upgrade history. Required. - :vartype utc_time: str - :ivar upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :vartype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :ivar original_version: Version before update. - :vartype original_version: str - :ivar new_version: Version going to update. - :vartype new_version: str - """ - - _validation = { - "upgrade_type": {"required": True}, - "utc_time": {"required": True}, - "upgrade_result": {"required": True}, - } - - _attribute_map = { - "upgrade_type": {"key": "upgradeType", "type": "str"}, - "utc_time": {"key": "utcTime", "type": "str"}, - "upgrade_result": {"key": "upgradeResult", "type": "str"}, - "original_version": {"key": "originalVersion", "type": "str"}, - "new_version": {"key": "newVersion", "type": "str"}, - } - - def __init__( - self, - *, - utc_time: str, - upgrade_result: Union[str, "_models.ClusterUpgradeHistoryUpgradeResultType"], - original_version: Optional[str] = None, - new_version: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword utc_time: Time when created this upgrade history. Required. - :paramtype utc_time: str - :keyword upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :paramtype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :keyword original_version: Version before update. - :paramtype original_version: str - :keyword new_version: Version going to update. - :paramtype new_version: str - """ - super().__init__(utc_time=utc_time, upgrade_result=upgrade_result, **kwargs) - self.upgrade_type: str = "AKSPatchUpgrade" - self.original_version = original_version - self.new_version = new_version - - -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, ClusterInPlaceUpgradeProperties - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", and "PatchVersionUpgrade". - :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", - "ClusterInPlaceUpgradeProperties": "ClusterInPlaceUpgradeProperties", - } - } - - 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 server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", and "PatchVersionUpgrade". - :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 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, ClusterAvailableInPlaceUpgradeProperties - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", and "PatchVersionUpgrade". - :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", - "ClusterAvailableInPlaceUpgradeProperties": "ClusterAvailableInPlaceUpgradeProperties", - } - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.upgrade_type: Optional[str] = None - - -class ClusterAvailableInPlaceUpgradeProperties( - ClusterAvailableUpgradeProperties -): # pylint: disable=too-many-instance-attributes - """Cluster available in-place upgrade. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ClusterAvailableUpgradeHotfixUpgradeProperties, - ClusterAvailableUpgradePatchVersionUpgradeProperties - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", and "PatchVersionUpgrade". - :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"}, - } - - _subtype_map = { - "upgrade_type": { - "HotfixUpgrade": "ClusterAvailableUpgradeHotfixUpgradeProperties", - "PatchVersionUpgrade": "ClusterAvailableUpgradePatchVersionUpgradeProperties", - } - } - - 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 = "ClusterAvailableInPlaceUpgradeProperties" - 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 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}". # pylint: disable=line-too-long - :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 - """ - - -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}". # pylint: disable=line-too-long - :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 properties: Gets or sets the properties. Define cluster upgrade specific properties. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterAvailableUpgradeProperties - """ - - _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"}, - "properties": {"key": "properties", "type": "ClusterAvailableUpgradeProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.ClusterAvailableUpgradeProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: Gets or sets the properties. Define cluster upgrade specific properties. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterAvailableUpgradeProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ClusterAvailableUpgradeAksPatchUpgradeProperties( - ClusterAvailableUpgradeProperties -): # pylint: disable=name-too-long - """Cluster available AKS patch version upgrade. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", and "PatchVersionUpgrade". - :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( - ClusterAvailableInPlaceUpgradeProperties -): # pylint: disable=too-many-instance-attributes,name-too-long - """Cluster available hotfix version upgrade. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", and "PatchVersionUpgrade". - :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__( - description=description, - source_oss_version=source_oss_version, - source_cluster_version=source_cluster_version, - source_build_number=source_build_number, - target_oss_version=target_oss_version, - target_cluster_version=target_cluster_version, - target_build_number=target_build_number, - component_name=component_name, - severity=severity, - extended_properties=extended_properties, - created_time=created_time, - **kwargs - ) - self.upgrade_type: str = "HotfixUpgrade" - - -class ClusterAvailableUpgradeList(_serialization.Model): - """Collection of cluster available upgrade. - - All required parameters must be populated in order to send to server. - - :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 ClusterAvailableUpgradePatchVersionUpgradeProperties( - ClusterAvailableInPlaceUpgradeProperties -): # pylint: disable=too-many-instance-attributes,name-too-long - """Cluster available patch version upgrade. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", and "PatchVersionUpgrade". - :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__( - description=description, - source_oss_version=source_oss_version, - source_cluster_version=source_cluster_version, - source_build_number=source_build_number, - target_oss_version=target_oss_version, - target_cluster_version=target_cluster_version, - target_build_number=target_build_number, - component_name=component_name, - severity=severity, - extended_properties=extended_properties, - created_time=created_time, - **kwargs - ) - self.upgrade_type: str = "PatchVersionUpgrade" - - -class ClusterComponentsItem(_serialization.Model): - """ClusterComponentsItem. - - :ivar name: - :vartype name: str - :ivar version: - :vartype version: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "version": {"key": "version", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, version: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: - :paramtype name: str - :keyword version: - :paramtype version: str - """ - super().__init__(**kwargs) - self.name = name - self.version = version - - -class ClusterConfigFile(_serialization.Model): - """Cluster configuration files. - - All required parameters must be populated in order to send to server. - - :ivar file_name: Configuration file name. Required. - :vartype file_name: str - :ivar content: Free form content of the entire configuration file. - :vartype content: str - :ivar encoding: This property indicates if the content is encoded and is case-insensitive. - Please set the value to base64 if the content is base64 encoded. Set it to none or skip it if - the content is plain text. Known values are: "Base64" and "None". - :vartype encoding: str or ~azure.mgmt.hdinsightcontainers.models.ContentEncoding - :ivar path: Path of the config file if content is specified. - :vartype path: str - :ivar values: List of key value pairs - where key represents a valid service configuration name and value represents the value of the - config. - :vartype values: dict[str, str] - """ - - _validation = { - "file_name": {"required": True}, - } - - _attribute_map = { - "file_name": {"key": "fileName", "type": "str"}, - "content": {"key": "content", "type": "str"}, - "encoding": {"key": "encoding", "type": "str"}, - "path": {"key": "path", "type": "str"}, - "values": {"key": "values", "type": "{str}"}, - } - - def __init__( - self, - *, - file_name: str, - content: Optional[str] = None, - encoding: Optional[Union[str, "_models.ContentEncoding"]] = None, - path: Optional[str] = None, - values: Optional[Dict[str, str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword file_name: Configuration file name. Required. - :paramtype file_name: str - :keyword content: Free form content of the entire configuration file. - :paramtype content: str - :keyword encoding: This property indicates if the content is encoded and is case-insensitive. - Please set the value to base64 if the content is base64 encoded. Set it to none or skip it if - the content is plain text. Known values are: "Base64" and "None". - :paramtype encoding: str or ~azure.mgmt.hdinsightcontainers.models.ContentEncoding - :keyword path: Path of the config file if content is specified. - :paramtype path: str - :keyword values: List of key value pairs - where key represents a valid service configuration name and value represents the value of the - config. - :paramtype values: dict[str, str] - """ - super().__init__(**kwargs) - self.file_name = file_name - self.content = content - self.encoding = encoding - self.path = path - self.values = values - - -class ClusterInPlaceUpgradeHistoryProperties( - ClusterUpgradeHistoryProperties -): # pylint: disable=too-many-instance-attributes - """Cluster in-place upgrade history properties. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ClusterHotfixUpgradeHistoryProperties, ClusterHotfixUpgradeRollbackHistoryProperties, - ClusterPatchVersionUpgradeHistoryProperties, - ClusterPatchVersionUpgradeRollbackHistoryProperties - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", "HotfixUpgradeRollback", "PatchVersionUpgrade", and - "PatchVersionUpgradeRollback". - :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryType - :ivar utc_time: Time when created this upgrade history. Required. - :vartype utc_time: str - :ivar upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :vartype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :ivar source_cluster_version: Version with three part. - :vartype source_cluster_version: str - :ivar source_oss_version: Version with three part. - :vartype source_oss_version: str - :ivar source_build_number: Source build number. - :vartype source_build_number: str - :ivar target_cluster_version: Version with three part. - :vartype target_cluster_version: str - :ivar target_oss_version: Version with three part. - :vartype target_oss_version: str - :ivar target_build_number: Target build number. - :vartype target_build_number: str - :ivar component_name: Component name to upgrade. - :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.ClusterUpgradeHistorySeverityType - """ - - _validation = { - "upgrade_type": {"required": True}, - "utc_time": {"required": True}, - "upgrade_result": {"required": True}, - "source_cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "source_oss_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "target_cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "target_oss_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - } - - _attribute_map = { - "upgrade_type": {"key": "upgradeType", "type": "str"}, - "utc_time": {"key": "utcTime", "type": "str"}, - "upgrade_result": {"key": "upgradeResult", "type": "str"}, - "source_cluster_version": {"key": "sourceClusterVersion", "type": "str"}, - "source_oss_version": {"key": "sourceOssVersion", "type": "str"}, - "source_build_number": {"key": "sourceBuildNumber", "type": "str"}, - "target_cluster_version": {"key": "targetClusterVersion", "type": "str"}, - "target_oss_version": {"key": "targetOssVersion", "type": "str"}, - "target_build_number": {"key": "targetBuildNumber", "type": "str"}, - "component_name": {"key": "componentName", "type": "str"}, - "severity": {"key": "severity", "type": "str"}, - } - - _subtype_map = { - "upgrade_type": { - "HotfixUpgrade": "ClusterHotfixUpgradeHistoryProperties", - "HotfixUpgradeRollback": "ClusterHotfixUpgradeRollbackHistoryProperties", - "PatchVersionUpgrade": "ClusterPatchVersionUpgradeHistoryProperties", - "PatchVersionUpgradeRollback": "ClusterPatchVersionUpgradeRollbackHistoryProperties", - } - } - - def __init__( - self, - *, - utc_time: str, - upgrade_result: Union[str, "_models.ClusterUpgradeHistoryUpgradeResultType"], - source_cluster_version: Optional[str] = None, - source_oss_version: Optional[str] = None, - source_build_number: Optional[str] = None, - target_cluster_version: Optional[str] = None, - target_oss_version: Optional[str] = None, - target_build_number: Optional[str] = None, - component_name: Optional[str] = None, - severity: Optional[Union[str, "_models.ClusterUpgradeHistorySeverityType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword utc_time: Time when created this upgrade history. Required. - :paramtype utc_time: str - :keyword upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :paramtype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :keyword source_cluster_version: Version with three part. - :paramtype source_cluster_version: str - :keyword source_oss_version: Version with three part. - :paramtype source_oss_version: str - :keyword source_build_number: Source build number. - :paramtype source_build_number: str - :keyword target_cluster_version: Version with three part. - :paramtype target_cluster_version: str - :keyword target_oss_version: Version with three part. - :paramtype target_oss_version: str - :keyword target_build_number: Target build number. - :paramtype target_build_number: str - :keyword component_name: Component name to upgrade. - :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.ClusterUpgradeHistorySeverityType - """ - super().__init__(utc_time=utc_time, upgrade_result=upgrade_result, **kwargs) - self.upgrade_type: str = "ClusterInPlaceUpgradeHistoryProperties" - self.source_cluster_version = source_cluster_version - self.source_oss_version = source_oss_version - self.source_build_number = source_build_number - self.target_cluster_version = target_cluster_version - self.target_oss_version = target_oss_version - self.target_build_number = target_build_number - self.component_name = component_name - self.severity = severity - - -class ClusterHotfixUpgradeHistoryProperties( - ClusterInPlaceUpgradeHistoryProperties -): # pylint: disable=too-many-instance-attributes - """Cluster hotfix upgrade history properties. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", "HotfixUpgradeRollback", "PatchVersionUpgrade", and - "PatchVersionUpgradeRollback". - :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryType - :ivar utc_time: Time when created this upgrade history. Required. - :vartype utc_time: str - :ivar upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :vartype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :ivar source_cluster_version: Version with three part. - :vartype source_cluster_version: str - :ivar source_oss_version: Version with three part. - :vartype source_oss_version: str - :ivar source_build_number: Source build number. - :vartype source_build_number: str - :ivar target_cluster_version: Version with three part. - :vartype target_cluster_version: str - :ivar target_oss_version: Version with three part. - :vartype target_oss_version: str - :ivar target_build_number: Target build number. - :vartype target_build_number: str - :ivar component_name: Component name to upgrade. - :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.ClusterUpgradeHistorySeverityType - """ - - _validation = { - "upgrade_type": {"required": True}, - "utc_time": {"required": True}, - "upgrade_result": {"required": True}, - "source_cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "source_oss_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "target_cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "target_oss_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - } - - _attribute_map = { - "upgrade_type": {"key": "upgradeType", "type": "str"}, - "utc_time": {"key": "utcTime", "type": "str"}, - "upgrade_result": {"key": "upgradeResult", "type": "str"}, - "source_cluster_version": {"key": "sourceClusterVersion", "type": "str"}, - "source_oss_version": {"key": "sourceOssVersion", "type": "str"}, - "source_build_number": {"key": "sourceBuildNumber", "type": "str"}, - "target_cluster_version": {"key": "targetClusterVersion", "type": "str"}, - "target_oss_version": {"key": "targetOssVersion", "type": "str"}, - "target_build_number": {"key": "targetBuildNumber", "type": "str"}, - "component_name": {"key": "componentName", "type": "str"}, - "severity": {"key": "severity", "type": "str"}, - } - - def __init__( - self, - *, - utc_time: str, - upgrade_result: Union[str, "_models.ClusterUpgradeHistoryUpgradeResultType"], - source_cluster_version: Optional[str] = None, - source_oss_version: Optional[str] = None, - source_build_number: Optional[str] = None, - target_cluster_version: Optional[str] = None, - target_oss_version: Optional[str] = None, - target_build_number: Optional[str] = None, - component_name: Optional[str] = None, - severity: Optional[Union[str, "_models.ClusterUpgradeHistorySeverityType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword utc_time: Time when created this upgrade history. Required. - :paramtype utc_time: str - :keyword upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :paramtype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :keyword source_cluster_version: Version with three part. - :paramtype source_cluster_version: str - :keyword source_oss_version: Version with three part. - :paramtype source_oss_version: str - :keyword source_build_number: Source build number. - :paramtype source_build_number: str - :keyword target_cluster_version: Version with three part. - :paramtype target_cluster_version: str - :keyword target_oss_version: Version with three part. - :paramtype target_oss_version: str - :keyword target_build_number: Target build number. - :paramtype target_build_number: str - :keyword component_name: Component name to upgrade. - :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.ClusterUpgradeHistorySeverityType - """ - super().__init__( - utc_time=utc_time, - upgrade_result=upgrade_result, - source_cluster_version=source_cluster_version, - source_oss_version=source_oss_version, - source_build_number=source_build_number, - target_cluster_version=target_cluster_version, - target_oss_version=target_oss_version, - target_build_number=target_build_number, - component_name=component_name, - severity=severity, - **kwargs - ) - self.upgrade_type: str = "HotfixUpgrade" - - -class ClusterInPlaceUpgradeProperties(ClusterUpgradeProperties): - """Properties of in-place upgrading cluster. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ClusterHotfixUpgradeProperties, ClusterPatchVersionUpgradeProperties - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", and "PatchVersionUpgrade". - :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"}, - } - - _subtype_map = { - "upgrade_type": { - "HotfixUpgrade": "ClusterHotfixUpgradeProperties", - "PatchVersionUpgrade": "ClusterPatchVersionUpgradeProperties", - } - } - - 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 = "ClusterInPlaceUpgradeProperties" - 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 ClusterHotfixUpgradeProperties(ClusterInPlaceUpgradeProperties): - """Properties of upgrading cluster's hotfix. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", and "PatchVersionUpgrade". - :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__( - target_oss_version=target_oss_version, - target_cluster_version=target_cluster_version, - target_build_number=target_build_number, - component_name=component_name, - **kwargs - ) - self.upgrade_type: str = "HotfixUpgrade" - - -class ClusterHotfixUpgradeRollbackHistoryProperties( - ClusterInPlaceUpgradeHistoryProperties -): # pylint: disable=too-many-instance-attributes,name-too-long - """Cluster hotfix upgrade rollback history properties. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", "HotfixUpgradeRollback", "PatchVersionUpgrade", and - "PatchVersionUpgradeRollback". - :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryType - :ivar utc_time: Time when created this upgrade history. Required. - :vartype utc_time: str - :ivar upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :vartype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :ivar source_cluster_version: Version with three part. - :vartype source_cluster_version: str - :ivar source_oss_version: Version with three part. - :vartype source_oss_version: str - :ivar source_build_number: Source build number. - :vartype source_build_number: str - :ivar target_cluster_version: Version with three part. - :vartype target_cluster_version: str - :ivar target_oss_version: Version with three part. - :vartype target_oss_version: str - :ivar target_build_number: Target build number. - :vartype target_build_number: str - :ivar component_name: Component name to upgrade. - :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.ClusterUpgradeHistorySeverityType - """ - - _validation = { - "upgrade_type": {"required": True}, - "utc_time": {"required": True}, - "upgrade_result": {"required": True}, - "source_cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "source_oss_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "target_cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "target_oss_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - } - - _attribute_map = { - "upgrade_type": {"key": "upgradeType", "type": "str"}, - "utc_time": {"key": "utcTime", "type": "str"}, - "upgrade_result": {"key": "upgradeResult", "type": "str"}, - "source_cluster_version": {"key": "sourceClusterVersion", "type": "str"}, - "source_oss_version": {"key": "sourceOssVersion", "type": "str"}, - "source_build_number": {"key": "sourceBuildNumber", "type": "str"}, - "target_cluster_version": {"key": "targetClusterVersion", "type": "str"}, - "target_oss_version": {"key": "targetOssVersion", "type": "str"}, - "target_build_number": {"key": "targetBuildNumber", "type": "str"}, - "component_name": {"key": "componentName", "type": "str"}, - "severity": {"key": "severity", "type": "str"}, - } - - def __init__( - self, - *, - utc_time: str, - upgrade_result: Union[str, "_models.ClusterUpgradeHistoryUpgradeResultType"], - source_cluster_version: Optional[str] = None, - source_oss_version: Optional[str] = None, - source_build_number: Optional[str] = None, - target_cluster_version: Optional[str] = None, - target_oss_version: Optional[str] = None, - target_build_number: Optional[str] = None, - component_name: Optional[str] = None, - severity: Optional[Union[str, "_models.ClusterUpgradeHistorySeverityType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword utc_time: Time when created this upgrade history. Required. - :paramtype utc_time: str - :keyword upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :paramtype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :keyword source_cluster_version: Version with three part. - :paramtype source_cluster_version: str - :keyword source_oss_version: Version with three part. - :paramtype source_oss_version: str - :keyword source_build_number: Source build number. - :paramtype source_build_number: str - :keyword target_cluster_version: Version with three part. - :paramtype target_cluster_version: str - :keyword target_oss_version: Version with three part. - :paramtype target_oss_version: str - :keyword target_build_number: Target build number. - :paramtype target_build_number: str - :keyword component_name: Component name to upgrade. - :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.ClusterUpgradeHistorySeverityType - """ - super().__init__( - utc_time=utc_time, - upgrade_result=upgrade_result, - source_cluster_version=source_cluster_version, - source_oss_version=source_oss_version, - source_build_number=source_build_number, - target_cluster_version=target_cluster_version, - target_oss_version=target_oss_version, - target_build_number=target_build_number, - component_name=component_name, - severity=severity, - **kwargs - ) - self.upgrade_type: str = "HotfixUpgradeRollback" - - -class ClusterInstanceViewProperties(_serialization.Model): - """Cluster Instance View Properties. - - All required parameters must be populated in order to send to server. - - :ivar status: Status of the instance view. Required. - :vartype status: ~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewPropertiesStatus - :ivar service_statuses: List of statuses of relevant services that make up the HDInsight on AKS - cluster to surface to the customer. Required. - :vartype service_statuses: list[~azure.mgmt.hdinsightcontainers.models.ServiceStatus] - """ - - _validation = { - "status": {"required": True}, - "service_statuses": {"required": True}, - } - - _attribute_map = { - "status": {"key": "status", "type": "ClusterInstanceViewPropertiesStatus"}, - "service_statuses": {"key": "serviceStatuses", "type": "[ServiceStatus]"}, - } - - def __init__( - self, - *, - status: "_models.ClusterInstanceViewPropertiesStatus", - service_statuses: List["_models.ServiceStatus"], - **kwargs: Any - ) -> None: - """ - :keyword status: Status of the instance view. Required. - :paramtype status: ~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewPropertiesStatus - :keyword service_statuses: List of statuses of relevant services that make up the HDInsight on - AKS cluster to surface to the customer. Required. - :paramtype service_statuses: list[~azure.mgmt.hdinsightcontainers.models.ServiceStatus] - """ - super().__init__(**kwargs) - self.status = status - self.service_statuses = service_statuses - - -class ClusterInstanceViewStatus(_serialization.Model): - """Status of the instance view. - - All required parameters must be populated in order to send to server. - - :ivar ready: The cluster ready status. Required. - :vartype ready: str - :ivar reason: The status reason. - :vartype reason: str - :ivar message: The additional message. - :vartype message: str - """ - - _validation = { - "ready": {"required": True}, - } - - _attribute_map = { - "ready": {"key": "ready", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__( - self, *, ready: str, reason: Optional[str] = None, message: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword ready: The cluster ready status. Required. - :paramtype ready: str - :keyword reason: The status reason. - :paramtype reason: str - :keyword message: The additional message. - :paramtype message: str - """ - super().__init__(**kwargs) - self.ready = ready - self.reason = reason - self.message = message - - -class ClusterInstanceViewPropertiesStatus(ClusterInstanceViewStatus): - """Status of the instance view. - - All required parameters must be populated in order to send to server. - - :ivar ready: The cluster ready status. Required. - :vartype ready: str - :ivar reason: The status reason. - :vartype reason: str - :ivar message: The additional message. - :vartype message: str - """ - - -class ClusterInstanceViewResult(_serialization.Model): - """Cluster Instance View. - - All required parameters must be populated in order to send to server. - - :ivar name: Name of the instance view. Required. - :vartype name: str - :ivar properties: Properties of the instance view. Required. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewResultProperties - """ - - _validation = { - "name": {"required": True}, - "properties": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "properties": {"key": "properties", "type": "ClusterInstanceViewResultProperties"}, - } - - def __init__(self, *, name: str, properties: "_models.ClusterInstanceViewResultProperties", **kwargs: Any) -> None: - """ - :keyword name: Name of the instance view. Required. - :paramtype name: str - :keyword properties: Properties of the instance view. Required. - :paramtype properties: - ~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewResultProperties - """ - super().__init__(**kwargs) - self.name = name - self.properties = properties - - -class ClusterInstanceViewResultProperties(ClusterInstanceViewProperties): - """Properties of the instance view. - - All required parameters must be populated in order to send to server. - - :ivar status: Status of the instance view. Required. - :vartype status: ~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewPropertiesStatus - :ivar service_statuses: List of statuses of relevant services that make up the HDInsight on AKS - cluster to surface to the customer. Required. - :vartype service_statuses: list[~azure.mgmt.hdinsightcontainers.models.ServiceStatus] - """ - - -class ClusterInstanceViewsResult(_serialization.Model): - """The instance view of a HDInsight Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Cluster instance view array. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewResult] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ClusterInstanceViewResult]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - 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 ClusterJob(ProxyResource): - """Cluster job. - - 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 server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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 properties: Properties of cluster job. Required. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterJobProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "properties": {"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"}, - "properties": {"key": "properties", "type": "ClusterJobProperties"}, - } - - def __init__(self, *, properties: "_models.ClusterJobProperties", **kwargs: Any) -> None: - """ - :keyword properties: Properties of cluster job. Required. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterJobProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ClusterJobList(_serialization.Model): - """Collection of cluster job. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of cluster job. Required. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterJob] - :ivar next_link: The Url of next result page. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ClusterJob]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.ClusterJob"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: Collection of cluster job. Required. - :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterJob] - :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 ClusterJobProperties(_serialization.Model): - """Properties of cluster job. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FlinkJobProperties - - All required parameters must be populated in order to send to server. - - :ivar job_type: Type of cluster job. Required. "FlinkJob" - :vartype job_type: str or ~azure.mgmt.hdinsightcontainers.models.JobType - """ - - _validation = { - "job_type": {"required": True}, - } - - _attribute_map = { - "job_type": {"key": "jobType", "type": "str"}, - } - - _subtype_map = {"job_type": {"FlinkJob": "FlinkJobProperties"}} - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.job_type: Optional[str] = None - - -class ClusterLibrary(ProxyResource): - """Libraries in the 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 server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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 properties: Properties of a library in the cluster. Required. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterLibraryProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "properties": {"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"}, - "properties": {"key": "properties", "type": "ClusterLibraryProperties"}, - } - - def __init__(self, *, properties: "_models.ClusterLibraryProperties", **kwargs: Any) -> None: - """ - :keyword properties: Properties of a library in the cluster. Required. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterLibraryProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ClusterLibraryList(_serialization.Model): - """Collection of libraries in the 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 server. - - :ivar value: Collection of libraries in the cluster. Required. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterLibrary] - :ivar next_link: The url of next result page. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ClusterLibrary]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.ClusterLibrary"], **kwargs: Any) -> None: - """ - :keyword value: Collection of libraries in the cluster. Required. - :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterLibrary] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ClusterLibraryManagementOperation(ProxyResource): - """Library management operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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 properties: Properties of a library management operation. Required. - :vartype properties: - ~azure.mgmt.hdinsightcontainers.models.ClusterLibraryManagementOperationProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "properties": {"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"}, - "properties": {"key": "properties", "type": "ClusterLibraryManagementOperationProperties"}, - } - - def __init__(self, *, properties: "_models.ClusterLibraryManagementOperationProperties", **kwargs: Any) -> None: - """ - :keyword properties: Properties of a library management operation. Required. - :paramtype properties: - ~azure.mgmt.hdinsightcontainers.models.ClusterLibraryManagementOperationProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ClusterLibraryManagementOperationProperties(_serialization.Model): # pylint: disable=name-too-long - """Properties of a library management operation. - - All required parameters must be populated in order to send to server. - - :ivar action: The library management action. Required. Known values are: "Install" and - "Uninstall". - :vartype action: str or ~azure.mgmt.hdinsightcontainers.models.LibraryManagementAction - :ivar libraries: The libraries to be installed/updated/uninstalled. Required. - :vartype libraries: list[~azure.mgmt.hdinsightcontainers.models.ClusterLibrary] - """ - - _validation = { - "action": {"required": True}, - "libraries": {"required": True}, - } - - _attribute_map = { - "action": {"key": "action", "type": "str"}, - "libraries": {"key": "libraries", "type": "[ClusterLibrary]"}, - } - - def __init__( - self, - *, - action: Union[str, "_models.LibraryManagementAction"], - libraries: List["_models.ClusterLibrary"], - **kwargs: Any - ) -> None: - """ - :keyword action: The library management action. Required. Known values are: "Install" and - "Uninstall". - :paramtype action: str or ~azure.mgmt.hdinsightcontainers.models.LibraryManagementAction - :keyword libraries: The libraries to be installed/updated/uninstalled. Required. - :paramtype libraries: list[~azure.mgmt.hdinsightcontainers.models.ClusterLibrary] - """ - super().__init__(**kwargs) - self.action = action - self.libraries = libraries - - -class ClusterLibraryProperties(_serialization.Model): - """Properties of a library in the cluster. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - MavenLibraryProperties, PyPiLibraryProperties - - 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 server. - - :ivar type: Type of the library. Required. Known values are: "pypi" and "maven". - :vartype type: str or ~azure.mgmt.hdinsightcontainers.models.Type - :ivar remarks: Remark of the latest library management operation. - :vartype remarks: str - :ivar timestamp: Timestamp of the latest library management operation. - :vartype timestamp: ~datetime.datetime - :ivar status: Status of the library. Known values are: "INSTALLING", "INSTALLED", - "INSTALL_FAILED", "UNINSTALLING", and "UNINSTALL_FAILED". - :vartype status: str or ~azure.mgmt.hdinsightcontainers.models.Status - :ivar message: Error message of the library operation when a failure occurs. - :vartype message: str - """ - - _validation = { - "type": {"required": True}, - "timestamp": {"readonly": True}, - "status": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "remarks": {"key": "remarks", "type": "str"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "status": {"key": "status", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - _subtype_map = {"type": {"maven": "MavenLibraryProperties", "pypi": "PyPiLibraryProperties"}} - - def __init__(self, *, remarks: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword remarks: Remark of the latest library management operation. - :paramtype remarks: str - """ - super().__init__(**kwargs) - self.type: Optional[str] = None - self.remarks = remarks - self.timestamp = None - self.status = None - self.message = None - - -class ClusterListResult(_serialization.Model): - """The list cluster operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of clusters. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.Cluster] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Cluster]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.Cluster"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of clusters. - :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.Cluster] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ClusterLogAnalyticsApplicationLogs(_serialization.Model): - """Collection of logs to be enabled or disabled for log analytics. - - :ivar std_out_enabled: True if stdout is enabled, otherwise false. - :vartype std_out_enabled: bool - :ivar std_error_enabled: True if stderror is enabled, otherwise false. - :vartype std_error_enabled: bool - """ - - _attribute_map = { - "std_out_enabled": {"key": "stdOutEnabled", "type": "bool"}, - "std_error_enabled": {"key": "stdErrorEnabled", "type": "bool"}, - } - - def __init__( - self, *, std_out_enabled: Optional[bool] = None, std_error_enabled: Optional[bool] = None, **kwargs: Any - ) -> None: - """ - :keyword std_out_enabled: True if stdout is enabled, otherwise false. - :paramtype std_out_enabled: bool - :keyword std_error_enabled: True if stderror is enabled, otherwise false. - :paramtype std_error_enabled: bool - """ - super().__init__(**kwargs) - self.std_out_enabled = std_out_enabled - self.std_error_enabled = std_error_enabled - - -class ClusterLogAnalyticsProfile(_serialization.Model): - """Cluster log analytics profile to enable or disable OMS agent for cluster. - - All required parameters must be populated in order to send to server. - - :ivar enabled: True if log analytics is enabled for the cluster, otherwise false. Required. - :vartype enabled: bool - :ivar application_logs: Collection of logs to be enabled or disabled for log analytics. - :vartype application_logs: - ~azure.mgmt.hdinsightcontainers.models.ClusterLogAnalyticsApplicationLogs - :ivar metrics_enabled: True if metrics are enabled, otherwise false. - :vartype metrics_enabled: bool - """ - - _validation = { - "enabled": {"required": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "application_logs": {"key": "applicationLogs", "type": "ClusterLogAnalyticsApplicationLogs"}, - "metrics_enabled": {"key": "metricsEnabled", "type": "bool"}, - } - - def __init__( - self, - *, - enabled: bool, - application_logs: Optional["_models.ClusterLogAnalyticsApplicationLogs"] = None, - metrics_enabled: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: True if log analytics is enabled for the cluster, otherwise false. Required. - :paramtype enabled: bool - :keyword application_logs: Collection of logs to be enabled or disabled for log analytics. - :paramtype application_logs: - ~azure.mgmt.hdinsightcontainers.models.ClusterLogAnalyticsApplicationLogs - :keyword metrics_enabled: True if metrics are enabled, otherwise false. - :paramtype metrics_enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - self.application_logs = application_logs - self.metrics_enabled = metrics_enabled - - -class ClusterPatch(_serialization.Model): - """The patch for a cluster. - - :ivar properties: Define cluster patch specific properties. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterPatchProperties - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "ClusterPatchProperties"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__( - self, - *, - properties: Optional["_models.ClusterPatchProperties"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword properties: Define cluster patch specific properties. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterPatchProperties - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.properties = properties - self.tags = tags - - -class ClusterPatchProperties(_serialization.Model): - """Cluster resource patch data. - - :ivar cluster_profile: Cluster resource patch properties. - :vartype cluster_profile: ~azure.mgmt.hdinsightcontainers.models.UpdatableClusterProfile - """ - - _attribute_map = { - "cluster_profile": {"key": "clusterProfile", "type": "UpdatableClusterProfile"}, - } - - def __init__(self, *, cluster_profile: Optional["_models.UpdatableClusterProfile"] = None, **kwargs: Any) -> None: - """ - :keyword cluster_profile: Cluster resource patch properties. - :paramtype cluster_profile: ~azure.mgmt.hdinsightcontainers.models.UpdatableClusterProfile - """ - super().__init__(**kwargs) - self.cluster_profile = cluster_profile - - -class ClusterPatchVersionUpgradeHistoryProperties( - ClusterInPlaceUpgradeHistoryProperties -): # pylint: disable=too-many-instance-attributes,name-too-long - """Cluster patch version upgrade history properties. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", "HotfixUpgradeRollback", "PatchVersionUpgrade", and - "PatchVersionUpgradeRollback". - :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryType - :ivar utc_time: Time when created this upgrade history. Required. - :vartype utc_time: str - :ivar upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :vartype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :ivar source_cluster_version: Version with three part. - :vartype source_cluster_version: str - :ivar source_oss_version: Version with three part. - :vartype source_oss_version: str - :ivar source_build_number: Source build number. - :vartype source_build_number: str - :ivar target_cluster_version: Version with three part. - :vartype target_cluster_version: str - :ivar target_oss_version: Version with three part. - :vartype target_oss_version: str - :ivar target_build_number: Target build number. - :vartype target_build_number: str - :ivar component_name: Component name to upgrade. - :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.ClusterUpgradeHistorySeverityType - """ - - _validation = { - "upgrade_type": {"required": True}, - "utc_time": {"required": True}, - "upgrade_result": {"required": True}, - "source_cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "source_oss_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "target_cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "target_oss_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - } - - _attribute_map = { - "upgrade_type": {"key": "upgradeType", "type": "str"}, - "utc_time": {"key": "utcTime", "type": "str"}, - "upgrade_result": {"key": "upgradeResult", "type": "str"}, - "source_cluster_version": {"key": "sourceClusterVersion", "type": "str"}, - "source_oss_version": {"key": "sourceOssVersion", "type": "str"}, - "source_build_number": {"key": "sourceBuildNumber", "type": "str"}, - "target_cluster_version": {"key": "targetClusterVersion", "type": "str"}, - "target_oss_version": {"key": "targetOssVersion", "type": "str"}, - "target_build_number": {"key": "targetBuildNumber", "type": "str"}, - "component_name": {"key": "componentName", "type": "str"}, - "severity": {"key": "severity", "type": "str"}, - } - - def __init__( - self, - *, - utc_time: str, - upgrade_result: Union[str, "_models.ClusterUpgradeHistoryUpgradeResultType"], - source_cluster_version: Optional[str] = None, - source_oss_version: Optional[str] = None, - source_build_number: Optional[str] = None, - target_cluster_version: Optional[str] = None, - target_oss_version: Optional[str] = None, - target_build_number: Optional[str] = None, - component_name: Optional[str] = None, - severity: Optional[Union[str, "_models.ClusterUpgradeHistorySeverityType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword utc_time: Time when created this upgrade history. Required. - :paramtype utc_time: str - :keyword upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :paramtype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :keyword source_cluster_version: Version with three part. - :paramtype source_cluster_version: str - :keyword source_oss_version: Version with three part. - :paramtype source_oss_version: str - :keyword source_build_number: Source build number. - :paramtype source_build_number: str - :keyword target_cluster_version: Version with three part. - :paramtype target_cluster_version: str - :keyword target_oss_version: Version with three part. - :paramtype target_oss_version: str - :keyword target_build_number: Target build number. - :paramtype target_build_number: str - :keyword component_name: Component name to upgrade. - :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.ClusterUpgradeHistorySeverityType - """ - super().__init__( - utc_time=utc_time, - upgrade_result=upgrade_result, - source_cluster_version=source_cluster_version, - source_oss_version=source_oss_version, - source_build_number=source_build_number, - target_cluster_version=target_cluster_version, - target_oss_version=target_oss_version, - target_build_number=target_build_number, - component_name=component_name, - severity=severity, - **kwargs - ) - self.upgrade_type: str = "PatchVersionUpgrade" - - -class ClusterPatchVersionUpgradeProperties(ClusterInPlaceUpgradeProperties): - """Properties of upgrading cluster's patch version. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", and "PatchVersionUpgrade". - :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__( - target_oss_version=target_oss_version, - target_cluster_version=target_cluster_version, - target_build_number=target_build_number, - component_name=component_name, - **kwargs - ) - self.upgrade_type: str = "PatchVersionUpgrade" - - -class ClusterPatchVersionUpgradeRollbackHistoryProperties( - ClusterInPlaceUpgradeHistoryProperties -): # pylint: disable=too-many-instance-attributes,name-too-long - """Cluster patch version upgrade rollback history properties. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade", - "HotfixUpgrade", "HotfixUpgradeRollback", "PatchVersionUpgrade", and - "PatchVersionUpgradeRollback". - :vartype upgrade_type: str or ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryType - :ivar utc_time: Time when created this upgrade history. Required. - :vartype utc_time: str - :ivar upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :vartype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :ivar source_cluster_version: Version with three part. - :vartype source_cluster_version: str - :ivar source_oss_version: Version with three part. - :vartype source_oss_version: str - :ivar source_build_number: Source build number. - :vartype source_build_number: str - :ivar target_cluster_version: Version with three part. - :vartype target_cluster_version: str - :ivar target_oss_version: Version with three part. - :vartype target_oss_version: str - :ivar target_build_number: Target build number. - :vartype target_build_number: str - :ivar component_name: Component name to upgrade. - :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.ClusterUpgradeHistorySeverityType - """ - - _validation = { - "upgrade_type": {"required": True}, - "utc_time": {"required": True}, - "upgrade_result": {"required": True}, - "source_cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "source_oss_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "target_cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "target_oss_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - } - - _attribute_map = { - "upgrade_type": {"key": "upgradeType", "type": "str"}, - "utc_time": {"key": "utcTime", "type": "str"}, - "upgrade_result": {"key": "upgradeResult", "type": "str"}, - "source_cluster_version": {"key": "sourceClusterVersion", "type": "str"}, - "source_oss_version": {"key": "sourceOssVersion", "type": "str"}, - "source_build_number": {"key": "sourceBuildNumber", "type": "str"}, - "target_cluster_version": {"key": "targetClusterVersion", "type": "str"}, - "target_oss_version": {"key": "targetOssVersion", "type": "str"}, - "target_build_number": {"key": "targetBuildNumber", "type": "str"}, - "component_name": {"key": "componentName", "type": "str"}, - "severity": {"key": "severity", "type": "str"}, - } - - def __init__( - self, - *, - utc_time: str, - upgrade_result: Union[str, "_models.ClusterUpgradeHistoryUpgradeResultType"], - source_cluster_version: Optional[str] = None, - source_oss_version: Optional[str] = None, - source_build_number: Optional[str] = None, - target_cluster_version: Optional[str] = None, - target_oss_version: Optional[str] = None, - target_build_number: Optional[str] = None, - component_name: Optional[str] = None, - severity: Optional[Union[str, "_models.ClusterUpgradeHistorySeverityType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword utc_time: Time when created this upgrade history. Required. - :paramtype utc_time: str - :keyword upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :paramtype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryUpgradeResultType - :keyword source_cluster_version: Version with three part. - :paramtype source_cluster_version: str - :keyword source_oss_version: Version with three part. - :paramtype source_oss_version: str - :keyword source_build_number: Source build number. - :paramtype source_build_number: str - :keyword target_cluster_version: Version with three part. - :paramtype target_cluster_version: str - :keyword target_oss_version: Version with three part. - :paramtype target_oss_version: str - :keyword target_build_number: Target build number. - :paramtype target_build_number: str - :keyword component_name: Component name to upgrade. - :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.ClusterUpgradeHistorySeverityType - """ - super().__init__( - utc_time=utc_time, - upgrade_result=upgrade_result, - source_cluster_version=source_cluster_version, - source_oss_version=source_oss_version, - source_build_number=source_build_number, - target_cluster_version=target_cluster_version, - target_oss_version=target_oss_version, - target_build_number=target_build_number, - component_name=component_name, - severity=severity, - **kwargs - ) - self.upgrade_type: str = "PatchVersionUpgradeRollback" - - -class ClusterPool(TrackedResource): - """Cluster pool. - - 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 server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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. - :vartype location: str - :ivar properties: Gets or sets the properties. Define cluster pool specific properties. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourceProperties - """ - - _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"}, - "properties": {"key": "properties", "type": "ClusterPoolResourceProperties"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.ClusterPoolResourceProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: Gets or sets the properties. Define cluster pool specific properties. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourceProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -class ClusterPoolUpgradeHistoryProperties(_serialization.Model): - """Properties of cluster pool upgrade history. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ClusterPoolAksPatchUpgradeHistoryProperties, ClusterPoolNodeOsUpgradeHistoryProperties - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and - "NodeOsUpgrade". - :vartype upgrade_type: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryType - :ivar utc_time: Time when created this upgrade history. Required. - :vartype utc_time: str - :ivar upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :vartype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryUpgradeResultType - """ - - _validation = { - "upgrade_type": {"required": True}, - "utc_time": {"required": True}, - "upgrade_result": {"required": True}, - } - - _attribute_map = { - "upgrade_type": {"key": "upgradeType", "type": "str"}, - "utc_time": {"key": "utcTime", "type": "str"}, - "upgrade_result": {"key": "upgradeResult", "type": "str"}, - } - - _subtype_map = { - "upgrade_type": { - "AKSPatchUpgrade": "ClusterPoolAksPatchUpgradeHistoryProperties", - "NodeOsUpgrade": "ClusterPoolNodeOsUpgradeHistoryProperties", - } - } - - def __init__( - self, - *, - utc_time: str, - upgrade_result: Union[str, "_models.ClusterPoolUpgradeHistoryUpgradeResultType"], - **kwargs: Any - ) -> None: - """ - :keyword utc_time: Time when created this upgrade history. Required. - :paramtype utc_time: str - :keyword upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :paramtype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryUpgradeResultType - """ - super().__init__(**kwargs) - self.upgrade_type: Optional[str] = None - self.utc_time = utc_time - self.upgrade_result = upgrade_result - - -class ClusterPoolAksPatchUpgradeHistoryProperties(ClusterPoolUpgradeHistoryProperties): # pylint: disable=name-too-long - """Cluster pool aks upgrade history properties. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and - "NodeOsUpgrade". - :vartype upgrade_type: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryType - :ivar utc_time: Time when created this upgrade history. Required. - :vartype utc_time: str - :ivar upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :vartype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryUpgradeResultType - :ivar upgrade_cluster_pool: Whether upgrade cluster pool. - :vartype upgrade_cluster_pool: bool - :ivar upgrade_all_cluster_nodes: Whether upgrade all cluster nodes. - :vartype upgrade_all_cluster_nodes: bool - :ivar original_version: Version before update. - :vartype original_version: str - :ivar new_version: Version going to update. - :vartype new_version: str - """ - - _validation = { - "upgrade_type": {"required": True}, - "utc_time": {"required": True}, - "upgrade_result": {"required": True}, - } - - _attribute_map = { - "upgrade_type": {"key": "upgradeType", "type": "str"}, - "utc_time": {"key": "utcTime", "type": "str"}, - "upgrade_result": {"key": "upgradeResult", "type": "str"}, - "upgrade_cluster_pool": {"key": "upgradeClusterPool", "type": "bool"}, - "upgrade_all_cluster_nodes": {"key": "upgradeAllClusterNodes", "type": "bool"}, - "original_version": {"key": "originalVersion", "type": "str"}, - "new_version": {"key": "newVersion", "type": "str"}, - } - - def __init__( - self, - *, - utc_time: str, - upgrade_result: Union[str, "_models.ClusterPoolUpgradeHistoryUpgradeResultType"], - upgrade_cluster_pool: Optional[bool] = None, - upgrade_all_cluster_nodes: Optional[bool] = None, - original_version: Optional[str] = None, - new_version: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword utc_time: Time when created this upgrade history. Required. - :paramtype utc_time: str - :keyword upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :paramtype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryUpgradeResultType - :keyword upgrade_cluster_pool: Whether upgrade cluster pool. - :paramtype upgrade_cluster_pool: bool - :keyword upgrade_all_cluster_nodes: Whether upgrade all cluster nodes. - :paramtype upgrade_all_cluster_nodes: bool - :keyword original_version: Version before update. - :paramtype original_version: str - :keyword new_version: Version going to update. - :paramtype new_version: str - """ - super().__init__(utc_time=utc_time, upgrade_result=upgrade_result, **kwargs) - self.upgrade_type: str = "AKSPatchUpgrade" - self.upgrade_cluster_pool = upgrade_cluster_pool - self.upgrade_all_cluster_nodes = upgrade_all_cluster_nodes - self.original_version = original_version - self.new_version = new_version - - -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 server. - - :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): # pylint: disable=name-too-long - """Properties of upgrading cluster pool's AKS patch version. - - All required parameters must be populated in order to send to server. - - :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}". # pylint: disable=line-too-long - :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 properties: Gets or sets the properties. Define cluster pool upgrade specific properties. - :vartype properties: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolAvailableUpgradeProperties - """ - - _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"}, - "properties": {"key": "properties", "type": "ClusterPoolAvailableUpgradeProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.ClusterPoolAvailableUpgradeProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: Gets or sets the properties. Define cluster pool upgrade specific - properties. - :paramtype properties: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolAvailableUpgradeProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -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 server. - - :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 -): # pylint: disable=name-too-long - """Cluster pool available AKS patch version upgrade. - - All required parameters must be populated in order to send to server. - - :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 server. - - :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 -): # pylint: disable=name-too-long - """Cluster pool available node OS update. - - All required parameters must be populated in order to send to server. - - :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. - - 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 server. - - :ivar vm_size: The virtual machine SKU. Required. - :vartype vm_size: str - :ivar count: The number of virtual machines. - :vartype count: int - :ivar availability_zones: The list of Availability zones to use for AKS VMSS nodes. - :vartype availability_zones: list[str] - """ - - _validation = { - "vm_size": {"required": True, "pattern": r"^[a-zA-Z0-9_\-]{0,256}$"}, - "count": {"readonly": True}, - } - - _attribute_map = { - "vm_size": {"key": "vmSize", "type": "str"}, - "count": {"key": "count", "type": "int"}, - "availability_zones": {"key": "availabilityZones", "type": "[str]"}, - } - - def __init__(self, *, vm_size: str, availability_zones: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword vm_size: The virtual machine SKU. Required. - :paramtype vm_size: str - :keyword availability_zones: The list of Availability zones to use for AKS VMSS nodes. - :paramtype availability_zones: list[str] - """ - super().__init__(**kwargs) - self.vm_size = vm_size - self.count = None - self.availability_zones = availability_zones - - -class ClusterPoolListResult(_serialization.Model): - """The list cluster pools operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of cluster pools. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterPool] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ClusterPool]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.ClusterPool"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of cluster pools. - :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterPool] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ClusterPoolLogAnalyticsProfile(_serialization.Model): - """Cluster pool log analytics profile used to enable or disable OMS agent for AKS cluster. - - All required parameters must be populated in order to send to server. - - :ivar enabled: True if log analytics is enabled for cluster pool, otherwise false. Required. - :vartype enabled: bool - :ivar workspace_id: Log analytics workspace to associate with the OMS agent. - :vartype workspace_id: str - """ - - _validation = { - "enabled": {"required": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "workspace_id": {"key": "workspaceId", "type": "str"}, - } - - def __init__(self, *, enabled: bool, workspace_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword enabled: True if log analytics is enabled for cluster pool, otherwise false. Required. - :paramtype enabled: bool - :keyword workspace_id: Log analytics workspace to associate with the OMS agent. - :paramtype workspace_id: str - """ - super().__init__(**kwargs) - self.enabled = enabled - self.workspace_id = workspace_id - - -class ClusterPoolNetworkProfile(_serialization.Model): - """Cluster pool networking configuration. - - All required parameters must be populated in order to send to server. - - :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 - API server 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. Currently, - this property is not supported and please don't use it. - :vartype api_server_authorized_ip_ranges: list[str] - """ - - _validation = { - "subnet_id": {"required": True}, - } - - _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, - 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 API server 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. Currently, - this property is not supported and please don't use it. - :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 server. - - :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 ClusterPoolNodeOsUpgradeHistoryProperties(ClusterPoolUpgradeHistoryProperties): # pylint: disable=name-too-long - """Cluster pool node os upgrade history properties. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_type: Type of upgrade. Required. Known values are: "AKSPatchUpgrade" and - "NodeOsUpgrade". - :vartype upgrade_type: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryType - :ivar utc_time: Time when created this upgrade history. Required. - :vartype utc_time: str - :ivar upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :vartype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryUpgradeResultType - :ivar new_node_os: New Node Os version. - :vartype new_node_os: str - """ - - _validation = { - "upgrade_type": {"required": True}, - "utc_time": {"required": True}, - "upgrade_result": {"required": True}, - } - - _attribute_map = { - "upgrade_type": {"key": "upgradeType", "type": "str"}, - "utc_time": {"key": "utcTime", "type": "str"}, - "upgrade_result": {"key": "upgradeResult", "type": "str"}, - "new_node_os": {"key": "newNodeOs", "type": "str"}, - } - - def __init__( - self, - *, - utc_time: str, - upgrade_result: Union[str, "_models.ClusterPoolUpgradeHistoryUpgradeResultType"], - new_node_os: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword utc_time: Time when created this upgrade history. Required. - :paramtype utc_time: str - :keyword upgrade_result: Result of this upgrade. Required. Known values are: "Succeed" and - "Failed". - :paramtype upgrade_result: str or - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryUpgradeResultType - :keyword new_node_os: New Node Os version. - :paramtype new_node_os: str - """ - super().__init__(utc_time=utc_time, upgrade_result=upgrade_result, **kwargs) - self.upgrade_type: str = "NodeOsUpgrade" - self.new_node_os = new_node_os - - -class ClusterPoolProfile(_serialization.Model): - """Cluster pool profile. - - All required parameters must be populated in order to send to server. - - :ivar cluster_pool_version: Cluster pool version is a 2-part version. Required. - :vartype cluster_pool_version: str - :ivar public_ip_tag: Gets or sets the IP tag for the public IPs created along with the - HDInsightOnAks ClusterPools and Clusters. - :vartype public_ip_tag: ~azure.mgmt.hdinsightcontainers.models.IpTag - """ - - _validation = { - "cluster_pool_version": {"required": True, "pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - } - - _attribute_map = { - "cluster_pool_version": {"key": "clusterPoolVersion", "type": "str"}, - "public_ip_tag": {"key": "publicIpTag", "type": "IpTag"}, - } - - def __init__( - self, *, cluster_pool_version: str, public_ip_tag: Optional["_models.IpTag"] = None, **kwargs: Any - ) -> None: - """ - :keyword cluster_pool_version: Cluster pool version is a 2-part version. Required. - :paramtype cluster_pool_version: str - :keyword public_ip_tag: Gets or sets the IP tag for the public IPs created along with the - HDInsightOnAks ClusterPools and Clusters. - :paramtype public_ip_tag: ~azure.mgmt.hdinsightcontainers.models.IpTag - """ - super().__init__(**kwargs) - self.cluster_pool_version = cluster_pool_version - self.public_ip_tag = public_ip_tag - - -class ClusterPoolResourceProperties(_serialization.Model): - """Cluster pool resource properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Canceled", and "Failed". - :vartype provisioning_state: str or ~azure.mgmt.hdinsightcontainers.models.ProvisioningStatus - :ivar deployment_id: A unique id generated by the RP to identify the resource. - :vartype deployment_id: str - :ivar managed_resource_group_name: A resource group created by RP, to hold the resources - created by RP on-behalf of customers. It will also be used to generate - aksManagedResourceGroupName by pattern: MC\\ *{managedResourceGroupName}*\\ - {clusterPoolName}_{region}. Please make sure it meets resource group name restriction. - :vartype managed_resource_group_name: str - :ivar aks_managed_resource_group_name: A resource group created by AKS, to hold the - infrastructure resources created by AKS on-behalf of customers. It is generated by cluster pool - name and managed resource group name by pattern: MC\\ *{managedResourceGroupName}*\\ - {clusterPoolName}_{region}. - :vartype aks_managed_resource_group_name: str - :ivar cluster_pool_profile: CLuster pool profile. - :vartype cluster_pool_profile: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourcePropertiesClusterPoolProfile - :ivar compute_profile: CLuster pool compute profile. Required. - :vartype compute_profile: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourcePropertiesComputeProfile - :ivar aks_cluster_profile: Properties of underlying AKS cluster. - :vartype aks_cluster_profile: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourcePropertiesAksClusterProfile - :ivar network_profile: Cluster pool network profile. - :vartype network_profile: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourcePropertiesNetworkProfile - :ivar log_analytics_profile: Cluster pool log analytics profile to enable OMS agent for AKS - cluster. - :vartype log_analytics_profile: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourcePropertiesLogAnalyticsProfile - :ivar status: Business status of the resource. - :vartype status: str - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "deployment_id": {"readonly": True}, - "managed_resource_group_name": {"max_length": 40, "min_length": 1}, - "aks_managed_resource_group_name": {"readonly": True}, - "compute_profile": {"required": True}, - "aks_cluster_profile": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "deployment_id": {"key": "deploymentId", "type": "str"}, - "managed_resource_group_name": {"key": "managedResourceGroupName", "type": "str"}, - "aks_managed_resource_group_name": {"key": "aksManagedResourceGroupName", "type": "str"}, - "cluster_pool_profile": { - "key": "clusterPoolProfile", - "type": "ClusterPoolResourcePropertiesClusterPoolProfile", - }, - "compute_profile": {"key": "computeProfile", "type": "ClusterPoolResourcePropertiesComputeProfile"}, - "aks_cluster_profile": {"key": "aksClusterProfile", "type": "ClusterPoolResourcePropertiesAksClusterProfile"}, - "network_profile": {"key": "networkProfile", "type": "ClusterPoolResourcePropertiesNetworkProfile"}, - "log_analytics_profile": { - "key": "logAnalyticsProfile", - "type": "ClusterPoolResourcePropertiesLogAnalyticsProfile", - }, - "status": {"key": "status", "type": "str"}, - } - - def __init__( - self, - *, - compute_profile: "_models.ClusterPoolResourcePropertiesComputeProfile", - managed_resource_group_name: Optional[str] = None, - cluster_pool_profile: Optional["_models.ClusterPoolResourcePropertiesClusterPoolProfile"] = None, - network_profile: Optional["_models.ClusterPoolResourcePropertiesNetworkProfile"] = None, - log_analytics_profile: Optional["_models.ClusterPoolResourcePropertiesLogAnalyticsProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword managed_resource_group_name: A resource group created by RP, to hold the resources - created by RP on-behalf of customers. It will also be used to generate - aksManagedResourceGroupName by pattern: MC\\ *{managedResourceGroupName}*\\ - {clusterPoolName}_{region}. Please make sure it meets resource group name restriction. - :paramtype managed_resource_group_name: str - :keyword cluster_pool_profile: CLuster pool profile. - :paramtype cluster_pool_profile: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourcePropertiesClusterPoolProfile - :keyword compute_profile: CLuster pool compute profile. Required. - :paramtype compute_profile: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourcePropertiesComputeProfile - :keyword network_profile: Cluster pool network profile. - :paramtype network_profile: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourcePropertiesNetworkProfile - :keyword log_analytics_profile: Cluster pool log analytics profile to enable OMS agent for AKS - cluster. - :paramtype log_analytics_profile: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolResourcePropertiesLogAnalyticsProfile - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.deployment_id = None - self.managed_resource_group_name = managed_resource_group_name - self.aks_managed_resource_group_name = None - self.cluster_pool_profile = cluster_pool_profile - self.compute_profile = compute_profile - self.aks_cluster_profile = None - self.network_profile = network_profile - self.log_analytics_profile = log_analytics_profile - self.status = None - - -class ClusterPoolResourcePropertiesAksClusterProfile(AksClusterProfile): # pylint: disable=name-too-long - """Properties of underlying AKS cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar aks_cluster_resource_id: ARM Resource ID of the AKS cluster. - :vartype aks_cluster_resource_id: str - :ivar aks_cluster_agent_pool_identity_profile: Identity properties of the AKS cluster agentpool - MSI. - :vartype aks_cluster_agent_pool_identity_profile: - ~azure.mgmt.hdinsightcontainers.models.AksClusterProfileAksClusterAgentPoolIdentityProfile - :ivar aks_version: AKS control plane and default node pool version of this ClusterPool. - :vartype aks_version: str - """ - - -class ClusterPoolResourcePropertiesClusterPoolProfile(ClusterPoolProfile): # pylint: disable=name-too-long - """CLuster pool profile. - - All required parameters must be populated in order to send to server. - - :ivar cluster_pool_version: Cluster pool version is a 2-part version. Required. - :vartype cluster_pool_version: str - :ivar public_ip_tag: Gets or sets the IP tag for the public IPs created along with the - HDInsightOnAks ClusterPools and Clusters. - :vartype public_ip_tag: ~azure.mgmt.hdinsightcontainers.models.IpTag - """ - - -class ClusterPoolResourcePropertiesComputeProfile(ClusterPoolComputeProfile): # pylint: disable=name-too-long - """CLuster pool compute 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 server. - - :ivar vm_size: The virtual machine SKU. Required. - :vartype vm_size: str - :ivar count: The number of virtual machines. - :vartype count: int - :ivar availability_zones: The list of Availability zones to use for AKS VMSS nodes. - :vartype availability_zones: list[str] - """ - - -class ClusterPoolResourcePropertiesLogAnalyticsProfile(ClusterPoolLogAnalyticsProfile): # pylint: disable=name-too-long - """Cluster pool log analytics profile to enable OMS agent for AKS cluster. - - All required parameters must be populated in order to send to server. - - :ivar enabled: True if log analytics is enabled for cluster pool, otherwise false. Required. - :vartype enabled: bool - :ivar workspace_id: Log analytics workspace to associate with the OMS agent. - :vartype workspace_id: str - """ - - -class ClusterPoolResourcePropertiesNetworkProfile(ClusterPoolNetworkProfile): # pylint: disable=name-too-long - """Cluster pool network profile. - - All required parameters must be populated in order to send to server. - - :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 - API server 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. Currently, - this property is not supported and please don't use it. - :vartype api_server_authorized_ip_ranges: list[str] - """ - - -class ClusterPoolUpgrade(_serialization.Model): - """Cluster Pool Upgrade. - - All required parameters must be populated in order to send to server. - - :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__(**kwargs) - self.properties = properties - - -class ClusterPoolUpgradeHistory(ProxyResource): - """Cluster pool upgrade history. - - 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 server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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 properties: Properties of cluster pool upgrade history. Required. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "properties": {"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"}, - "properties": {"key": "properties", "type": "ClusterPoolUpgradeHistoryProperties"}, - } - - def __init__(self, *, properties: "_models.ClusterPoolUpgradeHistoryProperties", **kwargs: Any) -> None: - """ - :keyword properties: Properties of cluster pool upgrade history. Required. - :paramtype properties: - ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistoryProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ClusterPoolUpgradeHistoryListResult(_serialization.Model): - """Represents a list of cluster pool upgrade history. - - 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 server. - - :ivar value: The list of cluster pool upgrade history. Required. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistory] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ClusterPoolUpgradeHistory]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.ClusterPoolUpgradeHistory"], **kwargs: Any) -> None: - """ - :keyword value: The list of cluster pool upgrade history. Required. - :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistory] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ClusterPoolVersion(ProxyResource): - """Available cluster pool version. - - 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}". # pylint: disable=line-too-long - :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 properties: Cluster pool version properties. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolVersionProperties - """ - - _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"}, - "properties": {"key": "properties", "type": "ClusterPoolVersionProperties"}, - } - - def __init__(self, *, properties: Optional["_models.ClusterPoolVersionProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: Cluster pool version properties. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolVersionProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ClusterPoolVersionProperties(_serialization.Model): - """Cluster pool version properties. - - :ivar cluster_pool_version: Cluster pool version is a 2-part version. - :vartype cluster_pool_version: str - :ivar aks_version: AKS version. - :vartype aks_version: str - :ivar is_preview: Indicate if this version is in preview or not. - :vartype is_preview: bool - """ - - _validation = { - "cluster_pool_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - } - - _attribute_map = { - "cluster_pool_version": {"key": "clusterPoolVersion", "type": "str"}, - "aks_version": {"key": "aksVersion", "type": "str"}, - "is_preview": {"key": "isPreview", "type": "bool"}, - } - - def __init__( - self, - *, - cluster_pool_version: Optional[str] = None, - aks_version: Optional[str] = None, - is_preview: bool = False, - **kwargs: Any - ) -> None: - """ - :keyword cluster_pool_version: Cluster pool version is a 2-part version. - :paramtype cluster_pool_version: str - :keyword aks_version: AKS version. - :paramtype aks_version: str - :keyword is_preview: Indicate if this version is in preview or not. - :paramtype is_preview: bool - """ - super().__init__(**kwargs) - self.cluster_pool_version = cluster_pool_version - self.aks_version = aks_version - self.is_preview = is_preview - - -class ClusterPoolVersionsListResult(_serialization.Model): - """Represents a list of cluster pool versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of cluster pool versions. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterPoolVersion] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ClusterPoolVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.ClusterPoolVersion"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of cluster pool versions. - :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterPoolVersion] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ClusterProfile(_serialization.Model): # pylint: disable=too-many-instance-attributes - """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 server. - - :ivar cluster_version: Version with 3/4 part. Required. - :vartype cluster_version: str - :ivar oss_version: Version with three part. Required. - :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: This is deprecated. Please use managed identity profile instead. - :vartype identity_profile: ~azure.mgmt.hdinsightcontainers.models.IdentityProfile - :ivar managed_identity_profile: This property is required by Trino, Spark and Flink cluster but - is optional for Kafka cluster. - :vartype managed_identity_profile: - ~azure.mgmt.hdinsightcontainers.models.ManagedIdentityProfile - :ivar authorization_profile: Authorization profile with details of AAD user Ids and group Ids - authorized for data plane access. Required. - :vartype authorization_profile: ~azure.mgmt.hdinsightcontainers.models.AuthorizationProfile - :ivar secrets_profile: The cluster secret profile. - :vartype secrets_profile: ~azure.mgmt.hdinsightcontainers.models.SecretsProfile - :ivar service_configs_profiles: The service configs profiles. - :vartype service_configs_profiles: - 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: - ~azure.mgmt.hdinsightcontainers.models.ClusterLogAnalyticsProfile - :ivar prometheus_profile: Cluster Prometheus profile. - :vartype prometheus_profile: ~azure.mgmt.hdinsightcontainers.models.ClusterPrometheusProfile - :ivar ssh_profile: Ssh profile for the cluster. - :vartype ssh_profile: ~azure.mgmt.hdinsightcontainers.models.SshProfile - :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 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. - :vartype llap_profile: dict[str, any] - :ivar flink_profile: The Flink cluster profile. - :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. - :vartype script_action_profiles: - list[~azure.mgmt.hdinsightcontainers.models.ScriptActionProfile] - """ - - _validation = { - "cluster_version": { - "required": True, - "pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})(?:\.(0|[1-9][0-9]{0,18}))?$", - }, - "oss_version": { - "required": True, - "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}, - "authorization_profile": {"required": True}, - "connectivity_profile": {"readonly": True}, - } - - _attribute_map = { - "cluster_version": {"key": "clusterVersion", "type": "str"}, - "oss_version": {"key": "ossVersion", "type": "str"}, - "components": {"key": "components", "type": "[ClusterComponentsItem]"}, - "identity_profile": {"key": "identityProfile", "type": "IdentityProfile"}, - "managed_identity_profile": {"key": "managedIdentityProfile", "type": "ManagedIdentityProfile"}, - "authorization_profile": {"key": "authorizationProfile", "type": "AuthorizationProfile"}, - "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"}, - "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]"}, - } - - def __init__( - self, - *, - cluster_version: str, - oss_version: str, - authorization_profile: "_models.AuthorizationProfile", - identity_profile: Optional["_models.IdentityProfile"] = None, - managed_identity_profile: Optional["_models.ManagedIdentityProfile"] = 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, - 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 - ) -> None: - """ - :keyword cluster_version: Version with 3/4 part. Required. - :paramtype cluster_version: str - :keyword oss_version: Version with three part. Required. - :paramtype oss_version: str - :keyword identity_profile: This is deprecated. Please use managed identity profile instead. - :paramtype identity_profile: ~azure.mgmt.hdinsightcontainers.models.IdentityProfile - :keyword managed_identity_profile: This property is required by Trino, Spark and Flink cluster - but is optional for Kafka cluster. - :paramtype managed_identity_profile: - ~azure.mgmt.hdinsightcontainers.models.ManagedIdentityProfile - :keyword authorization_profile: Authorization profile with details of AAD user Ids and group - Ids authorized for data plane access. Required. - :paramtype authorization_profile: ~azure.mgmt.hdinsightcontainers.models.AuthorizationProfile - :keyword secrets_profile: The cluster secret profile. - :paramtype secrets_profile: ~azure.mgmt.hdinsightcontainers.models.SecretsProfile - :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: - ~azure.mgmt.hdinsightcontainers.models.ClusterLogAnalyticsProfile - :keyword prometheus_profile: Cluster Prometheus profile. - :paramtype prometheus_profile: ~azure.mgmt.hdinsightcontainers.models.ClusterPrometheusProfile - :keyword ssh_profile: Ssh profile for the cluster. - :paramtype ssh_profile: ~azure.mgmt.hdinsightcontainers.models.SshProfile - :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 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. - :paramtype llap_profile: dict[str, any] - :keyword flink_profile: The Flink cluster profile. - :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. - :paramtype script_action_profiles: - list[~azure.mgmt.hdinsightcontainers.models.ScriptActionProfile] - """ - super().__init__(**kwargs) - self.cluster_version = cluster_version - self.oss_version = oss_version - self.components = None - self.identity_profile = identity_profile - self.managed_identity_profile = managed_identity_profile - self.authorization_profile = authorization_profile - 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. - - All required parameters must be populated in order to send to server. - - :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 server. - - :ivar enabled: Enable Ranger 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 Ranger for cluster or not. Required. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ClusterResizeData(TrackedResource): - """The parameters for resizing 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 server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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. - :vartype location: str - :ivar properties: Sets the properties. Define cluster resize specific properties. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterResizeProperties - """ - - _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"}, - "properties": {"key": "properties", "type": "ClusterResizeProperties"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.ClusterResizeProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: Sets the properties. Define cluster resize specific properties. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterResizeProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -class ClusterResizeProperties(_serialization.Model): - """The properties for resizing a cluster. - - All required parameters must be populated in order to send to server. - - :ivar target_worker_node_count: Target node count of worker node. Required. - :vartype target_worker_node_count: int - """ - - _validation = { - "target_worker_node_count": {"required": True}, - } - - _attribute_map = { - "target_worker_node_count": {"key": "targetWorkerNodeCount", "type": "int"}, - } - - def __init__(self, *, target_worker_node_count: int, **kwargs: Any) -> None: - """ - :keyword target_worker_node_count: Target node count of worker node. Required. - :paramtype target_worker_node_count: int - """ - super().__init__(**kwargs) - self.target_worker_node_count = target_worker_node_count - - -class ClusterResourceProperties(_serialization.Model): - """Cluster resource properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Canceled", and "Failed". - :vartype provisioning_state: str or ~azure.mgmt.hdinsightcontainers.models.ProvisioningStatus - :ivar cluster_type: The type of cluster. Required. - :vartype cluster_type: str - :ivar deployment_id: A unique id generated by the RP to identify the resource. - :vartype deployment_id: str - :ivar compute_profile: The compute profile. Required. - :vartype compute_profile: ~azure.mgmt.hdinsightcontainers.models.ComputeProfile - :ivar cluster_profile: Cluster profile. Required. - :vartype cluster_profile: ~azure.mgmt.hdinsightcontainers.models.ClusterProfile - :ivar status: Business status of the resource. - :vartype status: str - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "cluster_type": {"required": True, "pattern": r"^[a-zA-Z][a-zA-Z0-9]{0,31}$"}, - "deployment_id": {"readonly": True}, - "compute_profile": {"required": True}, - "cluster_profile": {"required": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "cluster_type": {"key": "clusterType", "type": "str"}, - "deployment_id": {"key": "deploymentId", "type": "str"}, - "compute_profile": {"key": "computeProfile", "type": "ComputeProfile"}, - "cluster_profile": {"key": "clusterProfile", "type": "ClusterProfile"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__( - self, - *, - cluster_type: str, - compute_profile: "_models.ComputeProfile", - cluster_profile: "_models.ClusterProfile", - **kwargs: Any - ) -> None: - """ - :keyword cluster_type: The type of cluster. Required. - :paramtype cluster_type: str - :keyword compute_profile: The compute profile. Required. - :paramtype compute_profile: ~azure.mgmt.hdinsightcontainers.models.ComputeProfile - :keyword cluster_profile: Cluster profile. Required. - :paramtype cluster_profile: ~azure.mgmt.hdinsightcontainers.models.ClusterProfile - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.cluster_type = cluster_type - self.deployment_id = None - self.compute_profile = compute_profile - self.cluster_profile = cluster_profile - self.status = None - - -class ClusterServiceConfig(_serialization.Model): - """Cluster configs per component. - - All required parameters must be populated in order to send to server. - - :ivar component: Name of the component the config files should apply to. Required. - :vartype component: str - :ivar files: List of Config Files. Required. - :vartype files: list[~azure.mgmt.hdinsightcontainers.models.ClusterConfigFile] - """ - - _validation = { - "component": {"required": True}, - "files": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "files": {"key": "files", "type": "[ClusterConfigFile]"}, - } - - def __init__(self, *, component: str, files: List["_models.ClusterConfigFile"], **kwargs: Any) -> None: - """ - :keyword component: Name of the component the config files should apply to. Required. - :paramtype component: str - :keyword files: List of Config Files. Required. - :paramtype files: list[~azure.mgmt.hdinsightcontainers.models.ClusterConfigFile] - """ - super().__init__(**kwargs) - self.component = component - self.files = files - - -class ClusterServiceConfigsProfile(_serialization.Model): - """Cluster service configs. - - All required parameters must be populated in order to send to server. - - :ivar service_name: Name of the service the configurations should apply to. Required. - :vartype service_name: str - :ivar configs: List of service configs. Required. - :vartype configs: list[~azure.mgmt.hdinsightcontainers.models.ClusterServiceConfig] - """ - - _validation = { - "service_name": {"required": True}, - "configs": {"required": True}, - } - - _attribute_map = { - "service_name": {"key": "serviceName", "type": "str"}, - "configs": {"key": "configs", "type": "[ClusterServiceConfig]"}, - } - - def __init__(self, *, service_name: str, configs: List["_models.ClusterServiceConfig"], **kwargs: Any) -> None: - """ - :keyword service_name: Name of the service the configurations should apply to. Required. - :paramtype service_name: str - :keyword configs: List of service configs. Required. - :paramtype configs: list[~azure.mgmt.hdinsightcontainers.models.ClusterServiceConfig] - """ - super().__init__(**kwargs) - self.service_name = service_name - self.configs = configs - - -class ClusterUpgrade(_serialization.Model): - """Cluster Upgrade. - - All required parameters must be populated in order to send to server. - - :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 ClusterUpgradeHistory(ProxyResource): - """Cluster upgrade history. - - 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 server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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 properties: Properties of cluster upgrade history. Required. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "properties": {"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"}, - "properties": {"key": "properties", "type": "ClusterUpgradeHistoryProperties"}, - } - - def __init__(self, *, properties: "_models.ClusterUpgradeHistoryProperties", **kwargs: Any) -> None: - """ - :keyword properties: Properties of cluster upgrade history. Required. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistoryProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ClusterUpgradeHistoryListResult(_serialization.Model): - """Represents a list of cluster upgrade history. - - 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 server. - - :ivar value: The list of cluster upgrade history. Required. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistory] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ClusterUpgradeHistory]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.ClusterUpgradeHistory"], **kwargs: Any) -> None: - """ - :keyword value: The list of cluster upgrade history. Required. - :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistory] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ClusterUpgradeRollback(_serialization.Model): - """Cluster Upgrade. - - All required parameters must be populated in order to send to server. - - :ivar properties: Properties for manual rollback of cluster's upgrade. Required. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeRollbackProperties - """ - - _validation = { - "properties": {"required": True}, - } - - _attribute_map = { - "properties": {"key": "properties", "type": "ClusterUpgradeRollbackProperties"}, - } - - def __init__(self, *, properties: "_models.ClusterUpgradeRollbackProperties", **kwargs: Any) -> None: - """ - :keyword properties: Properties for manual rollback of cluster's upgrade. Required. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeRollbackProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ClusterUpgradeRollbackProperties(_serialization.Model): - """Properties for manual rollback of cluster's upgrade. - - All required parameters must be populated in order to send to server. - - :ivar upgrade_history: A specific upgrade history to rollback. Required. - :vartype upgrade_history: str - """ - - _validation = { - "upgrade_history": {"required": True}, - } - - _attribute_map = { - "upgrade_history": {"key": "upgradeHistory", "type": "str"}, - } - - def __init__(self, *, upgrade_history: str, **kwargs: Any) -> None: - """ - :keyword upgrade_history: A specific upgrade history to rollback. Required. - :paramtype upgrade_history: str - """ - super().__init__(**kwargs) - self.upgrade_history = upgrade_history - - -class ClusterVersion(ProxyResource): - """Available cluster version. - - 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}". # pylint: disable=line-too-long - :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 properties: Cluster version properties. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterVersionProperties - """ - - _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"}, - "properties": {"key": "properties", "type": "ClusterVersionProperties"}, - } - - def __init__(self, *, properties: Optional["_models.ClusterVersionProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: Cluster version properties. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ClusterVersionProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ClusterVersionProperties(_serialization.Model): - """Cluster version properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_type: The type of cluster. - :vartype cluster_type: str - :ivar cluster_version: Version with three part. - :vartype cluster_version: str - :ivar oss_version: Version with three part. - :vartype oss_version: str - :ivar cluster_pool_version: The two part cluster pool version. If the cluster version is before - cluster pool version on-board, the return value will be empty string. - :vartype cluster_pool_version: str - :ivar is_preview: Indicate if this version is in preview or not. - :vartype is_preview: bool - :ivar components: Component list of this cluster type and version. - :vartype components: list[~azure.mgmt.hdinsightcontainers.models.ClusterComponentsItem] - """ - - _validation = { - "cluster_type": {"pattern": r"^[a-zA-Z][a-zA-Z0-9]{0,31}$"}, - "cluster_version": {"pattern": r"^(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})$"}, - "oss_version": {"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}, - } - - _attribute_map = { - "cluster_type": {"key": "clusterType", "type": "str"}, - "cluster_version": {"key": "clusterVersion", "type": "str"}, - "oss_version": {"key": "ossVersion", "type": "str"}, - "cluster_pool_version": {"key": "clusterPoolVersion", "type": "str"}, - "is_preview": {"key": "isPreview", "type": "bool"}, - "components": {"key": "components", "type": "[ClusterComponentsItem]"}, - } - - def __init__( - self, - *, - cluster_type: Optional[str] = None, - cluster_version: Optional[str] = None, - oss_version: Optional[str] = None, - cluster_pool_version: Optional[str] = None, - is_preview: bool = False, - **kwargs: Any - ) -> None: - """ - :keyword cluster_type: The type of cluster. - :paramtype cluster_type: str - :keyword cluster_version: Version with three part. - :paramtype cluster_version: str - :keyword oss_version: Version with three part. - :paramtype oss_version: str - :keyword cluster_pool_version: The two part cluster pool version. If the cluster version is - before cluster pool version on-board, the return value will be empty string. - :paramtype cluster_pool_version: str - :keyword is_preview: Indicate if this version is in preview or not. - :paramtype is_preview: bool - """ - super().__init__(**kwargs) - self.cluster_type = cluster_type - self.cluster_version = cluster_version - self.oss_version = oss_version - self.cluster_pool_version = cluster_pool_version - self.is_preview = is_preview - self.components = None - - -class ClusterVersionsListResult(_serialization.Model): - """Represents a list of cluster versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of cluster versions. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterVersion] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ClusterVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.ClusterVersion"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of cluster versions. - :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ClusterVersion] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ComparisonRule(_serialization.Model): - """The comparison rule. - - All required parameters must be populated in order to send to server. - - :ivar operator: The comparison operator. Required. Known values are: "greaterThan", - "greaterThanOrEqual", "lessThan", and "lessThanOrEqual". - :vartype operator: str or ~azure.mgmt.hdinsightcontainers.models.ComparisonOperator - :ivar threshold: Threshold setting. Required. - :vartype threshold: float - """ - - _validation = { - "operator": {"required": True}, - "threshold": {"required": True}, - } - - _attribute_map = { - "operator": {"key": "operator", "type": "str"}, - "threshold": {"key": "threshold", "type": "float"}, - } - - def __init__(self, *, operator: Union[str, "_models.ComparisonOperator"], threshold: float, **kwargs: Any) -> None: - """ - :keyword operator: The comparison operator. Required. Known values are: "greaterThan", - "greaterThanOrEqual", "lessThan", and "lessThanOrEqual". - :paramtype operator: str or ~azure.mgmt.hdinsightcontainers.models.ComparisonOperator - :keyword threshold: Threshold setting. Required. - :paramtype threshold: float - """ - super().__init__(**kwargs) - self.operator = operator - self.threshold = threshold - - -class ComputeProfile(_serialization.Model): - """The compute profile. - - All required parameters must be populated in order to send to server. - - :ivar nodes: The nodes definitions. Required. - :vartype nodes: list[~azure.mgmt.hdinsightcontainers.models.NodeProfile] - :ivar availability_zones: The list of Availability zones to use for AKS VMSS nodes. - :vartype availability_zones: list[str] - """ - - _validation = { - "nodes": {"required": True}, - } - - _attribute_map = { - "nodes": {"key": "nodes", "type": "[NodeProfile]"}, - "availability_zones": {"key": "availabilityZones", "type": "[str]"}, - } - - def __init__( - self, *, nodes: List["_models.NodeProfile"], availability_zones: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword nodes: The nodes definitions. Required. - :paramtype nodes: list[~azure.mgmt.hdinsightcontainers.models.NodeProfile] - :keyword availability_zones: The list of Availability zones to use for AKS VMSS nodes. - :paramtype availability_zones: list[str] - """ - super().__init__(**kwargs) - self.nodes = nodes - self.availability_zones = availability_zones - - -class ComputeResourceDefinition(_serialization.Model): - """The cpu and memory requirement definition. - - All required parameters must be populated in order to send to server. - - :ivar cpu: The required CPU. Required. - :vartype cpu: float - :ivar memory: The required memory in MB, Container memory will be 110 percentile. Required. - :vartype memory: int - """ - - _validation = { - "cpu": {"required": True}, - "memory": {"required": True}, - } - - _attribute_map = { - "cpu": {"key": "cpu", "type": "float"}, - "memory": {"key": "memory", "type": "int"}, - } - - def __init__(self, *, cpu: float, memory: int, **kwargs: Any) -> None: - """ - :keyword cpu: The required CPU. Required. - :paramtype cpu: float - :keyword memory: The required memory in MB, Container memory will be 110 percentile. Required. - :paramtype memory: int - """ - super().__init__(**kwargs) - self.cpu = cpu - self.memory = memory - - -class ConnectivityProfile(_serialization.Model): - """Cluster connectivity profile. - - All required parameters must be populated in order to send to server. - - :ivar web: Web connectivity endpoint details. Required. - :vartype web: ~azure.mgmt.hdinsightcontainers.models.ConnectivityProfileWeb - :ivar ssh: List of SSH connectivity endpoints. - :vartype ssh: list[~azure.mgmt.hdinsightcontainers.models.SshConnectivityEndpoint] - """ - - _validation = { - "web": {"required": True}, - } - - _attribute_map = { - "web": {"key": "web", "type": "ConnectivityProfileWeb"}, - "ssh": {"key": "ssh", "type": "[SshConnectivityEndpoint]"}, - } - - def __init__( - self, - *, - web: "_models.ConnectivityProfileWeb", - ssh: Optional[List["_models.SshConnectivityEndpoint"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword web: Web connectivity endpoint details. Required. - :paramtype web: ~azure.mgmt.hdinsightcontainers.models.ConnectivityProfileWeb - :keyword ssh: List of SSH connectivity endpoints. - :paramtype ssh: list[~azure.mgmt.hdinsightcontainers.models.SshConnectivityEndpoint] - """ - super().__init__(**kwargs) - self.web = web - self.ssh = ssh - - -class WebConnectivityEndpoint(_serialization.Model): - """Web connectivity endpoint details. - - All required parameters must be populated in order to send to server. - - :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 = { - "fqdn": {"required": True}, - } - - _attribute_map = { - "fqdn": {"key": "fqdn", "type": "str"}, - "private_fqdn": {"key": "privateFqdn", "type": "str"}, - } - - 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): - """Web connectivity endpoint details. - - All required parameters must be populated in order to send to server. - - :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 - """ - - -class DiskStorageProfile(_serialization.Model): - """Kafka disk storage profile. - - All required parameters must be populated in order to send to server. - - :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: - """ - :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): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.hdinsightcontainers.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.hdinsightcontainers.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.hdinsightcontainers.models.ErrorDetail - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.hdinsightcontainers.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class FlinkCatalogOptions(_serialization.Model): - """Flink cluster catalog options. - - :ivar hive: Hive Catalog Option for Flink cluster. - :vartype hive: ~azure.mgmt.hdinsightcontainers.models.FlinkHiveCatalogOption - """ - - _attribute_map = { - "hive": {"key": "hive", "type": "FlinkHiveCatalogOption"}, - } - - def __init__(self, *, hive: Optional["_models.FlinkHiveCatalogOption"] = None, **kwargs: Any) -> None: - """ - :keyword hive: Hive Catalog Option for Flink cluster. - :paramtype hive: ~azure.mgmt.hdinsightcontainers.models.FlinkHiveCatalogOption - """ - super().__init__(**kwargs) - self.hive = hive - - -class FlinkHiveCatalogOption(_serialization.Model): - """Hive Catalog Option for Flink cluster. - - All required parameters must be populated in order to send to server. - - :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. # pylint: disable=line-too-long - 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. - :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. - :vartype metastore_db_connection_user_name: str - """ - - _validation = { - "metastore_db_connection_url": {"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"}, - } - - def __init__( - self, - *, - metastore_db_connection_url: 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. # pylint: disable=line-too-long - 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. - :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. - :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 server. - - :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. If not - specified, the entry point is auto-detected from the flink job jar package. - :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, UPDATE, - 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. If - not specified, the entry point is auto-detected from the flink job jar package. - :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, UPDATE, - 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. - - 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 server. - - :ivar job_type: Type of cluster job. Required. "FlinkJob" - :vartype job_type: str or ~azure.mgmt.hdinsightcontainers.models.JobType - :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. - :vartype job_jar_directory: str - :ivar jar_name: A string property that represents the name of the job JAR. - :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 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", "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 - key-value pairs as properties, where the keys are strings and the values are strings as well. - :vartype flink_configuration: dict[str, str] - :ivar job_id: Unique id for identifying a job. - :vartype job_id: str - :ivar status: Status of job. - :vartype status: str - :ivar job_output: Output of job. - :vartype job_output: str - :ivar action_result: Action result of job. - :vartype action_result: str - :ivar last_save_point: The last savepoint. - :vartype last_save_point: str - """ - - _validation = { - "job_type": {"required": True}, - "job_id": {"readonly": True}, - "status": {"readonly": True}, - "job_output": {"readonly": True}, - "action_result": {"readonly": True}, - "last_save_point": {"readonly": True}, - } - - _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"}, - "entry_class": {"key": "entryClass", "type": "str"}, - "args": {"key": "args", "type": "str"}, - "save_point_name": {"key": "savePointName", "type": "str"}, - "action": {"key": "action", "type": "str"}, - "flink_configuration": {"key": "flinkConfiguration", "type": "{str}"}, - "job_id": {"key": "jobId", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "job_output": {"key": "jobOutput", "type": "str"}, - "action_result": {"key": "actionResult", "type": "str"}, - "last_save_point": {"key": "lastSavePoint", "type": "str"}, - } - - def __init__( - self, - *, - 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, - args: Optional[str] = None, - save_point_name: Optional[str] = None, - action: Optional[Union[str, "_models.Action"]] = None, - flink_configuration: Optional[Dict[str, str]] = None, - **kwargs: Any - ) -> None: - """ - :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. - :paramtype job_jar_directory: str - :keyword jar_name: A string property that represents the name of the job JAR. - :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 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", "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 - key-value pairs as properties, where the keys are strings and the values are strings as well. - :paramtype flink_configuration: dict[str, str] - """ - 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 - self.entry_class = entry_class - self.args = args - self.save_point_name = save_point_name - self.action = action - self.flink_configuration = flink_configuration - self.job_id = None - self.status = None - self.job_output = None - self.action_result = None - self.last_save_point = None - - -class FlinkProfile(_serialization.Model): - """The Flink cluster profile. - - All required parameters must be populated in order to send to server. - - :ivar storage: The storage profile. Required. - :vartype storage: ~azure.mgmt.hdinsightcontainers.models.FlinkStorageProfile - :ivar num_replicas: The number of task managers. - :vartype num_replicas: int - :ivar job_manager: Job Manager container/ process CPU and memory requirements. Required. - :vartype job_manager: ~azure.mgmt.hdinsightcontainers.models.ComputeResourceDefinition - :ivar history_server: History Server container/ process CPU and memory requirements. - :vartype history_server: ~azure.mgmt.hdinsightcontainers.models.ComputeResourceDefinition - :ivar task_manager: Task Manager container/ process CPU and memory requirements. Required. - :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 = { - "storage": {"required": True}, - "job_manager": {"required": True}, - "task_manager": {"required": True}, - } - - _attribute_map = { - "storage": {"key": "storage", "type": "FlinkStorageProfile"}, - "num_replicas": {"key": "numReplicas", "type": "int"}, - "job_manager": {"key": "jobManager", "type": "ComputeResourceDefinition"}, - "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__( - self, - *, - storage: "_models.FlinkStorageProfile", - job_manager: "_models.ComputeResourceDefinition", - task_manager: "_models.ComputeResourceDefinition", - 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: - """ - :keyword storage: The storage profile. Required. - :paramtype storage: ~azure.mgmt.hdinsightcontainers.models.FlinkStorageProfile - :keyword num_replicas: The number of task managers. - :paramtype num_replicas: int - :keyword job_manager: Job Manager container/ process CPU and memory requirements. Required. - :paramtype job_manager: ~azure.mgmt.hdinsightcontainers.models.ComputeResourceDefinition - :keyword history_server: History Server container/ process CPU and memory requirements. - :paramtype history_server: ~azure.mgmt.hdinsightcontainers.models.ComputeResourceDefinition - :keyword task_manager: Task Manager container/ process CPU and memory requirements. Required. - :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 - self.num_replicas = num_replicas - self.job_manager = job_manager - 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): - """The storage profile. - - All required parameters must be populated in order to send to server. - - :ivar storage_uri: Storage account uri which is used for savepoint and checkpoint state. - Required. - :vartype storage_uri: str - :ivar storagekey: Storage key is only required for wasb(s) storage. - :vartype storagekey: str - """ - - _validation = { - "storage_uri": {"required": True, "pattern": r"^(\w{4,5})://(.*)@(.*).\b(blob|dfs)\b.*$"}, - } - - _attribute_map = { - "storage_uri": {"key": "storageUri", "type": "str"}, - "storagekey": {"key": "storagekey", "type": "str"}, - } - - def __init__(self, *, storage_uri: str, storagekey: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword storage_uri: Storage account uri which is used for savepoint and checkpoint state. - Required. - :paramtype storage_uri: str - :keyword storagekey: Storage key is only required for wasb(s) storage. - :paramtype storagekey: str - """ - super().__init__(**kwargs) - self.storage_uri = storage_uri - self.storagekey = storagekey - - -class HiveCatalogOption(_serialization.Model): - """Hive Catalog Option. - - All required parameters must be populated in order to send to server. - - :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. # pylint: disable=line-too-long - 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. - :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. - :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: - https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri. - Required. - :vartype metastore_warehouse_dir: str - """ - - _validation = { - "catalog_name": {"required": True, "min_length": 1}, - "metastore_db_connection_url": {"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"}, - "metastore_warehouse_dir": {"key": "metastoreWarehouseDir", "type": "str"}, - } - - def __init__( - self, - *, - catalog_name: str, - metastore_db_connection_url: 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. # pylint: disable=line-too-long - 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. - :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. - :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: - https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri. - Required. - :paramtype metastore_warehouse_dir: str - """ - 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 IpTag(_serialization.Model): - """Contains the IpTag associated with the public IP address. - - All required parameters must be populated in order to send to server. - - :ivar ip_tag_type: Gets or sets the ipTag type: Example FirstPartyUsage. Required. - :vartype ip_tag_type: str - :ivar tag: Gets or sets value of the IpTag associated with the public IP. Example HDInsight, - SQL, Storage etc. Required. - :vartype tag: str - """ - - _validation = { - "ip_tag_type": {"required": True}, - "tag": {"required": True}, - } - - _attribute_map = { - "ip_tag_type": {"key": "ipTagType", "type": "str"}, - "tag": {"key": "tag", "type": "str"}, - } - - def __init__(self, *, ip_tag_type: str, tag: str, **kwargs: Any) -> None: - """ - :keyword ip_tag_type: Gets or sets the ipTag type: Example FirstPartyUsage. Required. - :paramtype ip_tag_type: str - :keyword tag: Gets or sets value of the IpTag associated with the public IP. Example HDInsight, - SQL, Storage etc. Required. - :paramtype tag: str - """ - super().__init__(**kwargs) - self.ip_tag_type = ip_tag_type - self.tag = tag - - -class KafkaConnectivityEndpoints(_serialization.Model): - """Kafka bootstrap server and broker related connectivity endpoints. - - :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 server. - - :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 connectivity_endpoints: Kafka bootstrap server and brokers related connectivity - endpoints. - :vartype connectivity_endpoints: - ~azure.mgmt.hdinsightcontainers.models.KafkaConnectivityEndpoints - """ - - _validation = { - "remote_storage_uri": {"pattern": r"^(https?|abfss?):\/\/[^/]+(?:\/|$)"}, - "disk_storage": {"required": True}, - "connectivity_endpoints": {"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"}, - "connectivity_endpoints": {"key": "connectivityEndpoints", "type": "KafkaConnectivityEndpoints"}, - } - - 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.connectivity_endpoints = None - - -class LoadBasedConfig(_serialization.Model): - """Profile of load based Autoscale. - - All required parameters must be populated in order to send to server. - - :ivar min_nodes: User needs to set the minimum number of nodes for load based scaling, the load - based scaling will use this to scale up and scale down between minimum and maximum number of - nodes. Required. - :vartype min_nodes: int - :ivar max_nodes: User needs to set the maximum number of nodes for load based scaling, the load - based scaling will use this to scale up and scale down between minimum and maximum number of - nodes. Required. - :vartype max_nodes: int - :ivar poll_interval: User can specify the poll interval, this is the time period (in seconds) - after which scaling metrics are polled for triggering a scaling operation. - :vartype poll_interval: int - :ivar cooldown_period: This is a cool down period, this is a time period in seconds, which - determines the amount of time that must elapse between a scaling activity started by a rule and - the start of the next scaling activity, regardless of the rule that triggers it. The default - value is 300 seconds. - :vartype cooldown_period: int - :ivar scaling_rules: The scaling rules. Required. - :vartype scaling_rules: list[~azure.mgmt.hdinsightcontainers.models.ScalingRule] - """ - - _validation = { - "min_nodes": {"required": True}, - "max_nodes": {"required": True}, - "scaling_rules": {"required": True}, - } - - _attribute_map = { - "min_nodes": {"key": "minNodes", "type": "int"}, - "max_nodes": {"key": "maxNodes", "type": "int"}, - "poll_interval": {"key": "pollInterval", "type": "int"}, - "cooldown_period": {"key": "cooldownPeriod", "type": "int"}, - "scaling_rules": {"key": "scalingRules", "type": "[ScalingRule]"}, - } - - def __init__( - self, - *, - min_nodes: int, - max_nodes: int, - scaling_rules: List["_models.ScalingRule"], - poll_interval: Optional[int] = None, - cooldown_period: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword min_nodes: User needs to set the minimum number of nodes for load based scaling, the - load based scaling will use this to scale up and scale down between minimum and maximum number - of nodes. Required. - :paramtype min_nodes: int - :keyword max_nodes: User needs to set the maximum number of nodes for load based scaling, the - load based scaling will use this to scale up and scale down between minimum and maximum number - of nodes. Required. - :paramtype max_nodes: int - :keyword poll_interval: User can specify the poll interval, this is the time period (in - seconds) after which scaling metrics are polled for triggering a scaling operation. - :paramtype poll_interval: int - :keyword cooldown_period: This is a cool down period, this is a time period in seconds, which - determines the amount of time that must elapse between a scaling activity started by a rule and - the start of the next scaling activity, regardless of the rule that triggers it. The default - value is 300 seconds. - :paramtype cooldown_period: int - :keyword scaling_rules: The scaling rules. Required. - :paramtype scaling_rules: list[~azure.mgmt.hdinsightcontainers.models.ScalingRule] - """ - super().__init__(**kwargs) - self.min_nodes = min_nodes - self.max_nodes = max_nodes - self.poll_interval = poll_interval - self.cooldown_period = cooldown_period - self.scaling_rules = scaling_rules - - -class ManagedIdentityProfile(_serialization.Model): - """The details of managed identity. - - All required parameters must be populated in order to send to server. - - :ivar identity_list: The list of managed identity. Required. - :vartype identity_list: list[~azure.mgmt.hdinsightcontainers.models.ManagedIdentitySpec] - """ - - _validation = { - "identity_list": {"required": True}, - } - - _attribute_map = { - "identity_list": {"key": "identityList", "type": "[ManagedIdentitySpec]"}, - } - - def __init__(self, *, identity_list: List["_models.ManagedIdentitySpec"], **kwargs: Any) -> None: - """ - :keyword identity_list: The list of managed identity. Required. - :paramtype identity_list: list[~azure.mgmt.hdinsightcontainers.models.ManagedIdentitySpec] - """ - super().__init__(**kwargs) - self.identity_list = identity_list - - -class ManagedIdentitySpec(_serialization.Model): - """The details of a managed identity. - - All required parameters must be populated in order to send to server. - - :ivar type: The type of managed identity. Required. Known values are: "cluster", "user", and - "internal". - :vartype type: str or ~azure.mgmt.hdinsightcontainers.models.ManagedIdentityType - :ivar resource_id: ResourceId of the managed identity. Required. - :vartype resource_id: str - :ivar client_id: ClientId of the managed identity. Required. - :vartype client_id: str - :ivar object_id: ObjectId of the managed identity. Required. - :vartype object_id: str - """ - - _validation = { - "type": {"required": True}, - "resource_id": {"required": True}, - "client_id": { - "required": True, - "pattern": r"^[{(]?[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}[)}]?$", - }, - "object_id": { - "required": True, - "pattern": r"^[{(]?[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}[)}]?$", - }, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "resource_id": {"key": "resourceId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - "object_id": {"key": "objectId", "type": "str"}, - } - - def __init__( - self, - *, - type: Union[str, "_models.ManagedIdentityType"], - resource_id: str, - client_id: str, - object_id: str, - **kwargs: Any - ) -> None: - """ - :keyword type: The type of managed identity. Required. Known values are: "cluster", "user", and - "internal". - :paramtype type: str or ~azure.mgmt.hdinsightcontainers.models.ManagedIdentityType - :keyword resource_id: ResourceId of the managed identity. Required. - :paramtype resource_id: str - :keyword client_id: ClientId of the managed identity. Required. - :paramtype client_id: str - :keyword object_id: ObjectId of the managed identity. Required. - :paramtype object_id: str - """ - super().__init__(**kwargs) - self.type = type - self.resource_id = resource_id - self.client_id = client_id - self.object_id = object_id - - -class MavenLibraryProperties(ClusterLibraryProperties): - """Properties of a Maven library in the 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 server. - - :ivar type: Type of the library. Required. Known values are: "pypi" and "maven". - :vartype type: str or ~azure.mgmt.hdinsightcontainers.models.Type - :ivar remarks: Remark of the latest library management operation. - :vartype remarks: str - :ivar timestamp: Timestamp of the latest library management operation. - :vartype timestamp: ~datetime.datetime - :ivar status: Status of the library. Known values are: "INSTALLING", "INSTALLED", - "INSTALL_FAILED", "UNINSTALLING", and "UNINSTALL_FAILED". - :vartype status: str or ~azure.mgmt.hdinsightcontainers.models.Status - :ivar message: Error message of the library operation when a failure occurs. - :vartype message: str - :ivar group_id: GroupId of the Maven package. Required. - :vartype group_id: str - :ivar name: ArtifactId of the Maven package. Required. - :vartype name: str - :ivar version: Version of the Maven package. - :vartype version: str - """ - - _validation = { - "type": {"required": True}, - "timestamp": {"readonly": True}, - "status": {"readonly": True}, - "message": {"readonly": True}, - "group_id": {"required": True}, - "name": {"required": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "remarks": {"key": "remarks", "type": "str"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "status": {"key": "status", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "group_id": {"key": "groupId", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "version": {"key": "version", "type": "str"}, - } - - def __init__( - self, *, group_id: str, name: str, remarks: Optional[str] = None, version: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword remarks: Remark of the latest library management operation. - :paramtype remarks: str - :keyword group_id: GroupId of the Maven package. Required. - :paramtype group_id: str - :keyword name: ArtifactId of the Maven package. Required. - :paramtype name: str - :keyword version: Version of the Maven package. - :paramtype version: str - """ - super().__init__(remarks=remarks, **kwargs) - self.type: str = "maven" - self.group_id = group_id - self.name = name - self.version = version - - -class NameAvailabilityParameters(_serialization.Model): - """Details of check name availability request body. - - :ivar name: Name for checking availability. - :vartype name: str - :ivar type: The resource type in Microsoft.HDInsight. - :vartype type: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: Name for checking availability. - :paramtype name: str - :keyword type: The resource type in Microsoft.HDInsight. - :paramtype type: str - """ - super().__init__(**kwargs) - self.name = name - self.type = type - - -class NameAvailabilityResult(_serialization.Model): - """Result of check name availability. - - :ivar name_available: Indicator of availability of the Microsoft.HDInsight resource name. - :vartype name_available: bool - :ivar reason: The reason of unavailability. - :vartype reason: str - :ivar message: The error message of unavailability. - :vartype message: str - """ - - _attribute_map = { - "name_available": {"key": "nameAvailable", "type": "bool"}, - "reason": {"key": "reason", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__( - self, - *, - name_available: Optional[bool] = None, - reason: Optional[str] = None, - message: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name_available: Indicator of availability of the Microsoft.HDInsight resource name. - :paramtype name_available: bool - :keyword reason: The reason of unavailability. - :paramtype reason: str - :keyword message: The error message of unavailability. - :paramtype message: str - """ - super().__init__(**kwargs) - self.name_available = name_available - self.reason = reason - self.message = message - - -class NodeProfile(_serialization.Model): - """The node profile. - - All required parameters must be populated in order to send to server. - - :ivar type: The node type. Required. - :vartype type: str - :ivar vm_size: The virtual machine SKU. Required. - :vartype vm_size: str - :ivar count: The number of virtual machines. Required. - :vartype count: int - """ - - _validation = { - "type": {"required": True, "pattern": r"^(head|Head|HEAD|worker|Worker|WORKER)$"}, - "vm_size": {"required": True, "pattern": r"^[a-zA-Z0-9_\-]{0,256}$"}, - "count": {"required": True, "minimum": 0}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "vm_size": {"key": "vmSize", "type": "str"}, - "count": {"key": "count", "type": "int"}, - } - - def __init__(self, *, type: str, vm_size: str, count: int, **kwargs: Any) -> None: - """ - :keyword type: The node type. Required. - :paramtype type: str - :keyword vm_size: The virtual machine SKU. Required. - :paramtype vm_size: str - :keyword count: The number of virtual machines. Required. - :paramtype count: int - """ - super().__init__(**kwargs) - self.type = type - self.vm_size = vm_size - self.count = count - - -class Operation(_serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.hdinsightcontainers.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.hdinsightcontainers.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.hdinsightcontainers.models.ActionType - """ - - _validation = { - "name": {"readonly": True}, - "is_data_action": {"readonly": True}, - "origin": {"readonly": True}, - "action_type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "action_type": {"key": "actionType", "type": "str"}, - } - - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.hdinsightcontainers.models.OperationDisplay - """ - super().__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(_serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - "provider": {"readonly": True}, - "resource": {"readonly": True}, - "operation": {"readonly": True}, - "description": {"readonly": True}, - } - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(_serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link - to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class PyPiLibraryProperties(ClusterLibraryProperties): - """Properties of a PyPi library in the 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 server. - - :ivar type: Type of the library. Required. Known values are: "pypi" and "maven". - :vartype type: str or ~azure.mgmt.hdinsightcontainers.models.Type - :ivar remarks: Remark of the latest library management operation. - :vartype remarks: str - :ivar timestamp: Timestamp of the latest library management operation. - :vartype timestamp: ~datetime.datetime - :ivar status: Status of the library. Known values are: "INSTALLING", "INSTALLED", - "INSTALL_FAILED", "UNINSTALLING", and "UNINSTALL_FAILED". - :vartype status: str or ~azure.mgmt.hdinsightcontainers.models.Status - :ivar message: Error message of the library operation when a failure occurs. - :vartype message: str - :ivar name: Name of the PyPi package. Required. - :vartype name: str - :ivar version: Version of the PyPi package. - :vartype version: str - """ - - _validation = { - "type": {"required": True}, - "timestamp": {"readonly": True}, - "status": {"readonly": True}, - "message": {"readonly": True}, - "name": {"required": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "remarks": {"key": "remarks", "type": "str"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "status": {"key": "status", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "version": {"key": "version", "type": "str"}, - } - - def __init__( - self, *, name: str, remarks: Optional[str] = None, version: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword remarks: Remark of the latest library management operation. - :paramtype remarks: str - :keyword name: Name of the PyPi package. Required. - :paramtype name: str - :keyword version: Version of the PyPi package. - :paramtype version: str - """ - super().__init__(remarks=remarks, **kwargs) - self.type: str = "pypi" - self.name = name - self.version = version - - -class RangerAdminSpec(_serialization.Model): - """Specification for the Ranger Admin service. - - All required parameters must be populated in order to send to server. - - :ivar admins: List of usernames that should be marked as ranger admins. These usernames should - match the user principal name (UPN) 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 (UPN) 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 server. - - :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 server. - - :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. - - All required parameters must be populated in order to send to server. - - :ivar action_type: The action type. Required. Known values are: "scaleup" and "scaledown". - :vartype action_type: str or ~azure.mgmt.hdinsightcontainers.models.ScaleActionType - :ivar evaluation_count: This is an evaluation count for a scaling condition, the number of - times a trigger condition should be successful, before scaling activity is triggered. Required. - :vartype evaluation_count: int - :ivar scaling_metric: Metrics name for individual workloads. For example: cpu. Required. - :vartype scaling_metric: str - :ivar comparison_rule: The comparison rule. Required. - :vartype comparison_rule: ~azure.mgmt.hdinsightcontainers.models.ComparisonRule - """ - - _validation = { - "action_type": {"required": True}, - "evaluation_count": {"required": True}, - "scaling_metric": {"required": True}, - "comparison_rule": {"required": True}, - } - - _attribute_map = { - "action_type": {"key": "actionType", "type": "str"}, - "evaluation_count": {"key": "evaluationCount", "type": "int"}, - "scaling_metric": {"key": "scalingMetric", "type": "str"}, - "comparison_rule": {"key": "comparisonRule", "type": "ComparisonRule"}, - } - - def __init__( - self, - *, - action_type: Union[str, "_models.ScaleActionType"], - evaluation_count: int, - scaling_metric: str, - comparison_rule: "_models.ComparisonRule", - **kwargs: Any - ) -> None: - """ - :keyword action_type: The action type. Required. Known values are: "scaleup" and "scaledown". - :paramtype action_type: str or ~azure.mgmt.hdinsightcontainers.models.ScaleActionType - :keyword evaluation_count: This is an evaluation count for a scaling condition, the number of - times a trigger condition should be successful, before scaling activity is triggered. Required. - :paramtype evaluation_count: int - :keyword scaling_metric: Metrics name for individual workloads. For example: cpu. Required. - :paramtype scaling_metric: str - :keyword comparison_rule: The comparison rule. Required. - :paramtype comparison_rule: ~azure.mgmt.hdinsightcontainers.models.ComparisonRule - """ - super().__init__(**kwargs) - self.action_type = action_type - self.evaluation_count = evaluation_count - self.scaling_metric = scaling_metric - self.comparison_rule = comparison_rule - - -class Schedule(_serialization.Model): - """Schedule definition. - - All required parameters must be populated in order to send to server. - - :ivar start_time: User has to set the start time of current schedule configuration, format like - 10:30 (HH:MM). Required. - :vartype start_time: str - :ivar end_time: User has to set the end time of current schedule configuration, format like - 10:30 (HH:MM). Required. - :vartype end_time: str - :ivar count: User has to set the node count anticipated at end of the scaling operation of the - set current schedule configuration, format is integer. Required. - :vartype count: int - :ivar days: User has to set the days where schedule has to be set for autoscale operation. - Required. - :vartype days: list[str or ~azure.mgmt.hdinsightcontainers.models.ScheduleDay] - """ - - _validation = { - "start_time": {"required": True, "pattern": r"^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"}, - "end_time": {"required": True, "pattern": r"^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"}, - "count": {"required": True}, - "days": {"required": True}, - } - - _attribute_map = { - "start_time": {"key": "startTime", "type": "str"}, - "end_time": {"key": "endTime", "type": "str"}, - "count": {"key": "count", "type": "int"}, - "days": {"key": "days", "type": "[str]"}, - } - - def __init__( - self, - *, - start_time: str, - end_time: str, - count: int, - days: List[Union[str, "_models.ScheduleDay"]], - **kwargs: Any - ) -> None: - """ - :keyword start_time: User has to set the start time of current schedule configuration, format - like 10:30 (HH:MM). Required. - :paramtype start_time: str - :keyword end_time: User has to set the end time of current schedule configuration, format like - 10:30 (HH:MM). Required. - :paramtype end_time: str - :keyword count: User has to set the node count anticipated at end of the scaling operation of - the set current schedule configuration, format is integer. Required. - :paramtype count: int - :keyword days: User has to set the days where schedule has to be set for autoscale operation. - Required. - :paramtype days: list[str or ~azure.mgmt.hdinsightcontainers.models.ScheduleDay] - """ - super().__init__(**kwargs) - self.start_time = start_time - self.end_time = end_time - self.count = count - self.days = days - - -class ScheduleBasedConfig(_serialization.Model): - """Profile of schedule based Autoscale. - - All required parameters must be populated in order to send to server. - - :ivar time_zone: User has to specify the timezone on which the schedule has to be set for - schedule based autoscale configuration. Required. - :vartype time_zone: str - :ivar default_count: Setting default node count of current schedule configuration. Default node - count specifies the number of nodes which are default when an specified scaling operation is - executed (scale up/scale down). Required. - :vartype default_count: int - :ivar schedules: This specifies the schedules where scheduled based Autoscale to be enabled, - the user has a choice to set multiple rules within the schedule across days and times - (start/end). Required. - :vartype schedules: list[~azure.mgmt.hdinsightcontainers.models.Schedule] - """ - - _validation = { - "time_zone": {"required": True}, - "default_count": {"required": True}, - "schedules": {"required": True}, - } - - _attribute_map = { - "time_zone": {"key": "timeZone", "type": "str"}, - "default_count": {"key": "defaultCount", "type": "int"}, - "schedules": {"key": "schedules", "type": "[Schedule]"}, - } - - def __init__( - self, *, time_zone: str, default_count: int, schedules: List["_models.Schedule"], **kwargs: Any - ) -> None: - """ - :keyword time_zone: User has to specify the timezone on which the schedule has to be set for - schedule based autoscale configuration. Required. - :paramtype time_zone: str - :keyword default_count: Setting default node count of current schedule configuration. Default - node count specifies the number of nodes which are default when an specified scaling operation - is executed (scale up/scale down). Required. - :paramtype default_count: int - :keyword schedules: This specifies the schedules where scheduled based Autoscale to be enabled, - the user has a choice to set multiple rules within the schedule across days and times - (start/end). Required. - :paramtype schedules: list[~azure.mgmt.hdinsightcontainers.models.Schedule] - """ - super().__init__(**kwargs) - self.time_zone = time_zone - self.default_count = default_count - self.schedules = schedules - - -class ScriptActionProfile(_serialization.Model): - """The script action profile. - - All required parameters must be populated in order to send to server. - - :ivar type: Type of the script action. Supported type is bash scripts. Required. - :vartype type: str - :ivar name: Script name. Required. - :vartype name: str - :ivar url: Url of the script file. Required. - :vartype url: str - :ivar parameters: Additional parameters for the script action. It should be space-separated - list of arguments required for script execution. - :vartype parameters: str - :ivar services: List of services to apply the script action. Required. - :vartype services: list[str] - :ivar timeout_in_minutes: Timeout duration for the script action in minutes. - :vartype timeout_in_minutes: int - :ivar should_persist: Specify if the script should persist on the cluster. - :vartype should_persist: bool - """ - - _validation = { - "type": {"required": True}, - "name": {"required": True}, - "url": {"required": True, "pattern": r"^(https)|(http)://.*$"}, - "services": {"required": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "url": {"key": "url", "type": "str"}, - "parameters": {"key": "parameters", "type": "str"}, - "services": {"key": "services", "type": "[str]"}, - "timeout_in_minutes": {"key": "timeoutInMinutes", "type": "int"}, - "should_persist": {"key": "shouldPersist", "type": "bool"}, - } - - def __init__( - self, - *, - type: str, - name: str, - url: str, - services: List[str], - parameters: Optional[str] = None, - timeout_in_minutes: Optional[int] = None, - should_persist: bool = True, - **kwargs: Any - ) -> None: - """ - :keyword type: Type of the script action. Supported type is bash scripts. Required. - :paramtype type: str - :keyword name: Script name. Required. - :paramtype name: str - :keyword url: Url of the script file. Required. - :paramtype url: str - :keyword parameters: Additional parameters for the script action. It should be space-separated - list of arguments required for script execution. - :paramtype parameters: str - :keyword services: List of services to apply the script action. Required. - :paramtype services: list[str] - :keyword timeout_in_minutes: Timeout duration for the script action in minutes. - :paramtype timeout_in_minutes: int - :keyword should_persist: Specify if the script should persist on the cluster. - :paramtype should_persist: bool - """ - super().__init__(**kwargs) - self.type = type - self.name = name - self.url = url - self.parameters = parameters - self.services = services - self.timeout_in_minutes = timeout_in_minutes - self.should_persist = should_persist - - -class SecretReference(_serialization.Model): - """Secret reference and corresponding properties of a key vault secret. - - All required parameters must be populated in order to send to server. - - :ivar reference_name: Reference name of the secret to be used in service configs. Required. - :vartype reference_name: str - :ivar type: Type of key vault object: secret, key or certificate. Required. Known values are: - "Key", "Secret", and "Certificate". - :vartype type: str or ~azure.mgmt.hdinsightcontainers.models.KeyVaultObjectType - :ivar version: Version of the secret in key vault. - :vartype version: str - :ivar key_vault_object_name: Object identifier name of the secret in key vault. Required. - :vartype key_vault_object_name: str - """ - - _validation = { - "reference_name": {"required": True}, - "type": {"required": True}, - "key_vault_object_name": {"required": True, "pattern": r"^[a-zA-Z][a-zA-Z0-9-]{1,126}$"}, - } - - _attribute_map = { - "reference_name": {"key": "referenceName", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "version": {"key": "version", "type": "str"}, - "key_vault_object_name": {"key": "keyVaultObjectName", "type": "str"}, - } - - def __init__( - self, - *, - reference_name: str, - type: Union[str, "_models.KeyVaultObjectType"], - key_vault_object_name: str, - version: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword reference_name: Reference name of the secret to be used in service configs. Required. - :paramtype reference_name: str - :keyword type: Type of key vault object: secret, key or certificate. Required. Known values - are: "Key", "Secret", and "Certificate". - :paramtype type: str or ~azure.mgmt.hdinsightcontainers.models.KeyVaultObjectType - :keyword version: Version of the secret in key vault. - :paramtype version: str - :keyword key_vault_object_name: Object identifier name of the secret in key vault. Required. - :paramtype key_vault_object_name: str - """ - super().__init__(**kwargs) - self.reference_name = reference_name - self.type = type - self.version = version - self.key_vault_object_name = key_vault_object_name - - -class SecretsProfile(_serialization.Model): - """The cluster secret profile. - - All required parameters must be populated in order to send to server. - - :ivar key_vault_resource_id: Name of the user Key Vault where all the cluster specific user - secrets are stored. Required. - :vartype key_vault_resource_id: str - :ivar secrets: Properties of Key Vault secret. - :vartype secrets: list[~azure.mgmt.hdinsightcontainers.models.SecretReference] - """ - - _validation = { - "key_vault_resource_id": {"required": True}, - } - - _attribute_map = { - "key_vault_resource_id": {"key": "keyVaultResourceId", "type": "str"}, - "secrets": {"key": "secrets", "type": "[SecretReference]"}, - } - - def __init__( - self, *, key_vault_resource_id: str, secrets: Optional[List["_models.SecretReference"]] = None, **kwargs: Any - ) -> None: - """ - :keyword key_vault_resource_id: Name of the user Key Vault where all the cluster specific user - secrets are stored. Required. - :paramtype key_vault_resource_id: str - :keyword secrets: Properties of Key Vault secret. - :paramtype secrets: list[~azure.mgmt.hdinsightcontainers.models.SecretReference] - """ - super().__init__(**kwargs) - self.key_vault_resource_id = key_vault_resource_id - self.secrets = secrets - - -class ServiceConfigListResult(_serialization.Model): - """Cluster instance service configs api response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Cluster instance service config array. - :vartype value: list[~azure.mgmt.hdinsightcontainers.models.ServiceConfigResult] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServiceConfigResult]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.ServiceConfigResult"]] = None, **kwargs: Any) -> None: - """ - :keyword value: Cluster instance service config array. - :paramtype value: list[~azure.mgmt.hdinsightcontainers.models.ServiceConfigResult] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ServiceConfigListResultProperties(_serialization.Model): - """Service config response. - - All required parameters must be populated in order to send to server. - - :ivar service_name: Service Config Name. Required. - :vartype service_name: str - :ivar file_name: File Name. Required. - :vartype file_name: str - :ivar content: Content in the service config file. - :vartype content: str - :ivar component_name: Component Name. Required. - :vartype component_name: str - :ivar type: Config type. - :vartype type: str - :ivar path: Config file path. - :vartype path: str - :ivar custom_keys: The custom keys. - :vartype custom_keys: dict[str, str] - :ivar default_keys: The default keys. - :vartype default_keys: dict[str, - ~azure.mgmt.hdinsightcontainers.models.ServiceConfigListResultValueEntity] - """ - - _validation = { - "service_name": {"required": True}, - "file_name": {"required": True}, - "component_name": {"required": True}, - } - - _attribute_map = { - "service_name": {"key": "serviceName", "type": "str"}, - "file_name": {"key": "fileName", "type": "str"}, - "content": {"key": "content", "type": "str"}, - "component_name": {"key": "componentName", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "path": {"key": "path", "type": "str"}, - "custom_keys": {"key": "customKeys", "type": "{str}"}, - "default_keys": {"key": "defaultKeys", "type": "{ServiceConfigListResultValueEntity}"}, - } - - def __init__( - self, - *, - service_name: str, - file_name: str, - component_name: str, - content: Optional[str] = None, - type: Optional[str] = None, - path: Optional[str] = None, - custom_keys: Optional[Dict[str, str]] = None, - default_keys: Optional[Dict[str, "_models.ServiceConfigListResultValueEntity"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword service_name: Service Config Name. Required. - :paramtype service_name: str - :keyword file_name: File Name. Required. - :paramtype file_name: str - :keyword content: Content in the service config file. - :paramtype content: str - :keyword component_name: Component Name. Required. - :paramtype component_name: str - :keyword type: Config type. - :paramtype type: str - :keyword path: Config file path. - :paramtype path: str - :keyword custom_keys: The custom keys. - :paramtype custom_keys: dict[str, str] - :keyword default_keys: The default keys. - :paramtype default_keys: dict[str, - ~azure.mgmt.hdinsightcontainers.models.ServiceConfigListResultValueEntity] - """ - super().__init__(**kwargs) - self.service_name = service_name - self.file_name = file_name - self.content = content - self.component_name = component_name - self.type = type - self.path = path - self.custom_keys = custom_keys - self.default_keys = default_keys - - -class ServiceConfigListResultValueEntity(_serialization.Model): - """Default config details. - - All required parameters must be populated in order to send to server. - - :ivar value: Config value. Required. - :vartype value: str - :ivar description: Config description. - :vartype description: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__(self, *, value: str, description: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: Config value. Required. - :paramtype value: str - :keyword description: Config description. - :paramtype description: str - """ - super().__init__(**kwargs) - self.value = value - self.description = description - - -class ServiceConfigResult(_serialization.Model): - """Cluster instance service config. - - :ivar properties: Cluster instance service config properties. - :vartype properties: ~azure.mgmt.hdinsightcontainers.models.ServiceConfigResultProperties - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "ServiceConfigResultProperties"}, - } - - def __init__(self, *, properties: Optional["_models.ServiceConfigResultProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: Cluster instance service config properties. - :paramtype properties: ~azure.mgmt.hdinsightcontainers.models.ServiceConfigResultProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ServiceConfigResultProperties(ServiceConfigListResultProperties): - """Cluster instance service config properties. - - All required parameters must be populated in order to send to server. - - :ivar service_name: Service Config Name. Required. - :vartype service_name: str - :ivar file_name: File Name. Required. - :vartype file_name: str - :ivar content: Content in the service config file. - :vartype content: str - :ivar component_name: Component Name. Required. - :vartype component_name: str - :ivar type: Config type. - :vartype type: str - :ivar path: Config file path. - :vartype path: str - :ivar custom_keys: The custom keys. - :vartype custom_keys: dict[str, str] - :ivar default_keys: The default keys. - :vartype default_keys: dict[str, - ~azure.mgmt.hdinsightcontainers.models.ServiceConfigListResultValueEntity] - """ - - -class ServiceStatus(_serialization.Model): - """Describes the status of a service of a HDInsight on AKS cluster. - - All required parameters must be populated in order to send to server. - - :ivar kind: Kind of the service. E.g. "Zookeeper". Required. - :vartype kind: str - :ivar ready: Indicates if the service is ready / healthy. Values can be "true", "false", - "unknown" or anything else. Required. - :vartype ready: str - :ivar message: A message describing the error if any. - :vartype message: str - """ - - _validation = { - "kind": {"required": True}, - "ready": {"required": True}, - } - - _attribute_map = { - "kind": {"key": "kind", "type": "str"}, - "ready": {"key": "ready", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, *, kind: str, ready: str, message: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword kind: Kind of the service. E.g. "Zookeeper". Required. - :paramtype kind: str - :keyword ready: Indicates if the service is ready / healthy. Values can be "true", "false", - "unknown" or anything else. Required. - :paramtype ready: str - :keyword message: A message describing the error if any. - :paramtype message: str - """ - super().__init__(**kwargs) - self.kind = kind - self.ready = ready - self.message = message - - -class SparkMetastoreSpec(_serialization.Model): - """The metastore specification for Spark cluster. - - All required parameters must be populated in order to send to server. - - :ivar db_server_host: The database server host. Required. - :vartype db_server_host: str - :ivar db_name: The database name. Required. - :vartype db_name: str - :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. # pylint: disable=line-too-long - 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. - :vartype db_password_secret_name: str - :ivar key_vault_id: The key vault resource id. - :vartype key_vault_id: str - :ivar thrift_url: The thrift url. - :vartype thrift_url: str - """ - - _validation = { - "db_server_host": {"required": True}, - "db_name": {"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"}, - "thrift_url": {"key": "thriftUrl", "type": "str"}, - } - - def __init__( - self, - *, - db_server_host: str, - db_name: 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: - """ - :keyword db_server_host: The database server host. Required. - :paramtype db_server_host: str - :keyword db_name: The database name. Required. - :paramtype db_name: str - :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. # pylint: disable=line-too-long - 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. - :paramtype db_password_secret_name: str - :keyword key_vault_id: The key vault resource id. - :paramtype key_vault_id: str - :keyword thrift_url: The thrift url. - :paramtype thrift_url: str - """ - 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 - self.thrift_url = thrift_url - - -class SparkProfile(_serialization.Model): - """The spark cluster profile. - - :ivar default_storage_url: The default storage URL. - :vartype default_storage_url: str - :ivar metastore_spec: The metastore specification for Spark cluster. - :vartype metastore_spec: ~azure.mgmt.hdinsightcontainers.models.SparkMetastoreSpec - :ivar user_plugins_spec: Spark user plugins spec. - :vartype user_plugins_spec: ~azure.mgmt.hdinsightcontainers.models.SparkUserPlugins - """ - - _attribute_map = { - "default_storage_url": {"key": "defaultStorageUrl", "type": "str"}, - "metastore_spec": {"key": "metastoreSpec", "type": "SparkMetastoreSpec"}, - "user_plugins_spec": {"key": "userPluginsSpec", "type": "SparkUserPlugins"}, - } - - def __init__( - self, - *, - default_storage_url: Optional[str] = None, - metastore_spec: Optional["_models.SparkMetastoreSpec"] = None, - user_plugins_spec: Optional["_models.SparkUserPlugins"] = None, - **kwargs: Any - ) -> None: - """ - :keyword default_storage_url: The default storage URL. - :paramtype default_storage_url: str - :keyword metastore_spec: The metastore specification for Spark cluster. - :paramtype metastore_spec: ~azure.mgmt.hdinsightcontainers.models.SparkMetastoreSpec - :keyword user_plugins_spec: Spark user plugins spec. - :paramtype user_plugins_spec: ~azure.mgmt.hdinsightcontainers.models.SparkUserPlugins - """ - super().__init__(**kwargs) - self.default_storage_url = default_storage_url - self.metastore_spec = metastore_spec - self.user_plugins_spec = user_plugins_spec - - -class SparkUserPlugin(_serialization.Model): - """Spark user plugin. - - All required parameters must be populated in order to send to server. - - :ivar path: Fully qualified path to the folder containing the plugins. Required. - :vartype path: str - """ - - _validation = { - "path": {"required": True, "min_length": 1, "pattern": r"^(https)|(abfss)://.*$"}, - } - - _attribute_map = { - "path": {"key": "path", "type": "str"}, - } - - def __init__(self, *, path: str, **kwargs: Any) -> None: - """ - :keyword path: Fully qualified path to the folder containing the plugins. Required. - :paramtype path: str - """ - super().__init__(**kwargs) - self.path = path - - -class SparkUserPlugins(_serialization.Model): - """Spark user plugins spec. - - :ivar plugins: Spark user plugins. - :vartype plugins: list[~azure.mgmt.hdinsightcontainers.models.SparkUserPlugin] - """ - - _attribute_map = { - "plugins": {"key": "plugins", "type": "[SparkUserPlugin]"}, - } - - def __init__(self, *, plugins: Optional[List["_models.SparkUserPlugin"]] = None, **kwargs: Any) -> None: - """ - :keyword plugins: Spark user plugins. - :paramtype plugins: list[~azure.mgmt.hdinsightcontainers.models.SparkUserPlugin] - """ - super().__init__(**kwargs) - self.plugins = plugins - - -class SshConnectivityEndpoint(_serialization.Model): - """SSH connectivity endpoint details. - - All required parameters must be populated in order to send to server. - - :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 = { - "endpoint": {"required": True}, - } - - _attribute_map = { - "endpoint": {"key": "endpoint", "type": "str"}, - "private_ssh_endpoint": {"key": "privateSshEndpoint", "type": "str"}, - } - - 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): - """Ssh profile for the 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 server. - - :ivar count: Number of ssh pods per cluster. Required. - :vartype count: int - :ivar pod_prefix: Prefix of the pod names. Pod number will be appended to the prefix. The - ingress URLs for the pods will be available at - :code:``/:code:``/:code:``-:code:``. - :vartype pod_prefix: str - :ivar vm_size: The virtual machine SKU. - :vartype vm_size: str - """ - - _validation = { - "count": {"required": True, "maximum": 5, "minimum": 0}, - "pod_prefix": {"readonly": True}, - "vm_size": {"pattern": r"^[a-zA-Z0-9_\-]{0,256}$"}, - } - - _attribute_map = { - "count": {"key": "count", "type": "int"}, - "pod_prefix": {"key": "podPrefix", "type": "str"}, - "vm_size": {"key": "vmSize", "type": "str"}, - } - - def __init__(self, *, count: int, vm_size: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword count: Number of ssh pods per cluster. Required. - :paramtype count: int - :keyword vm_size: The virtual machine SKU. - :paramtype vm_size: str - """ - super().__init__(**kwargs) - self.count = count - self.pod_prefix = None - self.vm_size = vm_size - - -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.hdinsightcontainers.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.hdinsightcontainers.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.hdinsightcontainers.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or ~azure.mgmt.hdinsightcontainers.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TagsObject(_serialization.Model): - """Tags object for patch operations. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - -class TrinoCoordinator(_serialization.Model): - """Trino Coordinator. - - :ivar debug: Trino debug configuration. - :vartype debug: ~azure.mgmt.hdinsightcontainers.models.TrinoDebugConfig - :ivar high_availability_enabled: The flag that if enable coordinator HA, uses multiple - coordinator replicas with auto failover, one per each head node. Default: true. - :vartype high_availability_enabled: bool - """ - - _attribute_map = { - "debug": {"key": "debug", "type": "TrinoDebugConfig"}, - "high_availability_enabled": {"key": "highAvailabilityEnabled", "type": "bool"}, - } - - def __init__( - self, - *, - debug: Optional["_models.TrinoDebugConfig"] = None, - high_availability_enabled: bool = True, - **kwargs: Any - ) -> None: - """ - :keyword debug: Trino debug configuration. - :paramtype debug: ~azure.mgmt.hdinsightcontainers.models.TrinoDebugConfig - :keyword high_availability_enabled: The flag that if enable coordinator HA, uses multiple - coordinator replicas with auto failover, one per each head node. Default: true. - :paramtype high_availability_enabled: bool - """ - super().__init__(**kwargs) - self.debug = debug - self.high_availability_enabled = high_availability_enabled - - -class TrinoDebugConfig(_serialization.Model): - """Trino debug configuration. - - :ivar enable: The flag that if enable debug or not. - :vartype enable: bool - :ivar port: The debug port. - :vartype port: int - :ivar suspend: The flag that if suspend debug or not. - :vartype suspend: bool - """ - - _attribute_map = { - "enable": {"key": "enable", "type": "bool"}, - "port": {"key": "port", "type": "int"}, - "suspend": {"key": "suspend", "type": "bool"}, - } - - def __init__(self, *, enable: bool = False, port: int = 8008, suspend: bool = False, **kwargs: Any) -> None: - """ - :keyword enable: The flag that if enable debug or not. - :paramtype enable: bool - :keyword port: The debug port. - :paramtype port: int - :keyword suspend: The flag that if suspend debug or not. - :paramtype suspend: bool - """ - super().__init__(**kwargs) - self.enable = enable - self.port = port - self.suspend = suspend - - -class TrinoProfile(_serialization.Model): - """Trino Cluster profile. - - :ivar catalog_options: Trino cluster catalog options. - :vartype catalog_options: ~azure.mgmt.hdinsightcontainers.models.CatalogOptions - :ivar coordinator: Trino Coordinator. - :vartype coordinator: ~azure.mgmt.hdinsightcontainers.models.TrinoCoordinator - :ivar user_plugins_spec: Trino user plugins spec. - :vartype user_plugins_spec: ~azure.mgmt.hdinsightcontainers.models.TrinoUserPlugins - :ivar user_telemetry_spec: User telemetry. - :vartype user_telemetry_spec: ~azure.mgmt.hdinsightcontainers.models.TrinoUserTelemetry - :ivar worker: Trino worker. - :vartype worker: ~azure.mgmt.hdinsightcontainers.models.TrinoWorker - """ - - _attribute_map = { - "catalog_options": {"key": "catalogOptions", "type": "CatalogOptions"}, - "coordinator": {"key": "coordinator", "type": "TrinoCoordinator"}, - "user_plugins_spec": {"key": "userPluginsSpec", "type": "TrinoUserPlugins"}, - "user_telemetry_spec": {"key": "userTelemetrySpec", "type": "TrinoUserTelemetry"}, - "worker": {"key": "worker", "type": "TrinoWorker"}, - } - - def __init__( - self, - *, - catalog_options: Optional["_models.CatalogOptions"] = None, - coordinator: Optional["_models.TrinoCoordinator"] = None, - user_plugins_spec: Optional["_models.TrinoUserPlugins"] = None, - user_telemetry_spec: Optional["_models.TrinoUserTelemetry"] = None, - worker: Optional["_models.TrinoWorker"] = None, - **kwargs: Any - ) -> None: - """ - :keyword catalog_options: Trino cluster catalog options. - :paramtype catalog_options: ~azure.mgmt.hdinsightcontainers.models.CatalogOptions - :keyword coordinator: Trino Coordinator. - :paramtype coordinator: ~azure.mgmt.hdinsightcontainers.models.TrinoCoordinator - :keyword user_plugins_spec: Trino user plugins spec. - :paramtype user_plugins_spec: ~azure.mgmt.hdinsightcontainers.models.TrinoUserPlugins - :keyword user_telemetry_spec: User telemetry. - :paramtype user_telemetry_spec: ~azure.mgmt.hdinsightcontainers.models.TrinoUserTelemetry - :keyword worker: Trino worker. - :paramtype worker: ~azure.mgmt.hdinsightcontainers.models.TrinoWorker - """ - super().__init__(**kwargs) - self.catalog_options = catalog_options - self.coordinator = coordinator - self.user_plugins_spec = user_plugins_spec - self.user_telemetry_spec = user_telemetry_spec - self.worker = worker - - -class TrinoTelemetryConfig(_serialization.Model): - """Trino user telemetry definition. - - :ivar hivecatalog_name: Hive Catalog name used to mount external tables on the logs written by - trino, if not specified there tables are not created. - :vartype hivecatalog_name: str - :ivar hivecatalog_schema: Schema of the above catalog to use, to mount query logs as external - tables, if not specified tables will be mounted under schema trinologs. - :vartype hivecatalog_schema: str - :ivar partition_retention_in_days: Retention period for query log table partitions, this - doesn't have any affect on actual data. - :vartype partition_retention_in_days: int - :ivar path: Azure storage location of the blobs. - :vartype path: str - """ - - _validation = { - "hivecatalog_name": {"min_length": 1}, - "path": {"min_length": 1}, - } - - _attribute_map = { - "hivecatalog_name": {"key": "hivecatalogName", "type": "str"}, - "hivecatalog_schema": {"key": "hivecatalogSchema", "type": "str"}, - "partition_retention_in_days": {"key": "partitionRetentionInDays", "type": "int"}, - "path": {"key": "path", "type": "str"}, - } - - def __init__( - self, - *, - hivecatalog_name: Optional[str] = None, - hivecatalog_schema: str = "trinologs", - partition_retention_in_days: int = 365, - path: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword hivecatalog_name: Hive Catalog name used to mount external tables on the logs written - by trino, if not specified there tables are not created. - :paramtype hivecatalog_name: str - :keyword hivecatalog_schema: Schema of the above catalog to use, to mount query logs as - external tables, if not specified tables will be mounted under schema trinologs. - :paramtype hivecatalog_schema: str - :keyword partition_retention_in_days: Retention period for query log table partitions, this - doesn't have any affect on actual data. - :paramtype partition_retention_in_days: int - :keyword path: Azure storage location of the blobs. - :paramtype path: str - """ - super().__init__(**kwargs) - self.hivecatalog_name = hivecatalog_name - self.hivecatalog_schema = hivecatalog_schema - self.partition_retention_in_days = partition_retention_in_days - self.path = path - - -class TrinoUserPlugin(_serialization.Model): - """Trino user plugin. - - :ivar enabled: Denotes whether the plugin is active or not. - :vartype enabled: bool - :ivar name: This field maps to the sub-directory in trino plugins location, that will contain - all the plugins under path. - :vartype name: str - :ivar path: Fully qualified path to the folder containing the plugins. - :vartype path: str - """ - - _validation = { - "name": {"min_length": 1}, - "path": {"min_length": 1, "pattern": r"^(https)|(abfss)://.*$"}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "name": {"key": "name", "type": "str"}, - "path": {"key": "path", "type": "str"}, - } - - def __init__( - self, *, enabled: Optional[bool] = None, name: Optional[str] = None, path: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword enabled: Denotes whether the plugin is active or not. - :paramtype enabled: bool - :keyword name: This field maps to the sub-directory in trino plugins location, that will - contain all the plugins under path. - :paramtype name: str - :keyword path: Fully qualified path to the folder containing the plugins. - :paramtype path: str - """ - super().__init__(**kwargs) - self.enabled = enabled - self.name = name - self.path = path - - -class TrinoUserPlugins(_serialization.Model): - """Trino user plugins spec. - - :ivar plugins: Trino user plugins. - :vartype plugins: list[~azure.mgmt.hdinsightcontainers.models.TrinoUserPlugin] - """ - - _attribute_map = { - "plugins": {"key": "plugins", "type": "[TrinoUserPlugin]"}, - } - - def __init__(self, *, plugins: Optional[List["_models.TrinoUserPlugin"]] = None, **kwargs: Any) -> None: - """ - :keyword plugins: Trino user plugins. - :paramtype plugins: list[~azure.mgmt.hdinsightcontainers.models.TrinoUserPlugin] - """ - super().__init__(**kwargs) - self.plugins = plugins - - -class TrinoUserTelemetry(_serialization.Model): - """User telemetry. - - :ivar storage: Trino user telemetry definition. - :vartype storage: ~azure.mgmt.hdinsightcontainers.models.TrinoTelemetryConfig - """ - - _attribute_map = { - "storage": {"key": "storage", "type": "TrinoTelemetryConfig"}, - } - - def __init__(self, *, storage: Optional["_models.TrinoTelemetryConfig"] = None, **kwargs: Any) -> None: - """ - :keyword storage: Trino user telemetry definition. - :paramtype storage: ~azure.mgmt.hdinsightcontainers.models.TrinoTelemetryConfig - """ - super().__init__(**kwargs) - self.storage = storage - - -class TrinoWorker(_serialization.Model): - """Trino worker. - - :ivar debug: Trino debug configuration. - :vartype debug: ~azure.mgmt.hdinsightcontainers.models.TrinoDebugConfig - """ - - _attribute_map = { - "debug": {"key": "debug", "type": "TrinoDebugConfig"}, - } - - def __init__(self, *, debug: Optional["_models.TrinoDebugConfig"] = None, **kwargs: Any) -> None: - """ - :keyword debug: Trino debug configuration. - :paramtype debug: ~azure.mgmt.hdinsightcontainers.models.TrinoDebugConfig - """ - super().__init__(**kwargs) - self.debug = debug - - -class UpdatableClusterProfile(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Cluster resource patch properties. - - :ivar service_configs_profiles: The service configs profiles. - :vartype service_configs_profiles: - list[~azure.mgmt.hdinsightcontainers.models.ClusterServiceConfigsProfile] - :ivar ssh_profile: Ssh profile for the cluster. - :vartype ssh_profile: ~azure.mgmt.hdinsightcontainers.models.SshProfile - :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 authorization_profile: Authorization profile with details of AAD user Ids and group Ids - authorized for data plane access. - :vartype authorization_profile: ~azure.mgmt.hdinsightcontainers.models.AuthorizationProfile - :ivar log_analytics_profile: Cluster log analytics profile to enable or disable OMS agent for - cluster. - :vartype log_analytics_profile: - ~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] - :ivar secrets_profile: The cluster secret profile. - :vartype secrets_profile: ~azure.mgmt.hdinsightcontainers.models.SecretsProfile - :ivar trino_profile: Trino Cluster profile. - :vartype trino_profile: ~azure.mgmt.hdinsightcontainers.models.TrinoProfile - """ - - _attribute_map = { - "service_configs_profiles": {"key": "serviceConfigsProfiles", "type": "[ClusterServiceConfigsProfile]"}, - "ssh_profile": {"key": "sshProfile", "type": "SshProfile"}, - "autoscale_profile": {"key": "autoscaleProfile", "type": "AutoscaleProfile"}, - "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]"}, - "secrets_profile": {"key": "secretsProfile", "type": "SecretsProfile"}, - "trino_profile": {"key": "trinoProfile", "type": "TrinoProfile"}, - } - - def __init__( - self, - *, - service_configs_profiles: Optional[List["_models.ClusterServiceConfigsProfile"]] = None, - ssh_profile: Optional["_models.SshProfile"] = None, - autoscale_profile: Optional["_models.AutoscaleProfile"] = None, - 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, - secrets_profile: Optional["_models.SecretsProfile"] = None, - trino_profile: Optional["_models.TrinoProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword service_configs_profiles: The service configs profiles. - :paramtype service_configs_profiles: - list[~azure.mgmt.hdinsightcontainers.models.ClusterServiceConfigsProfile] - :keyword ssh_profile: Ssh profile for the cluster. - :paramtype ssh_profile: ~azure.mgmt.hdinsightcontainers.models.SshProfile - :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 authorization_profile: Authorization profile with details of AAD user Ids and group - Ids authorized for data plane access. - :paramtype authorization_profile: ~azure.mgmt.hdinsightcontainers.models.AuthorizationProfile - :keyword log_analytics_profile: Cluster log analytics profile to enable or disable OMS agent - for cluster. - :paramtype log_analytics_profile: - ~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] - :keyword secrets_profile: The cluster secret profile. - :paramtype secrets_profile: ~azure.mgmt.hdinsightcontainers.models.SecretsProfile - :keyword trino_profile: Trino Cluster profile. - :paramtype trino_profile: ~azure.mgmt.hdinsightcontainers.models.TrinoProfile - """ - super().__init__(**kwargs) - self.service_configs_profiles = service_configs_profiles - self.ssh_profile = ssh_profile - self.autoscale_profile = autoscale_profile - 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 - self.secrets_profile = secrets_profile - self.trino_profile = trino_profile diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_patch.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ 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 deleted file mode 100644 index 6f4eb6caeb35..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ._cluster_pools_operations import ClusterPoolsOperations -from ._cluster_pool_available_upgrades_operations import ClusterPoolAvailableUpgradesOperations -from ._cluster_pool_upgrade_histories_operations import ClusterPoolUpgradeHistoriesOperations -from ._clusters_operations import ClustersOperations -from ._cluster_available_upgrades_operations import ClusterAvailableUpgradesOperations -from ._cluster_upgrade_histories_operations import ClusterUpgradeHistoriesOperations -from ._cluster_jobs_operations import ClusterJobsOperations -from ._locations_operations import LocationsOperations -from ._operations import Operations -from ._available_cluster_pool_versions_operations import AvailableClusterPoolVersionsOperations -from ._available_cluster_versions_operations import AvailableClusterVersionsOperations -from ._cluster_libraries_operations import ClusterLibrariesOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ClusterPoolsOperations", - "ClusterPoolAvailableUpgradesOperations", - "ClusterPoolUpgradeHistoriesOperations", - "ClustersOperations", - "ClusterAvailableUpgradesOperations", - "ClusterUpgradeHistoriesOperations", - "ClusterJobsOperations", - "LocationsOperations", - "Operations", - "AvailableClusterPoolVersionsOperations", - "AvailableClusterVersionsOperations", - "ClusterLibrariesOperations", -] -__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/operations/_available_cluster_pool_versions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_pool_versions_operations.py deleted file mode 100644 index e29491773b46..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_pool_versions_operations.py +++ /dev/null @@ -1,165 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, 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.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/availableClusterPoolVersions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _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 AvailableClusterPoolVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s - :attr:`available_cluster_pool_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.ClusterPoolVersion"]: - """Returns a list of available cluster pool versions. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either ClusterPoolVersion or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterPoolVersion] - :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.ClusterPoolVersionsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterPoolVersionsListResult", 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) 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 deleted file mode 100644 index 52d901fa7712..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_available_cluster_versions_operations.py +++ /dev/null @@ -1,165 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, 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.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/availableClusterVersions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _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 AvailableClusterVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s - :attr:`available_cluster_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.ClusterVersion"]: - """Returns a list of available cluster versions. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either ClusterVersion or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterVersion] - :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.ClusterVersionsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterVersionsListResult", 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) 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 deleted file mode 100644 index f4e940fa4098..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_available_upgrades_operations.py +++ /dev/null @@ -1,182 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, 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.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_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", "2024-05-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 - :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: MutableMapping[int, Type[HttpResponseError]] = { - 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, - headers=_headers, - params=_params, - ) - _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.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) 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 deleted file mode 100644 index 70b3e77d3c72..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_jobs_operations.py +++ /dev/null @@ -1,446 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_run_job_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", "2024-05-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}/runJob", - ) # 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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_request( - 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", "2024-05-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}/jobs", - ) # 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") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ClusterJobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s - :attr:`cluster_jobs` 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") - - def _run_job_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_job: Union[_models.ClusterJob, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_job, (IOBase, bytes)): - _content = cluster_job - else: - _json = self._serialize.body(cluster_job, "ClusterJob") - - _request = build_run_job_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_run_job( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_job: _models.ClusterJob, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ClusterJob]: - """Operations on jobs of HDInsight on AKS 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_job: The Cluster job. Required. - :type cluster_job: ~azure.mgmt.hdinsightcontainers.models.ClusterJob - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ClusterJob or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterJob] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_run_job( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_job: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ClusterJob]: - """Operations on jobs of HDInsight on AKS 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_job: The Cluster job. Required. - :type cluster_job: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ClusterJob or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterJob] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_run_job( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_job: Union[_models.ClusterJob, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ClusterJob]: - """Operations on jobs of HDInsight on AKS 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_job: The Cluster job. Is either a ClusterJob type or a IO[bytes] type. Required. - :type cluster_job: ~azure.mgmt.hdinsightcontainers.models.ClusterJob or IO[bytes] - :return: An instance of LROPoller that returns either ClusterJob or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hdinsightcontainers.models.ClusterJob] - :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.ClusterJob] = 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._run_job_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - cluster_job=cluster_job, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClusterJob", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.ClusterJob].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ClusterJob]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list( - 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. - - :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 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 - :return: An iterator like instance of either ClusterJob or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterJob] - :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.ClusterJobList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterJobList", 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) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_libraries_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_libraries_operations.py deleted file mode 100644 index 2c0eb090ff2f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_libraries_operations.py +++ /dev/null @@ -1,442 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - subscription_id: str, - *, - category: Union[str, _models.Category], - **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", "2024-05-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}/libraries", - ) # 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") - _params["$category"] = _SERIALIZER.query("category", category, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_manage_libraries_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", "2024-05-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}/manageLibraries", - ) # 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 - 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 ClusterLibrariesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s - :attr:`cluster_libraries` 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, - category: Union[str, _models.Category], - **kwargs: Any - ) -> Iterable["_models.ClusterLibrary"]: - """Get all libraries of HDInsight on AKS 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 category: The system query option to filter libraries returned in the response. Allowed - value is 'custom' or 'predefined'. Known values are: "custom" and "predefined". Required. - :type category: str or ~azure.mgmt.hdinsightcontainers.models.Category - :return: An iterator like instance of either ClusterLibrary or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterLibrary] - :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.ClusterLibraryList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - category=category, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterLibraryList", 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) - - def _manage_libraries_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - operation: Union[_models.ClusterLibraryManagementOperation, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(operation, (IOBase, bytes)): - _content = operation - else: - _json = self._serialize.body(operation, "ClusterLibraryManagementOperation") - - _request = build_manage_libraries_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_manage_libraries( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - operation: _models.ClusterLibraryManagementOperation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Library management operations on HDInsight on AKS 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 operation: The library management operation. Required. - :type operation: ~azure.mgmt.hdinsightcontainers.models.ClusterLibraryManagementOperation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_manage_libraries( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - operation: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Library management operations on HDInsight on AKS 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 operation: The library management operation. Required. - :type operation: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_manage_libraries( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - operation: Union[_models.ClusterLibraryManagementOperation, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Library management operations on HDInsight on AKS 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 operation: The library management operation. Is either a - ClusterLibraryManagementOperation type or a IO[bytes] type. Required. - :type operation: ~azure.mgmt.hdinsightcontainers.models.ClusterLibraryManagementOperation or - IO[bytes] - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = 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[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._manage_libraries_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - operation=operation, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 840d4c9f598d..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pool_available_upgrades_operations.py +++ /dev/null @@ -1,178 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, 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.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_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", "2024-05-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 - :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: MutableMapping[int, Type[HttpResponseError]] = { - 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, - headers=_headers, - params=_params, - ) - _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.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) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pool_upgrade_histories_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pool_upgrade_histories_operations.py deleted file mode 100644 index c00d8f033910..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pool_upgrade_histories_operations.py +++ /dev/null @@ -1,178 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, 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.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_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", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/upgradeHistories", - ) # 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 ClusterPoolUpgradeHistoriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s - :attr:`cluster_pool_upgrade_histories` 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.ClusterPoolUpgradeHistory"]: - """Returns a list of upgrade history. - - :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 - :return: An iterator like instance of either ClusterPoolUpgradeHistory or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgradeHistory] - :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.ClusterPoolUpgradeHistoryListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterPoolUpgradeHistoryListResult", 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) 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 deleted file mode 100644 index f3a5334bc5e4..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_pools_operations.py +++ /dev/null @@ -1,1202 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, 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", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}", - ) # 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) - - -def build_create_or_update_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", "2024-05-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}", - ) # 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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_tags_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", "2024-05-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}", - ) # 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_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", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}", - ) # 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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusterpools") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "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) - - -def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools", - ) # 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 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_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", "2024-05-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:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s - :attr:`cluster_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, cluster_pool_name: str, **kwargs: Any) -> _models.ClusterPool: - """Gets 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 - :return: ClusterPool or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.ClusterPool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterPool] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ClusterPool", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool: Union[_models.ClusterPool, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_pool, (IOBase, bytes)): - _content = cluster_pool - else: - _json = self._serialize.body(cluster_pool, "ClusterPool") - - _request = build_create_or_update_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - 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 = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool: _models.ClusterPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ClusterPool]: - """Creates or updates 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: The Cluster Pool to create. Required. - :type cluster_pool: ~azure.mgmt.hdinsightcontainers.models.ClusterPool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_create_or_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ClusterPool]: - """Creates or updates 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: The Cluster Pool to create. Required. - :type cluster_pool: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_create_or_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool: Union[_models.ClusterPool, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ClusterPool]: - """Creates or updates 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: The Cluster Pool to create. Is either a ClusterPool type or a IO[bytes] - type. Required. - :type cluster_pool: ~azure.mgmt.hdinsightcontainers.models.ClusterPool or IO[bytes] - :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._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_pool=cluster_pool, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClusterPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ClusterPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ClusterPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_tags_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool_tags: Union[_models.TagsObject, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_pool_tags, (IOBase, bytes)): - _content = cluster_pool_tags - else: - _json = self._serialize.body(cluster_pool_tags, "TagsObject") - - _request = build_update_tags_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update_tags( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool_tags: _models.TagsObject, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ClusterPool]: - """Updates an existing Cluster Pool Tags. - - :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_tags: Parameters supplied to update tags. Required. - :type cluster_pool_tags: ~azure.mgmt.hdinsightcontainers.models.TagsObject - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_update_tags( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool_tags: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ClusterPool]: - """Updates an existing Cluster Pool Tags. - - :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_tags: Parameters supplied to update tags. Required. - :type cluster_pool_tags: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_update_tags( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool_tags: Union[_models.TagsObject, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ClusterPool]: - """Updates an existing Cluster Pool Tags. - - :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_tags: Parameters supplied to update tags. Is either a TagsObject type or a - IO[bytes] type. Required. - :type cluster_pool_tags: ~azure.mgmt.hdinsightcontainers.models.TagsObject or IO[bytes] - :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._update_tags_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_pool_tags=cluster_pool_tags, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClusterPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ClusterPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ClusterPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, cluster_pool_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, cluster_pool_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes 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 - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ClusterPool"]: - """Gets the list of Cluster Pools within a Subscription. - - :return: An iterator like instance of either ClusterPool or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterPool] - :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.ClusterPoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterPoolListResult", 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) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ClusterPool"]: - """Lists the HDInsight cluster pools under a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either ClusterPool or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterPool] - :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.ClusterPoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterPoolListResult", 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) - - def _upgrade_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_pool_upgrade_request: Union[_models.ClusterPoolUpgrade, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[Iterator[bytes]] = 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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @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 - :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[bytes], - *, - 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[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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[bytes]], - **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[bytes] type. Required. - :type cluster_pool_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterPoolUpgrade - or IO[bytes] - :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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClusterPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.ClusterPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ClusterPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_upgrade_histories_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_upgrade_histories_operations.py deleted file mode 100644 index a57e536794fd..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_cluster_upgrade_histories_operations.py +++ /dev/null @@ -1,182 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, 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.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_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", "2024-05-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}/upgradeHistories", - ) # 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 ClusterUpgradeHistoriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s - :attr:`cluster_upgrade_histories` 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.ClusterUpgradeHistory"]: - """Returns a list of upgrade history. - - :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 - :return: An iterator like instance of either ClusterUpgradeHistory or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeHistory] - :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.ClusterUpgradeHistoryListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterUpgradeHistoryListResult", 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) 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 deleted file mode 100644 index 882797ffb963..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_clusters_operations.py +++ /dev/null @@ -1,1991 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_cluster_pool_name_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", "2024-05-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", - ) # 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) - - -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", "2024-05-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_upgrade_manual_rollback_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", "2024-05-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}/rollback", - ) # 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", "2024-05-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}/resize", - ) # 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_get_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", "2024-05-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}", - ) # 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) - - -def build_create_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", "2024-05-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}", - ) # 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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_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", "2024-05-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}", - ) # 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_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", "2024-05-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}", - ) # 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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_service_configs_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", "2024-05-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}/serviceConfigs", - ) # 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) - - -def build_list_instance_views_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", "2024-05-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}/instanceViews", - ) # 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) - - -def build_get_instance_view_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", "2024-05-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}/instanceViews/default", - ) # 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 ClustersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s - :attr:`clusters` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cluster_pool_name( - self, resource_group_name: str, cluster_pool_name: str, **kwargs: Any - ) -> Iterable["_models.Cluster"]: - """Lists the HDInsight cluster pools under a resource group. - - :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 - :return: An iterator like instance of either Cluster or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.Cluster] - :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.ClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_cluster_pool_name_request( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterListResult", 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) - - def _upgrade_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_upgrade_request: Union[_models.ClusterUpgrade, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[Iterator[bytes]] = 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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @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 - :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[bytes], - *, - 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[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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[bytes]], - **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[bytes] type. Required. - :type cluster_upgrade_request: ~azure.mgmt.hdinsightcontainers.models.ClusterUpgrade or - IO[bytes] - :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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _upgrade_manual_rollback_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_rollback_upgrade_request: Union[_models.ClusterUpgradeRollback, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_rollback_upgrade_request, (IOBase, bytes)): - _content = cluster_rollback_upgrade_request - else: - _json = self._serialize.body(cluster_rollback_upgrade_request, "ClusterUpgradeRollback") - - _request = build_upgrade_manual_rollback_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_upgrade_manual_rollback( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_rollback_upgrade_request: _models.ClusterUpgradeRollback, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Manual rollback upgrade for 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_rollback_upgrade_request: Manual rollback upgrade for a cluster. Required. - :type cluster_rollback_upgrade_request: - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeRollback - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_manual_rollback( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_rollback_upgrade_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Manual rollback upgrade for 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_rollback_upgrade_request: Manual rollback upgrade for a cluster. Required. - :type cluster_rollback_upgrade_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_manual_rollback( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_rollback_upgrade_request: Union[_models.ClusterUpgradeRollback, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Manual rollback upgrade for 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_rollback_upgrade_request: Manual rollback upgrade for a cluster. Is either a - ClusterUpgradeRollback type or a IO[bytes] type. Required. - :type cluster_rollback_upgrade_request: - ~azure.mgmt.hdinsightcontainers.models.ClusterUpgradeRollback or IO[bytes] - :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_manual_rollback_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - cluster_rollback_upgrade_request=cluster_rollback_upgrade_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _resize_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_resize_request: Union[_models.ClusterResizeData, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_resize_request, (IOBase, bytes)): - _content = cluster_resize_request - else: - _json = self._serialize.body(cluster_resize_request, "ClusterResizeData") - - _request = build_resize_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_resize( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_resize_request: _models.ClusterResizeData, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Resize an existing 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_resize_request: Resize a cluster. Required. - :type cluster_resize_request: ~azure.mgmt.hdinsightcontainers.models.ClusterResizeData - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_resize( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_resize_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Resize an existing 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_resize_request: Resize a cluster. Required. - :type cluster_resize_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_resize( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_resize_request: Union[_models.ClusterResizeData, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Resize an existing 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_resize_request: Resize a cluster. Is either a ClusterResizeData type or a - IO[bytes] type. Required. - :type cluster_resize_request: ~azure.mgmt.hdinsightcontainers.models.ClusterResizeData or - IO[bytes] - :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._resize_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - cluster_resize_request=cluster_resize_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> _models.Cluster: - """Gets a HDInsight 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 - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - _request = build_get_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - hd_insight_cluster: Union[_models.Cluster, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(hd_insight_cluster, (IOBase, bytes)): - _content = hd_insight_cluster - else: - _json = self._serialize.body(hd_insight_cluster, "Cluster") - - _request = build_create_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - 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 = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - hd_insight_cluster: _models.Cluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Creates 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 hd_insight_cluster: The cluster to create. Required. - :type hd_insight_cluster: ~azure.mgmt.hdinsightcontainers.models.Cluster - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_create( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - hd_insight_cluster: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Creates 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 hd_insight_cluster: The cluster to create. Required. - :type hd_insight_cluster: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_create( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - hd_insight_cluster: Union[_models.Cluster, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Creates 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 hd_insight_cluster: The cluster to create. Is either a Cluster type or a IO[bytes] type. - Required. - :type hd_insight_cluster: ~azure.mgmt.hdinsightcontainers.models.Cluster or IO[bytes] - :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._create_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - hd_insight_cluster=hd_insight_cluster, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_patch_request: Union[_models.ClusterPatch, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster_patch_request, (IOBase, bytes)): - _content = cluster_patch_request - else: - _json = self._serialize.body(cluster_patch_request, "ClusterPatch") - - _request = build_update_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_patch_request: _models.ClusterPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Updates an existing 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_patch_request: Patch a cluster. Required. - :type cluster_patch_request: ~azure.mgmt.hdinsightcontainers.models.ClusterPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_patch_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Updates an existing 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_patch_request: Patch a cluster. Required. - :type cluster_patch_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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_update( - self, - resource_group_name: str, - cluster_pool_name: str, - cluster_name: str, - cluster_patch_request: Union[_models.ClusterPatch, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Updates an existing 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_patch_request: Patch a cluster. Is either a ClusterPatch type or a IO[bytes] - type. Required. - :type cluster_patch_request: ~azure.mgmt.hdinsightcontainers.models.ClusterPatch or IO[bytes] - :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._update_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - cluster_patch_request=cluster_patch_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes 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 - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_pool_name=cluster_pool_name, - cluster_name=cluster_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_service_configs( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.ServiceConfigResult"]: - """Lists the config dump of all services running in 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 - :return: An iterator like instance of either ServiceConfigResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ServiceConfigResult] - :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.ServiceConfigListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_service_configs_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, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServiceConfigListResult", 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) - - @distributed_trace - def list_instance_views( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.ClusterInstanceViewResult"]: - """Lists the lists of instance views. - - :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 - :return: An iterator like instance of either ClusterInstanceViewResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewResult] - :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.ClusterInstanceViewsResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_instance_views_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, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterInstanceViewsResult", 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) - - @distributed_trace - def get_instance_view( - self, resource_group_name: str, cluster_pool_name: str, cluster_name: str, **kwargs: Any - ) -> _models.ClusterInstanceViewResult: - """Gets the status of a cluster instance. - - :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 - :return: ClusterInstanceViewResult or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.ClusterInstanceViewResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterInstanceViewResult] = kwargs.pop("cls", None) - - _request = build_get_instance_view_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ClusterInstanceViewResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 230cbdc4ac28..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_locations_operations.py +++ /dev/null @@ -1,209 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_check_name_availability_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-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}/providers/Microsoft.HDInsight/locations/{location}/checkNameAvailability", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _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 LocationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s - :attr:`locations` 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") - - @overload - def check_name_availability( - self, - location: str, - name_availability_parameters: _models.NameAvailabilityParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.NameAvailabilityResult: - """Check the availability of the resource name. - - :param location: The name of the Azure region. Required. - :type location: str - :param name_availability_parameters: The name and type of the resource. Required. - :type name_availability_parameters: - ~azure.mgmt.hdinsightcontainers.models.NameAvailabilityParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.NameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def check_name_availability( - self, - location: str, - name_availability_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.NameAvailabilityResult: - """Check the availability of the resource name. - - :param location: The name of the Azure region. Required. - :type location: str - :param name_availability_parameters: The name and type of the resource. Required. - :type name_availability_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: NameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.NameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def check_name_availability( - self, - location: str, - name_availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], - **kwargs: Any - ) -> _models.NameAvailabilityResult: - """Check the availability of the resource name. - - :param location: The name of the Azure region. Required. - :type location: str - :param name_availability_parameters: The name and type of the resource. Is either a - NameAvailabilityParameters type or a IO[bytes] type. Required. - :type name_availability_parameters: - ~azure.mgmt.hdinsightcontainers.models.NameAvailabilityParameters or IO[bytes] - :return: NameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.hdinsightcontainers.models.NameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NameAvailabilityResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(name_availability_parameters, (IOBase, bytes)): - _content = name_availability_parameters - else: - _json = self._serialize.body(name_availability_parameters, "NameAvailabilityParameters") - - _request = build_check_name_availability_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NameAvailabilityResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 1c15d5a739f6..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_operations.py +++ /dev/null @@ -1,152 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, 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.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_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", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.HDInsight/operations") - - # 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 Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.hdinsightcontainers.HDInsightContainersMgmtClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """Returns list of operations. - - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hdinsightcontainers.models.Operation] - :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.OperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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( - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", 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) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_patch.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/py.typed b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/azure/mgmt/hdinsightcontainers/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/dev_requirements.txt b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/dev_requirements.txt deleted file mode 100644 index bb03d6c61439..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/dev_requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ --e ../../../eng/tools/azure-sdk-tools --e ../../identity/azure-identity --e ../../resources/azure-mgmt-resource -aiohttp \ No newline at end of file diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/cluster_upgrade_rollback.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/cluster_upgrade_rollback.py deleted file mode 100644 index 1b8129d5b91b..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/cluster_upgrade_rollback.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hdinsightcontainers -# USAGE - python cluster_upgrade_rollback.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_manual_rollback( - resource_group_name="hiloResourcegroup", - cluster_pool_name="clusterpool1", - cluster_name="cluster1", - cluster_rollback_upgrade_request={ - "properties": { - "upgradeHistory": "/subscriptions/10e32bab-26da-4cc4-a441-52b318f824e6/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterpools/clusterpool1/clusters/cluster1/upgradeHistories/01_11_2024_02_35_03_AM-HotfixUpgrade" - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ClusterUpgradeRollback.json -if __name__ == "__main__": - main() 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 deleted file mode 100644 index 6c8824e341f2..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_autoscale_cluster.py +++ /dev/null @@ -1,108 +0,0 @@ -# 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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hdinsightcontainers -# USAGE - python create_autoscale_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"]}, - "autoscaleProfile": { - "autoscaleType": "ScheduleBased", - "enabled": True, - "gracefulDecommissionTimeout": 3600, - "loadBasedConfig": { - "cooldownPeriod": 300, - "maxNodes": 20, - "minNodes": 10, - "pollInterval": 60, - "scalingRules": [ - { - "actionType": "scaleup", - "comparisonRule": {"operator": "greaterThan", "threshold": 90}, - "evaluationCount": 3, - "scalingMetric": "cpu", - }, - { - "actionType": "scaledown", - "comparisonRule": {"operator": "lessThan", "threshold": 20}, - "evaluationCount": 3, - "scalingMetric": "cpu", - }, - ], - }, - "scheduleBasedConfig": { - "defaultCount": 10, - "schedules": [ - {"count": 20, "days": ["Monday"], "endTime": "12:00", "startTime": "00:00"}, - {"count": 25, "days": ["Sunday"], "endTime": "12:00", "startTime": "00:00"}, - ], - "timeZone": "Cen. Australia Standard Time", - }, - }, - "clusterVersion": "1.0.6", - "managedIdentityProfile": { - "identityList": [ - { - "clientId": "de91f1d8-767f-460a-ac11-3cf103f74b34", - "objectId": "40491351-c240-4042-91e0-f644a1d2b441", - "resourceId": "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi", - "type": "cluster", - } - ] - }, - "ossVersion": "0.410.0", - "sshProfile": {"count": 2, "vmSize": "Standard_E8as_v5"}, - "trinoProfile": {}, - }, - "clusterType": "Trino", - "computeProfile": { - "availabilityZones": ["1", "2", "3"], - "nodes": [ - {"count": 2, "type": "Head", "vmSize": "Standard_E8as_v5"}, - {"count": 3, "type": "Worker", "vmSize": "Standard_E8as_v5"}, - ], - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 5e7a05ef6c8f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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, IO, Union - -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.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": {"availabilityZones": ["1", "2", "3"], "vmSize": "Standard_D3_v2"}, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 7381f5dc6914..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool_with_private_aks.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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, IO, Union - -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": {"availabilityZones": ["1", "2", "3"], "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/2024-05-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 deleted file mode 100644 index 40c54a5c4927..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_cluster_pool_with_udr_aks.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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, IO, Union - -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": {"availabilityZones": ["1", "2", "3"], "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/2024-05-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 deleted file mode 100644 index d62f827d2006..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_ranger_cluster.py +++ /dev/null @@ -1,88 +0,0 @@ -# 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, IO, Union - -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", - "managedIdentityProfile": { - "identityList": [ - { - "clientId": "de91f1d8-767f-460a-ac11-3cf103f74b34", - "objectId": "40491351-c240-4042-91e0-f644a1d2b441", - "resourceId": "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi", - "type": "cluster", - } - ] - }, - "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": { - "availabilityZones": ["1", "2", "3"], - "nodes": [{"count": 2, "type": "head", "vmSize": "Standard_D3_v2"}], - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 50aa9ab5ee06..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_spark_cluster.py +++ /dev/null @@ -1,109 +0,0 @@ -# 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, IO, Union - -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.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", - "managedIdentityProfile": { - "identityList": [ - { - "clientId": "de91f1d8-767f-460a-ac11-3cf103f74b34", - "objectId": "40491351-c240-4042-91e0-f644a1d2b441", - "resourceId": "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi", - "type": "cluster", - } - ] - }, - "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, "vmSize": "Standard_D3_v2"}, - }, - "clusterType": "spark", - "computeProfile": { - "availabilityZones": ["1", "2", "3"], - "nodes": [{"count": 4, "type": "worker", "vmSize": "Standard_D3_v2"}], - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 66bf16040845..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/create_spark_cluster_with_internal_ingress.py +++ /dev/null @@ -1,110 +0,0 @@ -# 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, IO, Union - -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", - "managedIdentityProfile": { - "identityList": [ - { - "clientId": "de91f1d8-767f-460a-ac11-3cf103f74b34", - "objectId": "40491351-c240-4042-91e0-f644a1d2b441", - "resourceId": "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi", - "type": "cluster", - } - ] - }, - "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, "vmSize": "Standard_D3_v2"}, - }, - "clusterType": "spark", - "computeProfile": { - "availabilityZones": ["1", "2", "3"], - "nodes": [{"count": 4, "type": "worker", "vmSize": "Standard_D3_v2"}], - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 9021d4927783..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/delete_cluster.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 delete_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", - ) - - client.clusters.begin_delete( - resource_group_name="rg1", - cluster_pool_name="clusterpool1", - cluster_name="cluster1", - ).result() - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 2c6721e7b613..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/delete_cluster_pool.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 delete_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", - ) - - client.cluster_pools.begin_delete( - resource_group_name="rg1", - cluster_pool_name="clusterpool1", - ).result() - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 1b338d65d4fa..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 get_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.get( - resource_group_name="hiloResourcegroup", - cluster_pool_name="clusterpool1", - cluster_name="cluster1", - ) - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 6c6c280fb4cb..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster_instance_view.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 get_cluster_instance_view.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.get_instance_view( - resource_group_name="rg1", - cluster_pool_name="clusterPool1", - cluster_name="cluster1", - ) - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index d47c94c94afe..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_cluster_pool.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 get_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.get( - resource_group_name="hiloResourcegroup", - cluster_pool_name="clusterpool1", - ) - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 408069aa0112..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/get_operations.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 get_operations.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.operations.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/GetOperations.json -if __name__ == "__main__": - main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/install_new_cluster_libraries.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/install_new_cluster_libraries.py deleted file mode 100644 index 3d2bfd01c2e9..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/install_new_cluster_libraries.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hdinsightcontainers -# USAGE - python install_new_cluster_libraries.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="00000000-0000-0000-0000-000000000000", - ) - - client.cluster_libraries.begin_manage_libraries( - resource_group_name="hiloResourceGroup", - cluster_pool_name="clusterPool", - cluster_name="cluster", - operation={ - "properties": { - "action": "Install", - "libraries": [ - { - "properties": { - "name": "requests", - "remarks": "PyPi packages.", - "type": "pypi", - "version": "2.31.0", - } - }, - { - "properties": { - "groupId": "org.apache.flink", - "name": "flink-connector-kafka", - "remarks": "Maven packages.", - "type": "maven", - "version": "3.0.2-1.18", - } - }, - ], - } - }, - ).result() - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/InstallNewClusterLibraries.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 deleted file mode 100644 index 33a84af0159f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_available_cluster_pool_versions.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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_available_cluster_pool_versions.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.available_cluster_pool_versions.list_by_location( - location="westus2", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 43485773c511..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_available_cluster_versions.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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_available_cluster_versions.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.available_cluster_versions.list_by_location( - location="westus2", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index d0432f142e4d..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_available_upgrades.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/2024-05-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 deleted file mode 100644 index f37f72188c55..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_instance_views.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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_instance_views.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.list_instance_views( - resource_group_name="rg1", - 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/2024-05-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 deleted file mode 100644 index 4cfbba564037..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_jobs.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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_jobs.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="00000000-0000-0000-0000-000000000000", - ) - - response = client.cluster_jobs.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/2024-05-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 deleted file mode 100644 index ef69921be1a9..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pool_available_upgrades.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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/2024-05-01-preview/examples/ListClusterPoolAvailableUpgrades.json -if __name__ == "__main__": - main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pool_upgrade_history.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pool_upgrade_history.py deleted file mode 100644 index 623582a9d61e..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pool_upgrade_history.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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_upgrade_history.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_upgrade_histories.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/2024-05-01-preview/examples/ListClusterPoolUpgradeHistory.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 deleted file mode 100644 index ddbfe31f4de6..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pools.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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_pools.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.list_by_resource_group( - resource_group_name="hiloResourcegroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index b31e3ce9941e..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_pools_subscription.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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_pools_subscription.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.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 3f8c49ad1b26..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_service_configs.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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_service_configs.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.list_service_configs( - resource_group_name="rg1", - 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/2024-05-01-preview/examples/ListClusterServiceConfigs.json -if __name__ == "__main__": - main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_upgrade_history.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_upgrade_history.py deleted file mode 100644 index 66cc5f419109..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_cluster_upgrade_history.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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_upgrade_history.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_upgrade_histories.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/2024-05-01-preview/examples/ListClusterUpgradeHistory.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 deleted file mode 100644 index 71c61ae3beaf..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/list_clusters_by_cluster_pool_name.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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_clusters_by_cluster_pool_name.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.list_by_cluster_pool_name( - 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/2024-05-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 deleted file mode 100644 index 19e470f10f50..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/locations_name_availability.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hdinsightcontainers -# USAGE - python locations_name_availability.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.locations.check_name_availability( - location="southeastasia", - name_availability_parameters={"name": "contosemember1", "type": "Microsoft.HDInsight/clusterPools/clusters"}, - ) - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 4aa24497f537..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_cluster.py +++ /dev/null @@ -1,115 +0,0 @@ -# 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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hdinsightcontainers -# USAGE - python patch_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={ - "properties": { - "clusterProfile": { - "authorizationProfile": {"userIds": ["Testuser1", "Testuser2"]}, - "autoscaleProfile": { - "autoscaleType": "ScheduleBased", - "enabled": True, - "gracefulDecommissionTimeout": -1, - "scheduleBasedConfig": { - "defaultCount": 3, - "schedules": [ - { - "count": 3, - "days": ["Monday, Tuesday, Wednesday"], - "endTime": "12:00", - "startTime": "00:00", - }, - {"count": 3, "days": ["Sunday"], "endTime": "12:00", "startTime": "00:00"}, - ], - "timeZone": "Cen. Australia Standard Time", - }, - }, - "logAnalyticsProfile": { - "applicationLogs": {"stdErrorEnabled": True, "stdOutEnabled": True}, - "enabled": True, - "metricsEnabled": True, - }, - "serviceConfigsProfiles": [ - { - "configs": [ - { - "component": "TestComp1", - "files": [ - { - "fileName": "TestFile1", - "values": {"Test.config.1": "1", "Test.config.2": "2"}, - }, - { - "fileName": "TestFile2", - "values": {"Test.config.3": "3", "Test.config.4": "4"}, - }, - ], - }, - { - "component": "TestComp2", - "files": [ - {"content": "TestContent", "fileName": "TestFile3", "path": "TestPath"}, - { - "fileName": "TestFile4", - "values": {"Test.config.7": "7", "Test.config.8": "8"}, - }, - ], - }, - ], - "serviceName": "TestService1", - }, - { - "configs": [ - { - "component": "TestComp3", - "files": [{"fileName": "TestFile5", "values": {"Test.config.9": "9"}}], - } - ], - "serviceName": "TestService2", - }, - ], - "sshProfile": {"count": 2}, - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 4b9c6c8f8428..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_cluster_pool.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hdinsightcontainers -# USAGE - python patch_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_update_tags( - resource_group_name="hiloResourcegroup", - cluster_pool_name="clusterpool1", - cluster_pool_tags={"tags": {"tag1": "value1", "tag2": "value2"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index b7e133576c13..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/patch_ranger_cluster.py +++ /dev/null @@ -1,69 +0,0 @@ -# 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, IO, Union - -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={ - "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/2024-05-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 deleted file mode 100644 index d71b877f7a13..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/resize_cluster.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hdinsightcontainers -# USAGE - python resize_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_resize( - resource_group_name="hiloResourcegroup", - cluster_pool_name="clusterpool1", - cluster_name="cluster1", - cluster_resize_request={"location": "West US 2", "properties": {"targetWorkerNodeCount": 5}}, - ).result() - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-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 deleted file mode 100644 index 11b5f28b9f64..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/run_cluster_job.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hdinsightcontainers -# USAGE - python run_cluster_job.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="00000000-0000-0000-0000-000000000000", - ) - - response = client.cluster_jobs.begin_run_job( - resource_group_name="hiloResourcegroup", - cluster_pool_name="clusterpool1", - cluster_name="cluster1", - cluster_job={ - "properties": { - "action": "START", - "entryClass": "com.microsoft.hilo.flink.job.streaming.SleepJob", - "flinkConfiguration": { - "parallelism": "1", - "savepoint.directory": "abfs://flinkjob@hilosa.dfs.core.windows.net/savepoint", - }, - "jarName": "flink-sleep-job-0.0.1-SNAPSHOT.jar", - "jobJarDirectory": "abfs://flinkjob@hilosa.dfs.core.windows.net/jars", - "jobName": "flink-job-name", - "jobType": "FlinkJob", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/RunClusterJob.json -if __name__ == "__main__": - main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/uninstall_existing_cluster_libraries.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/uninstall_existing_cluster_libraries.py deleted file mode 100644 index 64fd07a03fc6..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/uninstall_existing_cluster_libraries.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hdinsightcontainers -# USAGE - python uninstall_existing_cluster_libraries.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="00000000-0000-0000-0000-000000000000", - ) - - client.cluster_libraries.begin_manage_libraries( - resource_group_name="hiloResourceGroup", - cluster_pool_name="clusterPool", - cluster_name="cluster", - operation={ - "properties": { - "action": "Uninstall", - "libraries": [ - {"properties": {"name": "tensorflow", "type": "pypi"}}, - {"properties": {"groupId": "org.apache.flink", "name": "flink-connector-hudi", "type": "maven"}}, - ], - } - }, - ).result() - - -# x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/UninstallExistingClusterLibraries.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 deleted file mode 100644 index a5b79b931f67..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_aks_patch_version_for_cluster.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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, IO, Union - -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/2024-05-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 deleted file mode 100644 index 9879515f3031..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_aks_patch_version_for_cluster_pool.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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, IO, Union - -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/2024-05-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 deleted file mode 100644 index 877152235ae2..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_hotfix_for_cluster.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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, IO, Union - -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/2024-05-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 deleted file mode 100644 index 7282828fdbfc..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_samples/upgrade_node_os_for_cluster_pool.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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, IO, Union - -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/2024-05-01-preview/examples/UpgradeNodeOsForClusterPool.json -if __name__ == "__main__": - main() diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/conftest.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/conftest.py deleted file mode 100644 index 51e1df1ca18f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/conftest.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import os -import pytest -from dotenv import load_dotenv -from devtools_testutils import ( - test_proxy, - add_general_regex_sanitizer, - add_body_key_sanitizer, - add_header_regex_sanitizer, -) - -load_dotenv() - - -# aovid record sensitive identity information in recordings -@pytest.fixture(scope="session", autouse=True) -def add_sanitizers(test_proxy): - hdinsightcontainersmgmt_subscription_id = os.environ.get( - "AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" - ) - hdinsightcontainersmgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") - hdinsightcontainersmgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") - hdinsightcontainersmgmt_client_secret = os.environ.get( - "AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" - ) - add_general_regex_sanitizer( - regex=hdinsightcontainersmgmt_subscription_id, value="00000000-0000-0000-0000-000000000000" - ) - add_general_regex_sanitizer(regex=hdinsightcontainersmgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=hdinsightcontainersmgmt_client_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer( - regex=hdinsightcontainersmgmt_client_secret, value="00000000-0000-0000-0000-000000000000" - ) - - add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") - add_header_regex_sanitizer(key="Cookie", value="cookie;") - add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_pool_versions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_pool_versions_operations.py deleted file mode 100644 index cf105e7e08f2..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_pool_versions_operations.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtAvailableClusterPoolVersionsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_location(self, resource_group): - response = self.client.available_cluster_pool_versions.list_by_location( - location="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_pool_versions_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_pool_versions_operations_async.py deleted file mode 100644 index c618b67f0c6e..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_pool_versions_operations_async.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtAvailableClusterPoolVersionsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_by_location(self, resource_group): - response = self.client.available_cluster_pool_versions.list_by_location( - location="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_versions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_versions_operations.py deleted file mode 100644 index 3f51719bddba..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_versions_operations.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtAvailableClusterVersionsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_location(self, resource_group): - response = self.client.available_cluster_versions.list_by_location( - location="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_versions_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_versions_operations_async.py deleted file mode 100644 index 4a98579dc446..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_available_cluster_versions_operations_async.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtAvailableClusterVersionsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_by_location(self, resource_group): - response = self.client.available_cluster_versions.list_by_location( - location="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_available_upgrades_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_available_upgrades_operations.py deleted file mode 100644 index 86bd41449245..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_available_upgrades_operations.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterAvailableUpgradesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.cluster_available_upgrades.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_available_upgrades_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_available_upgrades_operations_async.py deleted file mode 100644 index c5e2b0f9beec..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_available_upgrades_operations_async.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterAvailableUpgradesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.cluster_available_upgrades.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_jobs_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_jobs_operations.py deleted file mode 100644 index 1c4ae391c758..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_jobs_operations.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterJobsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_run_job(self, resource_group): - response = self.client.cluster_jobs.begin_run_job( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - cluster_job={ - "properties": "cluster_job_properties", - "id": "str", - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.cluster_jobs.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_jobs_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_jobs_operations_async.py deleted file mode 100644 index db364904ed8d..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_jobs_operations_async.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterJobsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_run_job(self, resource_group): - response = await ( - await self.client.cluster_jobs.begin_run_job( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - cluster_job={ - "properties": "cluster_job_properties", - "id": "str", - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.cluster_jobs.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_libraries_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_libraries_operations.py deleted file mode 100644 index 0c89531fda08..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_libraries_operations.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterLibrariesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.cluster_libraries.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - category="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_manage_libraries(self, resource_group): - response = self.client.cluster_libraries.begin_manage_libraries( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - operation={ - "properties": { - "action": "str", - "libraries": [ - { - "properties": "cluster_library_properties", - "id": "str", - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - } - ], - }, - "id": "str", - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_libraries_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_libraries_operations_async.py deleted file mode 100644 index 78fba06de4f9..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_libraries_operations_async.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterLibrariesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.cluster_libraries.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - category="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_manage_libraries(self, resource_group): - response = await ( - await self.client.cluster_libraries.begin_manage_libraries( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - operation={ - "properties": { - "action": "str", - "libraries": [ - { - "properties": "cluster_library_properties", - "id": "str", - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - } - ], - }, - "id": "str", - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_available_upgrades_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_available_upgrades_operations.py deleted file mode 100644 index 06f8df4704c3..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_available_upgrades_operations.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterPoolAvailableUpgradesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.cluster_pool_available_upgrades.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_available_upgrades_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_available_upgrades_operations_async.py deleted file mode 100644 index 1b6bb85df159..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_available_upgrades_operations_async.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterPoolAvailableUpgradesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.cluster_pool_available_upgrades.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_upgrade_histories_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_upgrade_histories_operations.py deleted file mode 100644 index ac840de51bf5..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_upgrade_histories_operations.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterPoolUpgradeHistoriesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.cluster_pool_upgrade_histories.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_upgrade_histories_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_upgrade_histories_operations_async.py deleted file mode 100644 index e234bf02a6be..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pool_upgrade_histories_operations_async.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterPoolUpgradeHistoriesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.cluster_pool_upgrade_histories.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pools_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pools_operations.py deleted file mode 100644 index f032a1a2fa15..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pools_operations.py +++ /dev/null @@ -1,145 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterPoolsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.cluster_pools.get( - resource_group_name=resource_group.name, - cluster_pool_name="str", - api_version="2024-05-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): - response = self.client.cluster_pools.begin_create_or_update( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_pool={ - "location": "str", - "id": "str", - "name": "str", - "properties": { - "computeProfile": {"vmSize": "str", "availabilityZones": ["str"], "count": 0}, - "aksClusterProfile": { - "aksClusterAgentPoolIdentityProfile": { - "msiClientId": "str", - "msiObjectId": "str", - "msiResourceId": "str", - }, - "aksClusterResourceId": "str", - "aksVersion": "str", - }, - "aksManagedResourceGroupName": "str", - "clusterPoolProfile": { - "clusterPoolVersion": "str", - "publicIpTag": {"ipTagType": "str", "tag": "str"}, - }, - "deploymentId": "str", - "logAnalyticsProfile": {"enabled": bool, "workspaceId": "str"}, - "managedResourceGroupName": "str", - "networkProfile": { - "subnetId": "str", - "apiServerAuthorizedIpRanges": ["str"], - "enablePrivateApiServer": bool, - "outboundType": "loadBalancer", - }, - "provisioningState": "str", - "status": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_update_tags(self, resource_group): - response = self.client.cluster_pools.begin_update_tags( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_pool_tags={"tags": {"str": "str"}}, - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete(self, resource_group): - response = self.client.cluster_pools.begin_delete( - resource_group_name=resource_group.name, - cluster_pool_name="str", - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_subscription(self, resource_group): - response = self.client.cluster_pools.list_by_subscription( - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): - response = self.client.cluster_pools.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_upgrade(self, resource_group): - response = self.client.cluster_pools.begin_upgrade( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_pool_upgrade_request={"properties": "cluster_pool_upgrade_properties"}, - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pools_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pools_operations_async.py deleted file mode 100644 index db5f8c0d7b3f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_pools_operations_async.py +++ /dev/null @@ -1,154 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterPoolsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get(self, resource_group): - response = await self.client.cluster_pools.get( - resource_group_name=resource_group.name, - cluster_pool_name="str", - api_version="2024-05-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): - response = await ( - await self.client.cluster_pools.begin_create_or_update( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_pool={ - "location": "str", - "id": "str", - "name": "str", - "properties": { - "computeProfile": {"vmSize": "str", "availabilityZones": ["str"], "count": 0}, - "aksClusterProfile": { - "aksClusterAgentPoolIdentityProfile": { - "msiClientId": "str", - "msiObjectId": "str", - "msiResourceId": "str", - }, - "aksClusterResourceId": "str", - "aksVersion": "str", - }, - "aksManagedResourceGroupName": "str", - "clusterPoolProfile": { - "clusterPoolVersion": "str", - "publicIpTag": {"ipTagType": "str", "tag": "str"}, - }, - "deploymentId": "str", - "logAnalyticsProfile": {"enabled": bool, "workspaceId": "str"}, - "managedResourceGroupName": "str", - "networkProfile": { - "subnetId": "str", - "apiServerAuthorizedIpRanges": ["str"], - "enablePrivateApiServer": bool, - "outboundType": "loadBalancer", - }, - "provisioningState": "str", - "status": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_update_tags(self, resource_group): - response = await ( - await self.client.cluster_pools.begin_update_tags( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_pool_tags={"tags": {"str": "str"}}, - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): - response = await ( - await self.client.cluster_pools.begin_delete( - resource_group_name=resource_group.name, - cluster_pool_name="str", - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): - response = self.client.cluster_pools.list_by_subscription( - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): - response = self.client.cluster_pools.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_upgrade(self, resource_group): - response = await ( - await self.client.cluster_pools.begin_upgrade( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_pool_upgrade_request={"properties": "cluster_pool_upgrade_properties"}, - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_upgrade_histories_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_upgrade_histories_operations.py deleted file mode 100644 index 2b26dc19a5dc..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_upgrade_histories_operations.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterUpgradeHistoriesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.cluster_upgrade_histories.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_upgrade_histories_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_upgrade_histories_operations_async.py deleted file mode 100644 index 7e7e5583624e..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_cluster_upgrade_histories_operations_async.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClusterUpgradeHistoriesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.cluster_upgrade_histories.list( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_clusters_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_clusters_operations.py deleted file mode 100644 index 9600e8268f4b..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_clusters_operations.py +++ /dev/null @@ -1,503 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClustersOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_cluster_pool_name(self, resource_group): - response = self.client.clusters.list_by_cluster_pool_name( - resource_group_name=resource_group.name, - cluster_pool_name="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_upgrade(self, resource_group): - response = self.client.clusters.begin_upgrade( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - cluster_upgrade_request={"properties": "cluster_upgrade_properties"}, - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_upgrade_manual_rollback(self, resource_group): - response = self.client.clusters.begin_upgrade_manual_rollback( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - cluster_rollback_upgrade_request={"properties": {"upgradeHistory": "str"}}, - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_resize(self, resource_group): - response = self.client.clusters.begin_resize( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - cluster_resize_request={ - "location": "str", - "id": "str", - "name": "str", - "properties": {"targetWorkerNodeCount": 0}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.clusters.get( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_create(self, resource_group): - response = self.client.clusters.begin_create( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - hd_insight_cluster={ - "location": "str", - "id": "str", - "name": "str", - "properties": { - "clusterProfile": { - "authorizationProfile": {"groupIds": ["str"], "userIds": ["str"]}, - "clusterVersion": "str", - "ossVersion": "str", - "autoscaleProfile": { - "enabled": bool, - "autoscaleType": "str", - "gracefulDecommissionTimeout": 0, - "loadBasedConfig": { - "maxNodes": 0, - "minNodes": 0, - "scalingRules": [ - { - "actionType": "str", - "comparisonRule": {"operator": "str", "threshold": 0.0}, - "evaluationCount": 0, - "scalingMetric": "str", - } - ], - "cooldownPeriod": 0, - "pollInterval": 0, - }, - "scheduleBasedConfig": { - "defaultCount": 0, - "schedules": [{"count": 0, "days": ["str"], "endTime": "str", "startTime": "str"}], - "timeZone": "str", - }, - }, - "clusterAccessProfile": {"enableInternalIngress": bool, "privateLinkServiceId": "str"}, - "components": [{"name": "str", "version": "str"}], - "connectivityProfile": { - "web": {"fqdn": "str", "privateFqdn": "str"}, - "ssh": [{"endpoint": "str", "privateSshEndpoint": "str"}], - }, - "flinkProfile": { - "jobManager": {"cpu": 0.0, "memory": 0}, - "storage": {"storageUri": "str", "storagekey": "str"}, - "taskManager": {"cpu": 0.0, "memory": 0}, - "catalogOptions": { - "hive": { - "metastoreDbConnectionURL": "str", - "metastoreDbConnectionAuthenticationMode": "str", - "metastoreDbConnectionPasswordSecret": "str", - "metastoreDbConnectionUserName": "str", - } - }, - "deploymentMode": "str", - "historyServer": {"cpu": 0.0, "memory": 0}, - "jobSpec": { - "jarName": "str", - "jobJarDirectory": "str", - "upgradeMode": "str", - "args": "str", - "entryClass": "str", - "savePointName": "str", - }, - "numReplicas": 0, - }, - "identityProfile": {"msiClientId": "str", "msiObjectId": "str", "msiResourceId": "str"}, - "kafkaProfile": { - "diskStorage": {"dataDiskSize": 0, "dataDiskType": "str"}, - "connectivityEndpoints": {"bootstrapServerEndpoint": "str", "brokerEndpoints": ["str"]}, - "enableKRaft": True, - "enablePublicEndpoints": False, - "remoteStorageUri": "str", - }, - "llapProfile": {"str": {}}, - "logAnalyticsProfile": { - "enabled": bool, - "applicationLogs": {"stdErrorEnabled": bool, "stdOutEnabled": bool}, - "metricsEnabled": bool, - }, - "managedIdentityProfile": { - "identityList": [{"clientId": "str", "objectId": "str", "resourceId": "str", "type": "str"}] - }, - "prometheusProfile": {"enabled": False}, - "rangerPluginProfile": {"enabled": False}, - "rangerProfile": { - "rangerAdmin": { - "admins": ["str"], - "database": { - "host": "str", - "name": "str", - "passwordSecretRef": "str", - "username": "str", - }, - }, - "rangerUsersync": { - "enabled": True, - "groups": ["str"], - "mode": "automatic", - "userMappingLocation": "str", - "users": ["str"], - }, - "rangerAudit": {"storageAccount": "str"}, - }, - "scriptActionProfiles": [ - { - "name": "str", - "services": ["str"], - "type": "str", - "url": "str", - "parameters": "str", - "shouldPersist": True, - "timeoutInMinutes": 0, - } - ], - "secretsProfile": { - "keyVaultResourceId": "str", - "secrets": [ - {"keyVaultObjectName": "str", "referenceName": "str", "type": "str", "version": "str"} - ], - }, - "serviceConfigsProfiles": [ - { - "configs": [ - { - "component": "str", - "files": [ - { - "fileName": "str", - "content": "str", - "encoding": "str", - "path": "str", - "values": {"str": "str"}, - } - ], - } - ], - "serviceName": "str", - } - ], - "sparkProfile": { - "defaultStorageUrl": "str", - "metastoreSpec": { - "dbName": "str", - "dbServerHost": "str", - "dbConnectionAuthenticationMode": "IdentityAuth", - "dbPasswordSecretName": "str", - "dbUserName": "str", - "keyVaultId": "str", - "thriftUrl": "str", - }, - "userPluginsSpec": {"plugins": [{"path": "str"}]}, - }, - "sshProfile": {"count": 0, "podPrefix": "str", "vmSize": "str"}, - "stubProfile": {"str": {}}, - "trinoProfile": { - "catalogOptions": { - "hive": [ - { - "catalogName": "str", - "metastoreDbConnectionURL": "str", - "metastoreWarehouseDir": "str", - "metastoreDbConnectionAuthenticationMode": "str", - "metastoreDbConnectionPasswordSecret": "str", - "metastoreDbConnectionUserName": "str", - } - ] - }, - "coordinator": { - "debug": {"enable": False, "port": 8008, "suspend": False}, - "highAvailabilityEnabled": True, - }, - "userPluginsSpec": {"plugins": [{"enabled": bool, "name": "str", "path": "str"}]}, - "userTelemetrySpec": { - "storage": { - "hivecatalogName": "str", - "hivecatalogSchema": "trinologs", - "partitionRetentionInDays": 365, - "path": "str", - } - }, - "worker": {"debug": {"enable": False, "port": 8008, "suspend": False}}, - }, - }, - "clusterType": "str", - "computeProfile": { - "nodes": [{"count": 0, "type": "str", "vmSize": "str"}], - "availabilityZones": ["str"], - }, - "deploymentId": "str", - "provisioningState": "str", - "status": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_update(self, resource_group): - response = self.client.clusters.begin_update( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - cluster_patch_request={ - "properties": { - "clusterProfile": { - "authorizationProfile": {"groupIds": ["str"], "userIds": ["str"]}, - "autoscaleProfile": { - "enabled": bool, - "autoscaleType": "str", - "gracefulDecommissionTimeout": 0, - "loadBasedConfig": { - "maxNodes": 0, - "minNodes": 0, - "scalingRules": [ - { - "actionType": "str", - "comparisonRule": {"operator": "str", "threshold": 0.0}, - "evaluationCount": 0, - "scalingMetric": "str", - } - ], - "cooldownPeriod": 0, - "pollInterval": 0, - }, - "scheduleBasedConfig": { - "defaultCount": 0, - "schedules": [{"count": 0, "days": ["str"], "endTime": "str", "startTime": "str"}], - "timeZone": "str", - }, - }, - "logAnalyticsProfile": { - "enabled": bool, - "applicationLogs": {"stdErrorEnabled": bool, "stdOutEnabled": bool}, - "metricsEnabled": bool, - }, - "prometheusProfile": {"enabled": False}, - "rangerPluginProfile": {"enabled": False}, - "rangerProfile": { - "rangerAdmin": { - "admins": ["str"], - "database": { - "host": "str", - "name": "str", - "passwordSecretRef": "str", - "username": "str", - }, - }, - "rangerUsersync": { - "enabled": True, - "groups": ["str"], - "mode": "automatic", - "userMappingLocation": "str", - "users": ["str"], - }, - "rangerAudit": {"storageAccount": "str"}, - }, - "scriptActionProfiles": [ - { - "name": "str", - "services": ["str"], - "type": "str", - "url": "str", - "parameters": "str", - "shouldPersist": True, - "timeoutInMinutes": 0, - } - ], - "secretsProfile": { - "keyVaultResourceId": "str", - "secrets": [ - {"keyVaultObjectName": "str", "referenceName": "str", "type": "str", "version": "str"} - ], - }, - "serviceConfigsProfiles": [ - { - "configs": [ - { - "component": "str", - "files": [ - { - "fileName": "str", - "content": "str", - "encoding": "str", - "path": "str", - "values": {"str": "str"}, - } - ], - } - ], - "serviceName": "str", - } - ], - "sshProfile": {"count": 0, "podPrefix": "str", "vmSize": "str"}, - "trinoProfile": { - "catalogOptions": { - "hive": [ - { - "catalogName": "str", - "metastoreDbConnectionURL": "str", - "metastoreWarehouseDir": "str", - "metastoreDbConnectionAuthenticationMode": "str", - "metastoreDbConnectionPasswordSecret": "str", - "metastoreDbConnectionUserName": "str", - } - ] - }, - "coordinator": { - "debug": {"enable": False, "port": 8008, "suspend": False}, - "highAvailabilityEnabled": True, - }, - "userPluginsSpec": {"plugins": [{"enabled": bool, "name": "str", "path": "str"}]}, - "userTelemetrySpec": { - "storage": { - "hivecatalogName": "str", - "hivecatalogSchema": "trinologs", - "partitionRetentionInDays": 365, - "path": "str", - } - }, - "worker": {"debug": {"enable": False, "port": 8008, "suspend": False}}, - }, - } - }, - "tags": {"str": "str"}, - }, - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete(self, resource_group): - response = self.client.clusters.begin_delete( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_service_configs(self, resource_group): - response = self.client.clusters.list_service_configs( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_instance_views(self, resource_group): - response = self.client.clusters.list_instance_views( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get_instance_view(self, resource_group): - response = self.client.clusters.get_instance_view( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_clusters_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_clusters_operations_async.py deleted file mode 100644 index fcd80b442eca..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_clusters_operations_async.py +++ /dev/null @@ -1,528 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtClustersOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_by_cluster_pool_name(self, resource_group): - response = self.client.clusters.list_by_cluster_pool_name( - resource_group_name=resource_group.name, - cluster_pool_name="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_upgrade(self, resource_group): - response = await ( - await self.client.clusters.begin_upgrade( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - cluster_upgrade_request={"properties": "cluster_upgrade_properties"}, - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_upgrade_manual_rollback(self, resource_group): - response = await ( - await self.client.clusters.begin_upgrade_manual_rollback( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - cluster_rollback_upgrade_request={"properties": {"upgradeHistory": "str"}}, - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_resize(self, resource_group): - response = await ( - await self.client.clusters.begin_resize( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - cluster_resize_request={ - "location": "str", - "id": "str", - "name": "str", - "properties": {"targetWorkerNodeCount": 0}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get(self, resource_group): - response = await self.client.clusters.get( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_create(self, resource_group): - response = await ( - await self.client.clusters.begin_create( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - hd_insight_cluster={ - "location": "str", - "id": "str", - "name": "str", - "properties": { - "clusterProfile": { - "authorizationProfile": {"groupIds": ["str"], "userIds": ["str"]}, - "clusterVersion": "str", - "ossVersion": "str", - "autoscaleProfile": { - "enabled": bool, - "autoscaleType": "str", - "gracefulDecommissionTimeout": 0, - "loadBasedConfig": { - "maxNodes": 0, - "minNodes": 0, - "scalingRules": [ - { - "actionType": "str", - "comparisonRule": {"operator": "str", "threshold": 0.0}, - "evaluationCount": 0, - "scalingMetric": "str", - } - ], - "cooldownPeriod": 0, - "pollInterval": 0, - }, - "scheduleBasedConfig": { - "defaultCount": 0, - "schedules": [{"count": 0, "days": ["str"], "endTime": "str", "startTime": "str"}], - "timeZone": "str", - }, - }, - "clusterAccessProfile": {"enableInternalIngress": bool, "privateLinkServiceId": "str"}, - "components": [{"name": "str", "version": "str"}], - "connectivityProfile": { - "web": {"fqdn": "str", "privateFqdn": "str"}, - "ssh": [{"endpoint": "str", "privateSshEndpoint": "str"}], - }, - "flinkProfile": { - "jobManager": {"cpu": 0.0, "memory": 0}, - "storage": {"storageUri": "str", "storagekey": "str"}, - "taskManager": {"cpu": 0.0, "memory": 0}, - "catalogOptions": { - "hive": { - "metastoreDbConnectionURL": "str", - "metastoreDbConnectionAuthenticationMode": "str", - "metastoreDbConnectionPasswordSecret": "str", - "metastoreDbConnectionUserName": "str", - } - }, - "deploymentMode": "str", - "historyServer": {"cpu": 0.0, "memory": 0}, - "jobSpec": { - "jarName": "str", - "jobJarDirectory": "str", - "upgradeMode": "str", - "args": "str", - "entryClass": "str", - "savePointName": "str", - }, - "numReplicas": 0, - }, - "identityProfile": {"msiClientId": "str", "msiObjectId": "str", "msiResourceId": "str"}, - "kafkaProfile": { - "diskStorage": {"dataDiskSize": 0, "dataDiskType": "str"}, - "connectivityEndpoints": {"bootstrapServerEndpoint": "str", "brokerEndpoints": ["str"]}, - "enableKRaft": True, - "enablePublicEndpoints": False, - "remoteStorageUri": "str", - }, - "llapProfile": {"str": {}}, - "logAnalyticsProfile": { - "enabled": bool, - "applicationLogs": {"stdErrorEnabled": bool, "stdOutEnabled": bool}, - "metricsEnabled": bool, - }, - "managedIdentityProfile": { - "identityList": [ - {"clientId": "str", "objectId": "str", "resourceId": "str", "type": "str"} - ] - }, - "prometheusProfile": {"enabled": False}, - "rangerPluginProfile": {"enabled": False}, - "rangerProfile": { - "rangerAdmin": { - "admins": ["str"], - "database": { - "host": "str", - "name": "str", - "passwordSecretRef": "str", - "username": "str", - }, - }, - "rangerUsersync": { - "enabled": True, - "groups": ["str"], - "mode": "automatic", - "userMappingLocation": "str", - "users": ["str"], - }, - "rangerAudit": {"storageAccount": "str"}, - }, - "scriptActionProfiles": [ - { - "name": "str", - "services": ["str"], - "type": "str", - "url": "str", - "parameters": "str", - "shouldPersist": True, - "timeoutInMinutes": 0, - } - ], - "secretsProfile": { - "keyVaultResourceId": "str", - "secrets": [ - { - "keyVaultObjectName": "str", - "referenceName": "str", - "type": "str", - "version": "str", - } - ], - }, - "serviceConfigsProfiles": [ - { - "configs": [ - { - "component": "str", - "files": [ - { - "fileName": "str", - "content": "str", - "encoding": "str", - "path": "str", - "values": {"str": "str"}, - } - ], - } - ], - "serviceName": "str", - } - ], - "sparkProfile": { - "defaultStorageUrl": "str", - "metastoreSpec": { - "dbName": "str", - "dbServerHost": "str", - "dbConnectionAuthenticationMode": "IdentityAuth", - "dbPasswordSecretName": "str", - "dbUserName": "str", - "keyVaultId": "str", - "thriftUrl": "str", - }, - "userPluginsSpec": {"plugins": [{"path": "str"}]}, - }, - "sshProfile": {"count": 0, "podPrefix": "str", "vmSize": "str"}, - "stubProfile": {"str": {}}, - "trinoProfile": { - "catalogOptions": { - "hive": [ - { - "catalogName": "str", - "metastoreDbConnectionURL": "str", - "metastoreWarehouseDir": "str", - "metastoreDbConnectionAuthenticationMode": "str", - "metastoreDbConnectionPasswordSecret": "str", - "metastoreDbConnectionUserName": "str", - } - ] - }, - "coordinator": { - "debug": {"enable": False, "port": 8008, "suspend": False}, - "highAvailabilityEnabled": True, - }, - "userPluginsSpec": {"plugins": [{"enabled": bool, "name": "str", "path": "str"}]}, - "userTelemetrySpec": { - "storage": { - "hivecatalogName": "str", - "hivecatalogSchema": "trinologs", - "partitionRetentionInDays": 365, - "path": "str", - } - }, - "worker": {"debug": {"enable": False, "port": 8008, "suspend": False}}, - }, - }, - "clusterType": "str", - "computeProfile": { - "nodes": [{"count": 0, "type": "str", "vmSize": "str"}], - "availabilityZones": ["str"], - }, - "deploymentId": "str", - "provisioningState": "str", - "status": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_update(self, resource_group): - response = await ( - await self.client.clusters.begin_update( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - cluster_patch_request={ - "properties": { - "clusterProfile": { - "authorizationProfile": {"groupIds": ["str"], "userIds": ["str"]}, - "autoscaleProfile": { - "enabled": bool, - "autoscaleType": "str", - "gracefulDecommissionTimeout": 0, - "loadBasedConfig": { - "maxNodes": 0, - "minNodes": 0, - "scalingRules": [ - { - "actionType": "str", - "comparisonRule": {"operator": "str", "threshold": 0.0}, - "evaluationCount": 0, - "scalingMetric": "str", - } - ], - "cooldownPeriod": 0, - "pollInterval": 0, - }, - "scheduleBasedConfig": { - "defaultCount": 0, - "schedules": [{"count": 0, "days": ["str"], "endTime": "str", "startTime": "str"}], - "timeZone": "str", - }, - }, - "logAnalyticsProfile": { - "enabled": bool, - "applicationLogs": {"stdErrorEnabled": bool, "stdOutEnabled": bool}, - "metricsEnabled": bool, - }, - "prometheusProfile": {"enabled": False}, - "rangerPluginProfile": {"enabled": False}, - "rangerProfile": { - "rangerAdmin": { - "admins": ["str"], - "database": { - "host": "str", - "name": "str", - "passwordSecretRef": "str", - "username": "str", - }, - }, - "rangerUsersync": { - "enabled": True, - "groups": ["str"], - "mode": "automatic", - "userMappingLocation": "str", - "users": ["str"], - }, - "rangerAudit": {"storageAccount": "str"}, - }, - "scriptActionProfiles": [ - { - "name": "str", - "services": ["str"], - "type": "str", - "url": "str", - "parameters": "str", - "shouldPersist": True, - "timeoutInMinutes": 0, - } - ], - "secretsProfile": { - "keyVaultResourceId": "str", - "secrets": [ - { - "keyVaultObjectName": "str", - "referenceName": "str", - "type": "str", - "version": "str", - } - ], - }, - "serviceConfigsProfiles": [ - { - "configs": [ - { - "component": "str", - "files": [ - { - "fileName": "str", - "content": "str", - "encoding": "str", - "path": "str", - "values": {"str": "str"}, - } - ], - } - ], - "serviceName": "str", - } - ], - "sshProfile": {"count": 0, "podPrefix": "str", "vmSize": "str"}, - "trinoProfile": { - "catalogOptions": { - "hive": [ - { - "catalogName": "str", - "metastoreDbConnectionURL": "str", - "metastoreWarehouseDir": "str", - "metastoreDbConnectionAuthenticationMode": "str", - "metastoreDbConnectionPasswordSecret": "str", - "metastoreDbConnectionUserName": "str", - } - ] - }, - "coordinator": { - "debug": {"enable": False, "port": 8008, "suspend": False}, - "highAvailabilityEnabled": True, - }, - "userPluginsSpec": {"plugins": [{"enabled": bool, "name": "str", "path": "str"}]}, - "userTelemetrySpec": { - "storage": { - "hivecatalogName": "str", - "hivecatalogSchema": "trinologs", - "partitionRetentionInDays": 365, - "path": "str", - } - }, - "worker": {"debug": {"enable": False, "port": 8008, "suspend": False}}, - }, - } - }, - "tags": {"str": "str"}, - }, - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): - response = await ( - await self.client.clusters.begin_delete( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_service_configs(self, resource_group): - response = self.client.clusters.list_service_configs( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_instance_views(self, resource_group): - response = self.client.clusters.list_instance_views( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get_instance_view(self, resource_group): - response = await self.client.clusters.get_instance_view( - resource_group_name=resource_group.name, - cluster_pool_name="str", - cluster_name="str", - api_version="2024-05-01-preview", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_locations_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_locations_operations.py deleted file mode 100644 index f14a10f7d5fb..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_locations_operations.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtLocationsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_check_name_availability(self, resource_group): - response = self.client.locations.check_name_availability( - location="str", - name_availability_parameters={"name": "str", "type": "str"}, - api_version="2024-05-01-preview", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_locations_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_locations_operations_async.py deleted file mode 100644 index 16a65cbe4bea..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_locations_operations_async.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtLocationsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_check_name_availability(self, resource_group): - response = await self.client.locations.check_name_availability( - location="str", - name_availability_parameters={"name": "str", "type": "str"}, - api_version="2024-05-01-preview", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_operations.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_operations.py deleted file mode 100644 index ec2fba0dd8d9..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_operations.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.operations.list( - api_version="2024-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_operations_async.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_operations_async.py deleted file mode 100644 index 4d56137f1467..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/generated_tests/test_hd_insight_containers_mgmt_operations_async.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestHDInsightContainersMgmtOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.operations.list( - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/pyproject.toml b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/pyproject.toml deleted file mode 100644 index 540da07d41af..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/pyproject.toml +++ /dev/null @@ -1,6 +0,0 @@ -[tool.azure-sdk-build] -breaking = false -mypy = false -pyright = false -type_check_samples = false -verifytypes = false diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/sdk_packaging.toml b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/sdk_packaging.toml deleted file mode 100644 index 782d335901b0..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/sdk_packaging.toml +++ /dev/null @@ -1,12 +0,0 @@ -[packaging] -package_name = "azure-mgmt-hdinsightcontainers" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Hdinsightcontainers Management" -package_doc_id = "" -is_stable = false -is_arm = true -need_msrestazure = false -need_azuremgmtcore = true -sample_link = "" -exclude_folders = "" -title = "HDInsightContainersMgmtClient" diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/setup.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/setup.py deleted file mode 100644 index 773dc0a575b3..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/setup.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-hdinsightcontainers" -PACKAGE_PPRINT_NAME = "Hdinsightcontainers Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", - ], - python_requires=">=3.8", -) diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/conftest.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/conftest.py deleted file mode 100644 index 51e1df1ca18f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/conftest.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import os -import pytest -from dotenv import load_dotenv -from devtools_testutils import ( - test_proxy, - add_general_regex_sanitizer, - add_body_key_sanitizer, - add_header_regex_sanitizer, -) - -load_dotenv() - - -# aovid record sensitive identity information in recordings -@pytest.fixture(scope="session", autouse=True) -def add_sanitizers(test_proxy): - hdinsightcontainersmgmt_subscription_id = os.environ.get( - "AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" - ) - hdinsightcontainersmgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") - hdinsightcontainersmgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") - hdinsightcontainersmgmt_client_secret = os.environ.get( - "AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" - ) - add_general_regex_sanitizer( - regex=hdinsightcontainersmgmt_subscription_id, value="00000000-0000-0000-0000-000000000000" - ) - add_general_regex_sanitizer(regex=hdinsightcontainersmgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=hdinsightcontainersmgmt_client_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer( - regex=hdinsightcontainersmgmt_client_secret, value="00000000-0000-0000-0000-000000000000" - ) - - add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") - add_header_regex_sanitizer(key="Cookie", value="cookie;") - add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_cluster_pools_operations_async_test.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_cluster_pools_operations_async_test.py deleted file mode 100644 index 5236502c4dde..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_cluster_pools_operations_async_test.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.live_test_only -class TestHDInsightContainersMgmtClusterPoolsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): - response = self.client.cluster_pools.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - assert result == [] diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_cluster_pools_operations_test.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_cluster_pools_operations_test.py deleted file mode 100644 index 96c23d7c8645..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_cluster_pools_operations_test.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.live_test_only -class TestHDInsightContainersMgmtClusterPoolsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): - response = self.client.cluster_pools.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2024-05-01-preview", - ) - result = [r for r in response] - assert result == [] - \ No newline at end of file diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_operations_async_test.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_operations_async_test.py deleted file mode 100644 index 20a7a47adb29..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_operations_async_test.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers.aio import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.live_test_only -class TestHDInsightContainersMgmtOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.operations.list( - api_version="2024-05-01-preview", - ) - result = [r async for r in response] - assert result - diff --git a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_operations_test.py b/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_operations_test.py deleted file mode 100644 index 6c65e2eca21c..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsightcontainers/tests/test_hd_insight_containers_mgmt_operations_test.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.hdinsightcontainers import HDInsightContainersMgmtClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.live_test_only -class TestHDInsightContainersMgmtOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(HDInsightContainersMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.operations.list( - api_version="2024-05-01-preview", - ) - result = [r for r in response] - assert result - diff --git a/sdk/hdinsight/ci.yml b/sdk/hdinsight/ci.yml index fac6d9deb5e0..af8d4c5d1add 100644 --- a/sdk/hdinsight/ci.yml +++ b/sdk/hdinsight/ci.yml @@ -31,5 +31,3 @@ extends: Artifacts: - name: azure-mgmt-hdinsight safeName: azuremgmthdinsight - - name: azure-mgmt-hdinsightcontainers - safeName: azuremgmthdinsightcontainers