Skip to content

Commit 0517a88

Browse files
author
SDKAuto
committed
CodeGen from PR 34074 in Azure/azure-rest-api-specs
Merge 68fc963968369ff326614fd3067e9075dbaccb4f into 37a849b656ecfb33424822b9f245aebff2ae994f
1 parent 206fa48 commit 0517a88

File tree

53 files changed

+5797
-3837
lines changed

Some content is hidden

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

53 files changed

+5797
-3837
lines changed

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

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

3+
## 1.2.0b3 (2025-05-12)
4+
5+
change log generation failed!!!
6+
37
## 1.2.0b2 (2025-03-24)
48

59
### Features Added

sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/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 Hybrid Kubernetes 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 & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "ecee919199a39cc0d864410f540aa105bf7cdb64",
2+
"commit": "207c441a1a467c13fa2c16d1ecd4978ac771fa22",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/hybridkubernetes/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/hybridkubernetes/resource-manager/readme.md"
4+
"typespec_src": "specification/hybridkubernetes/HybridKubernetes.Management",
5+
"@azure-tools/typespec-python": "0.44.2"
116
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.Kubernetes",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.hybridkubernetes.models.AadProfile": "Microsoft.Kubernetes.AadProfile",
5+
"azure.mgmt.hybridkubernetes.models.AgentError": "Microsoft.Kubernetes.AgentError",
6+
"azure.mgmt.hybridkubernetes.models.ArcAgentProfile": "Microsoft.Kubernetes.ArcAgentProfile",
7+
"azure.mgmt.hybridkubernetes.models.ArcAgentryConfigurations": "Microsoft.Kubernetes.ArcAgentryConfigurations",
8+
"azure.mgmt.hybridkubernetes.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
9+
"azure.mgmt.hybridkubernetes.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
10+
"azure.mgmt.hybridkubernetes.models.ConnectedCluster": "Microsoft.Kubernetes.ConnectedCluster",
11+
"azure.mgmt.hybridkubernetes.models.ConnectedClusterIdentity": "Microsoft.Kubernetes.ConnectedClusterIdentity",
12+
"azure.mgmt.hybridkubernetes.models.ConnectedClusterPatch": "Microsoft.Kubernetes.ConnectedClusterPatch",
13+
"azure.mgmt.hybridkubernetes.models.ConnectedClusterPatchProperties": "Microsoft.Kubernetes.ConnectedClusterPatchProperties",
14+
"azure.mgmt.hybridkubernetes.models.ConnectedClusterProperties": "Microsoft.Kubernetes.ConnectedClusterProperties",
15+
"azure.mgmt.hybridkubernetes.models.CredentialResult": "Microsoft.Kubernetes.CredentialResult",
16+
"azure.mgmt.hybridkubernetes.models.CredentialResults": "Microsoft.Kubernetes.CredentialResults",
17+
"azure.mgmt.hybridkubernetes.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
18+
"azure.mgmt.hybridkubernetes.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
19+
"azure.mgmt.hybridkubernetes.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
20+
"azure.mgmt.hybridkubernetes.models.Gateway": "Microsoft.Kubernetes.Gateway",
21+
"azure.mgmt.hybridkubernetes.models.HybridConnectionConfig": "Microsoft.Kubernetes.HybridConnectionConfig",
22+
"azure.mgmt.hybridkubernetes.models.ListClusterUserCredentialProperties": "Microsoft.Kubernetes.ListClusterUserCredentialProperties",
23+
"azure.mgmt.hybridkubernetes.models.OidcIssuerProfile": "Microsoft.Kubernetes.OidcIssuerProfile",
24+
"azure.mgmt.hybridkubernetes.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
25+
"azure.mgmt.hybridkubernetes.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
26+
"azure.mgmt.hybridkubernetes.models.SecurityProfile": "Microsoft.Kubernetes.SecurityProfile",
27+
"azure.mgmt.hybridkubernetes.models.SecurityProfileWorkloadIdentity": "Microsoft.Kubernetes.SecurityProfileWorkloadIdentity",
28+
"azure.mgmt.hybridkubernetes.models.SystemComponent": "Microsoft.Kubernetes.SystemComponent",
29+
"azure.mgmt.hybridkubernetes.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
30+
"azure.mgmt.hybridkubernetes.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
31+
"azure.mgmt.hybridkubernetes.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
32+
"azure.mgmt.hybridkubernetes.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
33+
"azure.mgmt.hybridkubernetes.models.ResourceIdentityType": "Microsoft.Kubernetes.ResourceIdentityType",
34+
"azure.mgmt.hybridkubernetes.models.ConnectedClusterKind": "Microsoft.Kubernetes.ConnectedClusterKind",
35+
"azure.mgmt.hybridkubernetes.models.ProvisioningState": "Microsoft.Kubernetes.ProvisioningState",
36+
"azure.mgmt.hybridkubernetes.models.ConnectivityStatus": "Microsoft.Kubernetes.ConnectivityStatus",
37+
"azure.mgmt.hybridkubernetes.models.PrivateLinkState": "Microsoft.Kubernetes.PrivateLinkState",
38+
"azure.mgmt.hybridkubernetes.models.AzureHybridBenefit": "Microsoft.Kubernetes.AzureHybridBenefit",
39+
"azure.mgmt.hybridkubernetes.models.AutoUpgradeOptions": "Microsoft.Kubernetes.AutoUpgradeOptions",
40+
"azure.mgmt.hybridkubernetes.models.AuthenticationMethod": "Microsoft.Kubernetes.AuthenticationMethod",
41+
"azure.mgmt.hybridkubernetes.operations.Operations.list": "Microsoft.Kubernetes.Operations.list",
42+
"azure.mgmt.hybridkubernetes.aio.operations.Operations.list": "Microsoft.Kubernetes.Operations.list",
43+
"azure.mgmt.hybridkubernetes.operations.ConnectedClustersOperations.get": "Microsoft.Kubernetes.ConnectedClusters.get",
44+
"azure.mgmt.hybridkubernetes.aio.operations.ConnectedClustersOperations.get": "Microsoft.Kubernetes.ConnectedClusters.get",
45+
"azure.mgmt.hybridkubernetes.operations.ConnectedClustersOperations.begin_create_or_replace": "Microsoft.Kubernetes.ConnectedClusters.createOrReplace",
46+
"azure.mgmt.hybridkubernetes.aio.operations.ConnectedClustersOperations.begin_create_or_replace": "Microsoft.Kubernetes.ConnectedClusters.createOrReplace",
47+
"azure.mgmt.hybridkubernetes.operations.ConnectedClustersOperations.update": "Microsoft.Kubernetes.ConnectedClusters.update",
48+
"azure.mgmt.hybridkubernetes.aio.operations.ConnectedClustersOperations.update": "Microsoft.Kubernetes.ConnectedClusters.update",
49+
"azure.mgmt.hybridkubernetes.operations.ConnectedClustersOperations.begin_delete": "Microsoft.Kubernetes.ConnectedClusters.delete",
50+
"azure.mgmt.hybridkubernetes.aio.operations.ConnectedClustersOperations.begin_delete": "Microsoft.Kubernetes.ConnectedClusters.delete",
51+
"azure.mgmt.hybridkubernetes.operations.ConnectedClustersOperations.list_by_resource_group": "Microsoft.Kubernetes.ConnectedClusters.listByResourceGroup",
52+
"azure.mgmt.hybridkubernetes.aio.operations.ConnectedClustersOperations.list_by_resource_group": "Microsoft.Kubernetes.ConnectedClusters.listByResourceGroup",
53+
"azure.mgmt.hybridkubernetes.operations.ConnectedClustersOperations.list_by_subscription": "Microsoft.Kubernetes.ConnectedClusters.listBySubscription",
54+
"azure.mgmt.hybridkubernetes.aio.operations.ConnectedClustersOperations.list_by_subscription": "Microsoft.Kubernetes.ConnectedClusters.listBySubscription",
55+
"azure.mgmt.hybridkubernetes.operations.ConnectedClustersOperations.list_cluster_user_credential": "Microsoft.Kubernetes.ConnectedClusters.listClusterUserCredential",
56+
"azure.mgmt.hybridkubernetes.aio.operations.ConnectedClustersOperations.list_cluster_user_credential": "Microsoft.Kubernetes.ConnectedClusters.listClusterUserCredential"
57+
}
58+
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88
# pylint: disable=wrong-import-position
@@ -12,7 +12,7 @@
1212
if TYPE_CHECKING:
1313
from ._patch import * # pylint: disable=unused-wildcard-import
1414

15-
from ._connected_kubernetes_client import ConnectedKubernetesClient # type: ignore
15+
from ._client import KubernetesClient # type: ignore
1616
from ._version import VERSION
1717

1818
__version__ = VERSION
@@ -25,7 +25,7 @@
2525
from ._patch import patch_sdk as _patch_sdk
2626

2727
__all__ = [
28-
"ConnectedKubernetesClient",
28+
"KubernetesClient",
2929
]
3030
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
3131

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,67 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
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

18-
from . import models as _models
19-
from ._configuration import ConnectedKubernetesClientConfiguration
20-
from ._serialization import Deserializer, Serializer
21-
from .operations import ConnectedClusterOperations, Operations
20+
from ._configuration import KubernetesClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import ConnectedClustersOperations, Operations
2223

2324
if TYPE_CHECKING:
2425
from azure.core.credentials import TokenCredential
2526

2627

27-
class ConnectedKubernetesClient:
28+
class KubernetesClient:
2829
"""Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc.
2930
30-
:ivar connected_cluster: ConnectedClusterOperations operations
31-
:vartype connected_cluster: azure.mgmt.hybridkubernetes.operations.ConnectedClusterOperations
3231
:ivar operations: Operations operations
3332
:vartype operations: azure.mgmt.hybridkubernetes.operations.Operations
34-
:param credential: Credential needed for the client to connect to Azure. Required.
33+
:ivar connected_clusters: ConnectedClustersOperations operations
34+
:vartype connected_clusters: azure.mgmt.hybridkubernetes.operations.ConnectedClustersOperations
35+
:param credential: Credential used to authenticate requests to the service. Required.
3536
:type credential: ~azure.core.credentials.TokenCredential
36-
:param subscription_id: The ID of the target subscription. Required.
37+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3738
:type subscription_id: str
38-
:param base_url: Service URL. Default value is "https://management.azure.com".
39+
:param base_url: Service host. Default value is None.
3940
:type base_url: str
40-
:keyword api_version: Api Version. Default value is "2024-12-01-preview". Note that overriding
41-
this default value may result in unsupported behavior.
41+
:keyword api_version: The API version to use for this operation. Default value is
42+
"2024-12-01-preview". Note that overriding this default value may result in unsupported
43+
behavior.
4244
:paramtype api_version: str
4345
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4446
Retry-After header is present.
4547
"""
4648

4749
def __init__(
48-
self,
49-
credential: "TokenCredential",
50-
subscription_id: str,
51-
base_url: str = "https://management.azure.com",
52-
**kwargs: Any
50+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
5351
) -> None:
54-
self._config = ConnectedKubernetesClientConfiguration(
55-
credential=credential, subscription_id=subscription_id, **kwargs
52+
_endpoint = "{endpoint}"
53+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
54+
_endpoints = get_arm_endpoints(_cloud)
55+
if not base_url:
56+
base_url = _endpoints["resource_manager"]
57+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
58+
self._config = KubernetesClientConfiguration(
59+
credential=credential,
60+
subscription_id=subscription_id,
61+
base_url=cast(str, base_url),
62+
credential_scopes=credential_scopes,
63+
**kwargs
5664
)
65+
5766
_policies = kwargs.pop("policies", None)
5867
if _policies is None:
5968
_policies = [
@@ -72,24 +81,23 @@ def __init__(
7281
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
7382
self._config.http_logging_policy,
7483
]
75-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
84+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
7685

77-
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
78-
self._serialize = Serializer(client_models)
79-
self._deserialize = Deserializer(client_models)
86+
self._serialize = Serializer()
87+
self._deserialize = Deserializer()
8088
self._serialize.client_side_validation = False
81-
self.connected_cluster = ConnectedClusterOperations(
89+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
90+
self.connected_clusters = ConnectedClustersOperations(
8291
self._client, self._config, self._serialize, self._deserialize
8392
)
84-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
8593

86-
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
94+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
8795
"""Runs the network request through the client's chained policies.
8896
8997
>>> from azure.core.rest import HttpRequest
9098
>>> request = HttpRequest("GET", "https://www.example.org/")
9199
<HttpRequest [GET], url: 'https://www.example.org/'>
92-
>>> response = client._send_request(request)
100+
>>> response = client.send_request(request)
93101
<HttpResponse: 200 OK>
94102
95103
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -102,7 +110,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
102110
"""
103111

104112
request_copy = deepcopy(request)
105-
request_copy.url = self._client.format_url(request_copy.url)
113+
path_format_arguments = {
114+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
115+
}
116+
117+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
106118
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
107119

108120
def close(self) -> None:

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

@@ -17,22 +17,31 @@
1717
from azure.core.credentials import TokenCredential
1818

1919

20-
class ConnectedKubernetesClientConfiguration: # pylint: disable=too-many-instance-attributes
21-
"""Configuration for ConnectedKubernetesClient.
20+
class KubernetesClientConfiguration: # pylint: disable=too-many-instance-attributes
21+
"""Configuration for KubernetesClient.
2222
2323
Note that all parameters used to create this instance are saved as instance
2424
attributes.
2525
26-
:param credential: Credential needed for the client to connect to Azure. Required.
26+
:param credential: Credential used to authenticate requests to the service. Required.
2727
:type credential: ~azure.core.credentials.TokenCredential
28-
:param subscription_id: The ID of the target subscription. Required.
28+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
2929
:type subscription_id: str
30-
:keyword api_version: Api Version. Default value is "2024-12-01-preview". Note that overriding
31-
this default value may result in unsupported behavior.
30+
:param base_url: Service host. Default value is "https://management.azure.com".
31+
:type base_url: str
32+
:keyword api_version: The API version to use for this operation. Default value is
33+
"2024-12-01-preview". Note that overriding this default value may result in unsupported
34+
behavior.
3235
:paramtype api_version: str
3336
"""
3437

35-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38+
def __init__(
39+
self,
40+
credential: "TokenCredential",
41+
subscription_id: str,
42+
base_url: str = "https://management.azure.com",
43+
**kwargs: Any
44+
) -> None:
3645
api_version: str = kwargs.pop("api_version", "2024-12-01-preview")
3746

3847
if credential is None:
@@ -42,6 +51,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4251

4352
self.credential = credential
4453
self.subscription_id = subscription_id
54+
self.base_url = base_url
4555
self.api_version = api_version
4656
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4757
kwargs.setdefault("sdk_moniker", "mgmt-hybridkubernetes/{}".format(VERSION))

sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_patch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# ------------------------------------
2-
# Copyright (c) Microsoft Corporation.
3-
# Licensed under the MIT License.
4-
# ------------------------------------
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# --------------------------------------------------------------------------
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize

0 commit comments

Comments
 (0)