Skip to content

Commit d698c15

Browse files
authored
code and test (Azure#24432)
Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
1 parent b124280 commit d698c15

File tree

78 files changed

+38365
-5
lines changed

Some content is hidden

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

78 files changed

+38365
-5
lines changed

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

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

3+
## 19.1.0 (2022-05-13)
4+
5+
**Features**
6+
7+
- Added operation group TrustedAccessRoleBindingsOperations
8+
- Added operation group TrustedAccessRolesOperations
9+
- Model AgentPool has a new parameter enable_custom_ca_trust
10+
- Model ContainerServiceNetworkProfile has a new parameter network_plugin_mode
11+
- Model ManagedCluster has a new parameter storage_profile
12+
- Model ManagedClusterAPIServerAccessProfile has a new parameter enable_vnet_integration
13+
- Model ManagedClusterAPIServerAccessProfile has a new parameter subnet_id
14+
- Model ManagedClusterAgentPoolProfile has a new parameter enable_custom_ca_trust
15+
- Model ManagedClusterAgentPoolProfileProperties has a new parameter enable_custom_ca_trust
16+
- Model NetworkProfileForSnapshot has a new parameter network_plugin_mode
17+
318
## 19.0.0 (2022-04-15)
419

520
**Features**

sdk/containerservice/azure-mgmt-containerservice/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ include *.md
44
include azure/__init__.py
55
include azure/mgmt/__init__.py
66
include LICENSE
7+
include azure/mgmt/containerservice/py.typed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@autorest/[email protected]",
55
"@autorest/[email protected]"
66
],
7-
"commit": "fb31972c13cf183c43414d2b4736a5d70aa8af68",
7+
"commit": "2d129e6389e703e292b43ac839a58743d09f67b0",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
99
"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",
1010
"readme": "specification/containerservice/resource-manager/readme.md"

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

Lines changed: 86 additions & 1 deletion
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.0.0"
12+
VERSION = "19.1.0"

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

Lines changed: 86 additions & 1 deletion
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# --------------------------------------------------------------------------
77
from .v2017_07_01.models import *
88
from .v2019_04_30.models import *
9-
from .v2022_03_01.models import *
9+
from .v2022_04_01.models import *
Lines changed: 15 additions & 0 deletions
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-04-01". Note that overriding this
32+
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-04-01") # 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,123 @@
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, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations
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_04_01.operations.Operations
30+
:ivar managed_clusters: ManagedClustersOperations operations
31+
:vartype managed_clusters:
32+
azure.mgmt.containerservice.v2022_04_01.operations.ManagedClustersOperations
33+
:ivar maintenance_configurations: MaintenanceConfigurationsOperations operations
34+
:vartype maintenance_configurations:
35+
azure.mgmt.containerservice.v2022_04_01.operations.MaintenanceConfigurationsOperations
36+
:ivar agent_pools: AgentPoolsOperations operations
37+
:vartype agent_pools: azure.mgmt.containerservice.v2022_04_01.operations.AgentPoolsOperations
38+
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
39+
:vartype private_endpoint_connections:
40+
azure.mgmt.containerservice.v2022_04_01.operations.PrivateEndpointConnectionsOperations
41+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
42+
:vartype private_link_resources:
43+
azure.mgmt.containerservice.v2022_04_01.operations.PrivateLinkResourcesOperations
44+
:ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations
45+
:vartype resolve_private_link_service_id:
46+
azure.mgmt.containerservice.v2022_04_01.operations.ResolvePrivateLinkServiceIdOperations
47+
:ivar snapshots: SnapshotsOperations operations
48+
:vartype snapshots: azure.mgmt.containerservice.v2022_04_01.operations.SnapshotsOperations
49+
:param credential: Credential needed for the client to connect to Azure.
50+
:type credential: ~azure.core.credentials.TokenCredential
51+
:param subscription_id: The ID of the target subscription.
52+
:type subscription_id: str
53+
:param base_url: Service URL. Default value is "https://management.azure.com".
54+
:type base_url: str
55+
:keyword api_version: Api Version. Default value is "2022-04-01". Note that overriding this
56+
default value may result in unsupported behavior.
57+
:paramtype api_version: str
58+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
59+
Retry-After header is present.
60+
"""
61+
62+
def __init__(
63+
self,
64+
credential: "TokenCredential",
65+
subscription_id: str,
66+
base_url: str = "https://management.azure.com",
67+
**kwargs: Any
68+
) -> None:
69+
self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
70+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
71+
72+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
73+
self._serialize = Serializer(client_models)
74+
self._deserialize = Deserializer(client_models)
75+
self._serialize.client_side_validation = False
76+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
77+
self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize)
78+
self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize)
79+
self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize)
80+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
81+
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
82+
self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize)
83+
self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize)
84+
85+
86+
def _send_request(
87+
self,
88+
request: HttpRequest,
89+
**kwargs: Any
90+
) -> HttpResponse:
91+
"""Runs the network request through the client's chained policies.
92+
93+
>>> from azure.core.rest import HttpRequest
94+
>>> request = HttpRequest("GET", "https://www.example.org/")
95+
<HttpRequest [GET], url: 'https://www.example.org/'>
96+
>>> response = client._send_request(request)
97+
<HttpResponse: 200 OK>
98+
99+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
100+
101+
:param request: The network request you want to make. Required.
102+
:type request: ~azure.core.rest.HttpRequest
103+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
104+
:return: The response of your network call. Does not do error handling on your response.
105+
:rtype: ~azure.core.rest.HttpResponse
106+
"""
107+
108+
request_copy = deepcopy(request)
109+
request_copy.url = self._client.format_url(request_copy.url)
110+
return self._client.send_request(request_copy, **kwargs)
111+
112+
def close(self):
113+
# type: () -> None
114+
self._client.close()
115+
116+
def __enter__(self):
117+
# type: () -> ContainerServiceClient
118+
self._client.__enter__()
119+
return self
120+
121+
def __exit__(self, *exc_details):
122+
# type: (Any) -> None
123+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)