Skip to content

Commit 448c541

Browse files
[AutoRelease] t2-hdinsight-2025-09-25-76113(can only be merged by SDK owner) (Azure#43133)
* code and test * update changelog & testcases --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 50a1e50 commit 448c541

File tree

153 files changed

+2903
-1986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+2903
-1986
lines changed

sdk/hdinsight/azure-mgmt-hdinsight/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Release History
22

3+
## 9.1.0b2 (2025-10-15)
4+
5+
### Features Added
6+
7+
- Model `HDInsightManagementClient` added parameter `cloud_setting` in method `__init__`
8+
- Model `GatewaySettings` added property `rest_auth_entra_users`
9+
- Model `UpdateGatewaySettingsParameters` added property `rest_auth_entra_users`
10+
- Added model `EntraUserInfo`
11+
312
## 9.1.0b1 (2024-09-10)
413

514
### Other Changes
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
include _meta.json
2-
recursive-include tests *.py *.json
3-
recursive-include samples *.py *.md
41
include *.md
5-
include azure/__init__.py
6-
include azure/mgmt/__init__.py
72
include LICENSE
83
include azure/mgmt/hdinsight/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/mgmt/__init__.py

sdk/hdinsight/azure-mgmt-hdinsight/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure HDInsight Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "1ad29756bd141a47cac770140105a706d065ae1b",
2+
"commit": "e9da2de4d595e9179c8bee26aa62ffe5b66b78b0",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.19.0",
6+
"@autorest/python@6.40.0",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/hdinsight/resource-manager/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.19.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/hdinsight/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.40.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/hdinsight/resource-manager/readme.md"
1111
}

sdk/hdinsight/azure-mgmt-hdinsight/apiview-properties.json

Lines changed: 248 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._hd_insight_management_client import HDInsightManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._hd_insight_management_client import HDInsightManagementClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"HDInsightManagementClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_configuration.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import Any, TYPE_CHECKING
9+
from typing import Any, Optional, TYPE_CHECKING
1010

1111
from azure.core.pipeline import policies
1212
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1313

1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
17+
from azure.core import AzureClouds
1818
from azure.core.credentials import TokenCredential
1919

2020

21-
class HDInsightManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
21+
class HDInsightManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
2222
"""Configuration for HDInsightManagementClient.
2323
2424
Note that all parameters used to create this instance are saved as instance
@@ -29,13 +29,22 @@ class HDInsightManagementClientConfiguration: # pylint: disable=too-many-instan
2929
:param subscription_id: The subscription credentials which uniquely identify Microsoft Azure
3030
subscription. The subscription ID forms part of the URI for every service call. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2024-08-01-preview". Note that overriding
32+
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
33+
None.
34+
:type cloud_setting: ~azure.core.AzureClouds
35+
:keyword api_version: Api Version. Default value is "2025-01-15-preview". Note that overriding
3336
this default value may result in unsupported behavior.
3437
:paramtype api_version: str
3538
"""
3639

37-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
api_version: str = kwargs.pop("api_version", "2024-08-01-preview")
40+
def __init__(
41+
self,
42+
credential: "TokenCredential",
43+
subscription_id: str,
44+
cloud_setting: Optional["AzureClouds"] = None,
45+
**kwargs: Any
46+
) -> None:
47+
api_version: str = kwargs.pop("api_version", "2025-01-15-preview")
3948

4049
if credential is None:
4150
raise ValueError("Parameter 'credential' must not be None.")
@@ -44,6 +53,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4453

4554
self.credential = credential
4655
self.subscription_id = subscription_id
56+
self.cloud_setting = cloud_setting
4757
self.api_version = api_version
4858
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4959
kwargs.setdefault("sdk_moniker", "mgmt-hdinsight/{}".format(VERSION))

sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_hd_insight_management_client.py

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import ARMPipelineClient
1617
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from . import models as _models
1921
from ._configuration import HDInsightManagementClientConfiguration
20-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
2123
from .operations import (
2224
ApplicationsOperations,
2325
ClustersOperations,
@@ -33,11 +35,11 @@
3335
)
3436

3537
if TYPE_CHECKING:
36-
# pylint: disable=unused-import,ungrouped-imports
38+
from azure.core import AzureClouds
3739
from azure.core.credentials import TokenCredential
3840

3941

40-
class HDInsightManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
42+
class HDInsightManagementClient: # pylint: disable=too-many-instance-attributes
4143
"""HDInsight Management Client.
4244
4345
:ivar applications: ApplicationsOperations operations
@@ -69,9 +71,12 @@ class HDInsightManagementClient: # pylint: disable=client-accepts-api-version-k
6971
:param subscription_id: The subscription credentials which uniquely identify Microsoft Azure
7072
subscription. The subscription ID forms part of the URI for every service call. Required.
7173
:type subscription_id: str
72-
:param base_url: Service URL. Default value is "https://management.azure.com".
74+
:param base_url: Service URL. Default value is None.
7375
:type base_url: str
74-
:keyword api_version: Api Version. Default value is "2024-08-01-preview". Note that overriding
76+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
77+
None.
78+
:paramtype cloud_setting: ~azure.core.AzureClouds
79+
:keyword api_version: Api Version. Default value is "2025-01-15-preview". Note that overriding
7580
this default value may result in unsupported behavior.
7681
:paramtype api_version: str
7782
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -82,12 +87,24 @@ def __init__(
8287
self,
8388
credential: "TokenCredential",
8489
subscription_id: str,
85-
base_url: str = "https://management.azure.com",
90+
base_url: Optional[str] = None,
91+
*,
92+
cloud_setting: Optional["AzureClouds"] = None,
8693
**kwargs: Any
8794
) -> None:
95+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
96+
_endpoints = get_arm_endpoints(_cloud)
97+
if not base_url:
98+
base_url = _endpoints["resource_manager"]
99+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
88100
self._config = HDInsightManagementClientConfiguration(
89-
credential=credential, subscription_id=subscription_id, **kwargs
101+
credential=credential,
102+
subscription_id=subscription_id,
103+
cloud_setting=cloud_setting,
104+
credential_scopes=credential_scopes,
105+
**kwargs
90106
)
107+
91108
_policies = kwargs.pop("policies", None)
92109
if _policies is None:
93110
_policies = [
@@ -106,7 +123,7 @@ def __init__(
106123
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
107124
self._config.http_logging_policy,
108125
]
109-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
126+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
110127

111128
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
112129
self._serialize = Serializer(client_models)

0 commit comments

Comments
 (0)