Skip to content

Commit 9c47777

Browse files
nthandeMSneeduv
andauthored
[ML] Add 12-01-2022-preview swagger to ML Client (Azure#28370)
* Removed readonly field from compute schedules * Removed erroneous experimental warning * Removed extra print statement * Updated changelog * Removed unused import * Update CHANGELOG.md * Update CHANGELOG.md * Added 2022-12-01-preview to REST API versions * Added autogenerated files for v2022-12-01 REST API * Updated changelog * Updated ml_client to include december swagger * Regenerated December API * Adding in merge fixes * Fixes for pylint * Added missing registries tag Co-authored-by: Neehar Duvvuri <[email protected]>
1 parent e00960b commit 9c47777

File tree

97 files changed

+121553
-8
lines changed

Some content is hidden

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

97 files changed

+121553
-8
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from azure.ai.ml._restclient.v2022_05_01 import AzureMachineLearningWorkspaces as ServiceClient052022
3333
from azure.ai.ml._restclient.v2022_10_01 import AzureMachineLearningWorkspaces as ServiceClient102022
3434
from azure.ai.ml._restclient.v2022_10_01_preview import AzureMachineLearningWorkspaces as ServiceClient102022Preview
35+
from azure.ai.ml._restclient.v2022_12_01_preview import AzureMachineLearningWorkspaces as ServiceClient122022Preview
3536
from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope
3637

3738
# from azure.ai.ml._telemetry.logging_handler import get_appinsights_log_handler
@@ -273,6 +274,13 @@ def __init__(
273274
**kwargs,
274275
)
275276

277+
self._service_client_12_2022_preview = ServiceClient122022Preview(
278+
credential=self._credential,
279+
subscription_id=self._operation_scope._subscription_id,
280+
base_url=base_url,
281+
**kwargs,
282+
)
283+
276284
self._workspaces = WorkspaceOperations(
277285
self._operation_scope,
278286
self._rp_service_client,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
13+
__all__ = ['AzureMachineLearningWorkspaces']
14+
15+
# `._patch.py` is used for handwritten extensions to the generated code
16+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17+
from ._patch import patch_sdk
18+
patch_sdk()

sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_azure_machine_learning_workspaces.py

Lines changed: 233 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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 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+
from ._version import VERSION
16+
17+
if TYPE_CHECKING:
18+
# pylint: disable=unused-import,ungrouped-imports
19+
from typing import Any
20+
21+
from azure.core.credentials import TokenCredential
22+
23+
24+
class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
25+
"""Configuration for AzureMachineLearningWorkspaces.
26+
27+
Note that all parameters used to create this instance are saved as instance
28+
attributes.
29+
30+
:param credential: Credential needed for the client to connect to Azure.
31+
:type credential: ~azure.core.credentials.TokenCredential
32+
:param subscription_id: The ID of the target subscription.
33+
:type subscription_id: str
34+
:keyword api_version: Api Version. The default value is "2022-12-01-preview". Note that
35+
overriding this default value may result in unsupported behavior.
36+
:paramtype api_version: str
37+
"""
38+
39+
def __init__(
40+
self,
41+
credential, # type: "TokenCredential"
42+
subscription_id, # type: str
43+
**kwargs # type: Any
44+
):
45+
# type: (...) -> None
46+
super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs)
47+
api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str
48+
49+
if credential is None:
50+
raise ValueError("Parameter 'credential' must not be None.")
51+
if subscription_id is None:
52+
raise ValueError("Parameter 'subscription_id' must not be None.")
53+
54+
self.credential = credential
55+
self.subscription_id = subscription_id
56+
self.api_version = api_version
57+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
58+
kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION))
59+
self._configure(**kwargs)
60+
61+
def _configure(
62+
self,
63+
**kwargs # type: Any
64+
):
65+
# type: (...) -> None
66+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
67+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
68+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
69+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
70+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
71+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
72+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
73+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
74+
self.authentication_policy = kwargs.get('authentication_policy')
75+
if self.credential and not self.authentication_policy:
76+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
#
4+
# Copyright (c) Microsoft Corporation. All rights reserved.
5+
#
6+
# The MIT License (MIT)
7+
#
8+
# Permission is hereby granted, free of charge, to any person obtaining a copy
9+
# of this software and associated documentation files (the ""Software""), to
10+
# deal in the Software without restriction, including without limitation the
11+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12+
# sell copies of the Software, and to permit persons to whom the Software is
13+
# furnished to do so, subject to the following conditions:
14+
#
15+
# The above copyright notice and this permission notice shall be included in
16+
# all copies or substantial portions of the Software.
17+
#
18+
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24+
# IN THE SOFTWARE.
25+
#
26+
# --------------------------------------------------------------------------
27+
28+
# This file is used for handwritten extensions to the generated code. Example:
29+
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
30+
def patch_sdk():
31+
pass
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------
7+
8+
from azure.core.pipeline.transport import HttpRequest
9+
10+
def _convert_request(request, files=None):
11+
data = request.content if not files else None
12+
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
13+
if files:
14+
request.set_formdata_body(files)
15+
return request
16+
17+
def _format_url_section(template, **kwargs):
18+
components = template.split("/")
19+
while components:
20+
try:
21+
return template.format(**kwargs)
22+
except KeyError as key:
23+
formatted_components = template.split("/")
24+
components = [
25+
c for c in formatted_components if "{}".format(key.args[0]) not in c
26+
]
27+
template = "/".join(components)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
VERSION = "0.1.0"
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 ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces
10+
__all__ = ['AzureMachineLearningWorkspaces']
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()

0 commit comments

Comments
 (0)