Skip to content

Commit 8ace9c9

Browse files
[AutoRelease] t2-containerservice-2022-06-06-20142(Do not merge) (Azure#24715)
* code and test * Update CHANGELOG.md Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Jiefeng Chen <[email protected]>
1 parent 4138caa commit 8ace9c9

Some content is hidden

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

43 files changed

+21141
-3
lines changed

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

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

3+
## 20.0.0 (2022-06-09)
4+
5+
**Features**
6+
7+
- Model AzureKeyVaultKms has a new parameter key_vault_network_access
8+
- Model AzureKeyVaultKms has a new parameter key_vault_resource_id
9+
- Model ManagedCluster has a new parameter workload_auto_scaler_profile
10+
- Model ManagedClusterSecurityProfile has a new parameter defender
11+
- Model ManagedClusterStorageProfile has a new parameter blob_csi_driver
12+
13+
**Breaking changes**
14+
15+
- Model ManagedClusterSecurityProfile no longer has parameter azure_defender
16+
317
## 19.1.0 (2022-05-13)
418

519
**Features**

sdk/containerservice/azure-mgmt-containerservice/_meta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"@autorest/[email protected]",
55
"@autorest/[email protected]"
66
],
7-
"commit": "2d129e6389e703e292b43ac839a58743d09f67b0",
7+
"commit": "2d6cb29af754f48a08f94cb6113bb1f01a4e0eb9",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/containerservice/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
9+
"autorest_command": "autorest specification/containerservice/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
1010
"readme": "specification/containerservice/resource-manager/readme.md"
1111
}

sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py

Lines changed: 37 additions & 0 deletions
Large diffs are not rendered by default.

sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
VERSION = "19.1.0"
12+
VERSION = "20.0.0"

sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py

Lines changed: 37 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from ._container_service_client import ContainerServiceClient
10+
__all__ = ['ContainerServiceClient']
11+
12+
# `._patch.py` is used for handwritten extensions to the generated code
13+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
14+
from ._patch import patch_sdk
15+
patch_sdk()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import Any, TYPE_CHECKING
10+
11+
from azure.core.configuration import Configuration
12+
from azure.core.pipeline import policies
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
14+
15+
if TYPE_CHECKING:
16+
# pylint: disable=unused-import,ungrouped-imports
17+
from azure.core.credentials import TokenCredential
18+
19+
VERSION = "unknown"
20+
21+
class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
22+
"""Configuration for ContainerServiceClient.
23+
24+
Note that all parameters used to create this instance are saved as instance
25+
attributes.
26+
27+
:param credential: Credential needed for the client to connect to Azure.
28+
:type credential: ~azure.core.credentials.TokenCredential
29+
:param subscription_id: The ID of the target subscription.
30+
:type subscription_id: str
31+
:keyword api_version: Api Version. Default value is "2022-05-02-preview". Note that overriding
32+
this default value may result in unsupported behavior.
33+
:paramtype api_version: str
34+
"""
35+
36+
def __init__(
37+
self,
38+
credential: "TokenCredential",
39+
subscription_id: str,
40+
**kwargs: Any
41+
) -> None:
42+
super(ContainerServiceClientConfiguration, self).__init__(**kwargs)
43+
api_version = kwargs.pop('api_version', "2022-05-02-preview") # type: str
44+
45+
if credential is None:
46+
raise ValueError("Parameter 'credential' must not be None.")
47+
if subscription_id is None:
48+
raise ValueError("Parameter 'subscription_id' must not be None.")
49+
50+
self.credential = credential
51+
self.subscription_id = subscription_id
52+
self.api_version = api_version
53+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
54+
kwargs.setdefault('sdk_moniker', 'mgmt-containerservice/{}'.format(VERSION))
55+
self._configure(**kwargs)
56+
57+
def _configure(
58+
self,
59+
**kwargs # type: Any
60+
):
61+
# type: (...) -> None
62+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
63+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
64+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
65+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
66+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
67+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
68+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
69+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
70+
self.authentication_policy = kwargs.get('authentication_policy')
71+
if self.credential and not self.authentication_policy:
72+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, TYPE_CHECKING
11+
12+
from msrest import Deserializer, Serializer
13+
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.mgmt.core import ARMPipelineClient
16+
17+
from . import models
18+
from ._configuration import ContainerServiceClientConfiguration
19+
from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClusterSnapshotsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations, TrustedAccessRoleBindingsOperations, TrustedAccessRolesOperations
20+
21+
if TYPE_CHECKING:
22+
# pylint: disable=unused-import,ungrouped-imports
23+
from azure.core.credentials import TokenCredential
24+
25+
class ContainerServiceClient: # pylint: disable=too-many-instance-attributes
26+
"""The Container Service Client.
27+
28+
:ivar operations: Operations operations
29+
:vartype operations: azure.mgmt.containerservice.v2022_05_02_preview.operations.Operations
30+
:ivar managed_clusters: ManagedClustersOperations operations
31+
:vartype managed_clusters:
32+
azure.mgmt.containerservice.v2022_05_02_preview.operations.ManagedClustersOperations
33+
:ivar maintenance_configurations: MaintenanceConfigurationsOperations operations
34+
:vartype maintenance_configurations:
35+
azure.mgmt.containerservice.v2022_05_02_preview.operations.MaintenanceConfigurationsOperations
36+
:ivar agent_pools: AgentPoolsOperations operations
37+
:vartype agent_pools:
38+
azure.mgmt.containerservice.v2022_05_02_preview.operations.AgentPoolsOperations
39+
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
40+
:vartype private_endpoint_connections:
41+
azure.mgmt.containerservice.v2022_05_02_preview.operations.PrivateEndpointConnectionsOperations
42+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
43+
:vartype private_link_resources:
44+
azure.mgmt.containerservice.v2022_05_02_preview.operations.PrivateLinkResourcesOperations
45+
:ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations
46+
:vartype resolve_private_link_service_id:
47+
azure.mgmt.containerservice.v2022_05_02_preview.operations.ResolvePrivateLinkServiceIdOperations
48+
:ivar snapshots: SnapshotsOperations operations
49+
:vartype snapshots:
50+
azure.mgmt.containerservice.v2022_05_02_preview.operations.SnapshotsOperations
51+
:ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations
52+
:vartype managed_cluster_snapshots:
53+
azure.mgmt.containerservice.v2022_05_02_preview.operations.ManagedClusterSnapshotsOperations
54+
:ivar trusted_access_roles: TrustedAccessRolesOperations operations
55+
:vartype trusted_access_roles:
56+
azure.mgmt.containerservice.v2022_05_02_preview.operations.TrustedAccessRolesOperations
57+
:ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations
58+
:vartype trusted_access_role_bindings:
59+
azure.mgmt.containerservice.v2022_05_02_preview.operations.TrustedAccessRoleBindingsOperations
60+
:param credential: Credential needed for the client to connect to Azure.
61+
:type credential: ~azure.core.credentials.TokenCredential
62+
:param subscription_id: The ID of the target subscription.
63+
:type subscription_id: str
64+
:param base_url: Service URL. Default value is "https://management.azure.com".
65+
:type base_url: str
66+
:keyword api_version: Api Version. Default value is "2022-05-02-preview". Note that overriding
67+
this default value may result in unsupported behavior.
68+
:paramtype api_version: str
69+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
70+
Retry-After header is present.
71+
"""
72+
73+
def __init__(
74+
self,
75+
credential: "TokenCredential",
76+
subscription_id: str,
77+
base_url: str = "https://management.azure.com",
78+
**kwargs: Any
79+
) -> None:
80+
self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
81+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
82+
83+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
84+
self._serialize = Serializer(client_models)
85+
self._deserialize = Deserializer(client_models)
86+
self._serialize.client_side_validation = False
87+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
88+
self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize)
89+
self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize)
90+
self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize)
91+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
92+
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
93+
self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize)
94+
self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize)
95+
self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations(self._client, self._config, self._serialize, self._deserialize)
96+
self.trusted_access_roles = TrustedAccessRolesOperations(self._client, self._config, self._serialize, self._deserialize)
97+
self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations(self._client, self._config, self._serialize, self._deserialize)
98+
99+
100+
def _send_request(
101+
self,
102+
request: HttpRequest,
103+
**kwargs: Any
104+
) -> HttpResponse:
105+
"""Runs the network request through the client's chained policies.
106+
107+
>>> from azure.core.rest import HttpRequest
108+
>>> request = HttpRequest("GET", "https://www.example.org/")
109+
<HttpRequest [GET], url: 'https://www.example.org/'>
110+
>>> response = client._send_request(request)
111+
<HttpResponse: 200 OK>
112+
113+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
114+
115+
:param request: The network request you want to make. Required.
116+
:type request: ~azure.core.rest.HttpRequest
117+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
118+
:return: The response of your network call. Does not do error handling on your response.
119+
:rtype: ~azure.core.rest.HttpResponse
120+
"""
121+
122+
request_copy = deepcopy(request)
123+
request_copy.url = self._client.format_url(request_copy.url)
124+
return self._client.send_request(request_copy, **kwargs)
125+
126+
def close(self):
127+
# type: () -> None
128+
self._client.close()
129+
130+
def __enter__(self):
131+
# type: () -> ContainerServiceClient
132+
self._client.__enter__()
133+
return self
134+
135+
def __exit__(self, *exc_details):
136+
# type: (Any) -> None
137+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)