Skip to content

Commit 247c692

Browse files
author
SDKAuto
committed
CodeGen from PR 19874 in Azure/azure-rest-api-specs
Merge 134a2cd51dc0581d1afd0a37e5f7bd0b363d9dce into 8885261ffeedd3e789dca1fd8e2f830b800fdacf
1 parent 3da721f commit 247c692

File tree

84 files changed

+44072
-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.

84 files changed

+44072
-5
lines changed

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": "ca5d9600e4950afdae3c23c71d9407b6aa3fce63",
7+
"commit": "78f7293aa8885bc3a8fb438b14ca78a4aeaeeab7",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
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",
9+
"autorest_command": "autorest specification/containerservice/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/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: 72 additions & 1 deletion
Large diffs are not rendered by default.

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

Lines changed: 72 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_04_01.models import *
9+
from .v2022_06_01.models import *
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
11+
try:
12+
from ._patch import __all__ as _patch_all
13+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
14+
except ImportError:
15+
_patch_all = []
16+
from ._patch import patch_sdk as _patch_sdk
17+
__all__ = ['ContainerServiceClient']
18+
__all__.extend([p for p in _patch_all if p not in __all__])
19+
20+
_patch_sdk()
Lines changed: 72 additions & 0 deletions
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-06-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-06-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)
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
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_06_01.operations.Operations
30+
:ivar managed_clusters: ManagedClustersOperations operations
31+
:vartype managed_clusters:
32+
azure.mgmt.containerservice.v2022_06_01.operations.ManagedClustersOperations
33+
:ivar maintenance_configurations: MaintenanceConfigurationsOperations operations
34+
:vartype maintenance_configurations:
35+
azure.mgmt.containerservice.v2022_06_01.operations.MaintenanceConfigurationsOperations
36+
:ivar agent_pools: AgentPoolsOperations operations
37+
:vartype agent_pools: azure.mgmt.containerservice.v2022_06_01.operations.AgentPoolsOperations
38+
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
39+
:vartype private_endpoint_connections:
40+
azure.mgmt.containerservice.v2022_06_01.operations.PrivateEndpointConnectionsOperations
41+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
42+
:vartype private_link_resources:
43+
azure.mgmt.containerservice.v2022_06_01.operations.PrivateLinkResourcesOperations
44+
:ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations
45+
:vartype resolve_private_link_service_id:
46+
azure.mgmt.containerservice.v2022_06_01.operations.ResolvePrivateLinkServiceIdOperations
47+
:ivar snapshots: SnapshotsOperations operations
48+
:vartype snapshots: azure.mgmt.containerservice.v2022_06_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-06-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(
77+
self._client, self._config, self._serialize, self._deserialize
78+
)
79+
self.managed_clusters = ManagedClustersOperations(
80+
self._client, self._config, self._serialize, self._deserialize
81+
)
82+
self.maintenance_configurations = MaintenanceConfigurationsOperations(
83+
self._client, self._config, self._serialize, self._deserialize
84+
)
85+
self.agent_pools = AgentPoolsOperations(
86+
self._client, self._config, self._serialize, self._deserialize
87+
)
88+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
89+
self._client, self._config, self._serialize, self._deserialize
90+
)
91+
self.private_link_resources = PrivateLinkResourcesOperations(
92+
self._client, self._config, self._serialize, self._deserialize
93+
)
94+
self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(
95+
self._client, self._config, self._serialize, self._deserialize
96+
)
97+
self.snapshots = SnapshotsOperations(
98+
self._client, self._config, self._serialize, self._deserialize
99+
)
100+
101+
102+
def _send_request(
103+
self,
104+
request: HttpRequest,
105+
**kwargs: Any
106+
) -> HttpResponse:
107+
"""Runs the network request through the client's chained policies.
108+
109+
>>> from azure.core.rest import HttpRequest
110+
>>> request = HttpRequest("GET", "https://www.example.org/")
111+
<HttpRequest [GET], url: 'https://www.example.org/'>
112+
>>> response = client._send_request(request)
113+
<HttpResponse: 200 OK>
114+
115+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
116+
117+
:param request: The network request you want to make. Required.
118+
:type request: ~azure.core.rest.HttpRequest
119+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
120+
:return: The response of your network call. Does not do error handling on your response.
121+
:rtype: ~azure.core.rest.HttpResponse
122+
"""
123+
124+
request_copy = deepcopy(request)
125+
request_copy.url = self._client.format_url(request_copy.url)
126+
return self._client.send_request(request_copy, **kwargs)
127+
128+
def close(self):
129+
# type: () -> None
130+
self._client.close()
131+
132+
def __enter__(self):
133+
# type: () -> ContainerServiceClient
134+
self._client.__enter__()
135+
return self
136+
137+
def __exit__(self, *exc_details):
138+
# type: (Any) -> None
139+
self._client.__exit__(*exc_details)
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"chosen_version": "2022-06-01",
3+
"total_api_version_list": ["2022-06-01"],
4+
"client": {
5+
"name": "ContainerServiceClient",
6+
"filename": "_container_service_client",
7+
"description": "The Container Service Client.",
8+
"host_value": "\"https://management.azure.com\"",
9+
"parameterized_host_template": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true,
12+
"client_side_validation": false,
13+
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
14+
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
15+
},
16+
"global_parameters": {
17+
"sync": {
18+
"credential": {
19+
"signature": "credential, # type: \"TokenCredential\"",
20+
"description": "Credential needed for the client to connect to Azure.",
21+
"docstring_type": "~azure.core.credentials.TokenCredential",
22+
"required": true
23+
},
24+
"subscription_id": {
25+
"signature": "subscription_id, # type: str",
26+
"description": "The ID of the target subscription.",
27+
"docstring_type": "str",
28+
"required": true
29+
}
30+
},
31+
"async": {
32+
"credential": {
33+
"signature": "credential: \"AsyncTokenCredential\",",
34+
"description": "Credential needed for the client to connect to Azure.",
35+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
36+
"required": true
37+
},
38+
"subscription_id": {
39+
"signature": "subscription_id: str,",
40+
"description": "The ID of the target subscription.",
41+
"docstring_type": "str",
42+
"required": true
43+
}
44+
},
45+
"constant": {
46+
},
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=\"https://management.azure.com\", # type: str",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: str = \"https://management.azure.com\",",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
90+
},
91+
"config": {
92+
"credential": true,
93+
"credential_scopes": ["https://management.azure.com/.default"],
94+
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
95+
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
96+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
97+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
98+
},
99+
"operation_groups": {
100+
"operations": "Operations",
101+
"managed_clusters": "ManagedClustersOperations",
102+
"maintenance_configurations": "MaintenanceConfigurationsOperations",
103+
"agent_pools": "AgentPoolsOperations",
104+
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
105+
"private_link_resources": "PrivateLinkResourcesOperations",
106+
"resolve_private_link_service_id": "ResolvePrivateLinkServiceIdOperations",
107+
"snapshots": "SnapshotsOperations"
108+
}
109+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
"""Customize generated code here.
6+
7+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8+
"""
9+
from typing import List
10+
11+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
12+
13+
def patch_sdk():
14+
"""Do not remove from this file.
15+
16+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
17+
you can't accomplish using the techniques described in
18+
https://aka.ms/azsdk/python/dpcodegen/python/customize
19+
"""

0 commit comments

Comments
 (0)