Skip to content

Commit d9297ce

Browse files
Azure CLI BotSDKAutoYan Zhang (WICRESOFT NORTH AMERICA LTD)RAY-316
authored
[AutoRelease] t2-machinelearningcompute-2021-05-14-14426(wave4) (Azure#18750)
* CodeGen from PR 14163 in Azure/azure-rest-api-specs machinelearningcompute wave4 modification (Azure#14163) * machinelearningcompute wave4 modification * machinelearningcompute wave4 * only track2 * 1.0.0b1 Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) <v-yanzhang@microsoft.com> * version,CHANGELOG * Update shared_requirements.txt * t2 config Co-authored-by: SDKAuto <sdkautomation@microsoft.com> Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) <v-yanzhang@microsoft.com> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Zed Lei <59104634+RAY-316@users.noreply.github.com> Co-authored-by: Zed <601306339@qq.com>
1 parent f0ad6f0 commit d9297ce

30 files changed

+4752
-1
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Release History
2+
3+
## 1.0.0b1 (2021-05-13)
4+
5+
This is beta preview version.
6+
7+
This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming).
8+
9+
**General breaking changes**
10+
11+
- Credential system has been completly revamped:
12+
13+
- `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported, use the `azure-identity` classes instead: https://pypi.org/project/azure-identity/
14+
- `credentials` parameter has been renamed `credential`
15+
16+
- The `config` attribute no longer exists on a client, configuration should be passed as kwarg. Example: `MyClient(credential, subscription_id, enable_logging=True)`. For a complete set of
17+
supported options, see the [parameters accept in init documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
18+
- You can't import a `version` module anymore, use `__version__` instead
19+
- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`.
20+
- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed).
21+
- Most of the operation kwarg have changed. Some of the most noticeable:
22+
23+
- `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user
24+
- For a complete set of
25+
supported options, see the [parameters accept in Request documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
26+
27+
**General new features**
28+
29+
- Type annotations support using `typing`. SDKs are mypy ready.
30+
- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client.
31+
- This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core-tracing-opentelemetry) for an overview.
32+
33+
## 0.4.1 (2018-05-29)
34+
35+
**Bugfixes**
36+
37+
- Compatibility of the sdist with wheel 0.31.0
38+
- msrestazure dependency version range
39+
40+
## 0.4.0 (2018-01-02)
41+
42+
**Features**
43+
44+
- Delete all resources associated with cluster with the optional
45+
deleteAll paramater.
46+
47+
## 0.3.0 (2017-10-25)
48+
49+
**Features**
50+
51+
- ACS orchestrator properties property is now optional.
52+
53+
## 0.2.0 (2017-10-17)
54+
55+
**Features**
56+
57+
- Kubernetes orchestrator service principal property is now optional.
58+
59+
## 0.1.0 (2017-09-22)
60+
61+
**Features**
62+
63+
- Initial private preview release.
64+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include _meta.json
2+
recursive-include tests *.py *.yaml
3+
include *.md
4+
include azure/__init__.py
5+
include azure/mgmt/__init__.py
6+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Microsoft Azure SDK for Python
2+
3+
This is the Microsoft Azure Machinelearningcompute Management Client Library.
4+
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
5+
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
6+
7+
8+
# Usage
9+
10+
11+
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
12+
13+
14+
15+
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
16+
Code samples for this package can be found at [Machinelearningcompute Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
17+
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
18+
19+
20+
# Provide Feedback
21+
22+
If you encounter any bugs or have suggestions, please file an issue in the
23+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
24+
section of the project.
25+
26+
27+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-machinelearningcompute%2FREADME.png)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"autorest": "3.4.2",
3+
"use": "@autorest/python@5.6.6",
4+
"commit": "3f1d9a2fd7d79c0e10cca4a4750a00e725ddc541",
5+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6+
"autorest_command": "autorest specification/machinelearningcompute/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.4.2",
7+
"readme": "specification/machinelearningcompute/resource-manager/readme.md"
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 ._machine_learning_compute_management_client import MachineLearningComputeManagementClient
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
13+
__all__ = ['MachineLearningComputeManagementClient']
14+
15+
try:
16+
from ._patch import patch_sdk # type: ignore
17+
patch_sdk()
18+
except ImportError:
19+
pass
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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 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 MachineLearningComputeManagementClientConfiguration(Configuration):
25+
"""Configuration for MachineLearningComputeManagementClient.
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 Azure subscription ID.
33+
:type subscription_id: str
34+
"""
35+
36+
def __init__(
37+
self,
38+
credential, # type: "TokenCredential"
39+
subscription_id, # type: str
40+
**kwargs # type: Any
41+
):
42+
# type: (...) -> None
43+
if credential is None:
44+
raise ValueError("Parameter 'credential' must not be None.")
45+
if subscription_id is None:
46+
raise ValueError("Parameter 'subscription_id' must not be None.")
47+
super(MachineLearningComputeManagementClientConfiguration, self).__init__(**kwargs)
48+
49+
self.credential = credential
50+
self.subscription_id = subscription_id
51+
self.api_version = "2017-08-01-preview"
52+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53+
kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningcompute/{}'.format(VERSION))
54+
self._configure(**kwargs)
55+
56+
def _configure(
57+
self,
58+
**kwargs # type: Any
59+
):
60+
# type: (...) -> None
61+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
62+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
63+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
64+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
66+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
67+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
68+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
69+
self.authentication_policy = kwargs.get('authentication_policy')
70+
if self.credential and not self.authentication_policy:
71+
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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.mgmt.core import ARMPipelineClient
12+
from msrest import Deserializer, Serializer
13+
14+
if TYPE_CHECKING:
15+
# pylint: disable=unused-import,ungrouped-imports
16+
from typing import Any, Optional
17+
18+
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
20+
21+
from ._configuration import MachineLearningComputeManagementClientConfiguration
22+
from .operations import OperationalizationClustersOperations
23+
from .operations import MachineLearningComputeOperations
24+
from . import models
25+
26+
27+
class MachineLearningComputeManagementClient(object):
28+
"""These APIs allow end users to operate on Azure Machine Learning Compute resources. They support the following operations::code:`<ul><li>Create or update a cluster</li><li>Get a cluster</li><li>Patch a cluster</li><li>Delete a cluster</li><li>Get keys for a cluster</li><li>Check if updates are available for system services in a cluster</li><li>Update system services in a cluster</li><li>Get all clusters in a resource group</li><li>Get all clusters in a subscription</li></ul>`.
29+
30+
:ivar operationalization_clusters: OperationalizationClustersOperations operations
31+
:vartype operationalization_clusters: azure.mgmt.machinelearningcompute.operations.OperationalizationClustersOperations
32+
:ivar machine_learning_compute: MachineLearningComputeOperations operations
33+
:vartype machine_learning_compute: azure.mgmt.machinelearningcompute.operations.MachineLearningComputeOperations
34+
:param credential: Credential needed for the client to connect to Azure.
35+
:type credential: ~azure.core.credentials.TokenCredential
36+
:param subscription_id: The Azure subscription ID.
37+
:type subscription_id: str
38+
:param str base_url: Service URL
39+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
40+
"""
41+
42+
def __init__(
43+
self,
44+
credential, # type: "TokenCredential"
45+
subscription_id, # type: str
46+
base_url=None, # type: Optional[str]
47+
**kwargs # type: Any
48+
):
49+
# type: (...) -> None
50+
if not base_url:
51+
base_url = 'https://management.azure.com'
52+
self._config = MachineLearningComputeManagementClientConfiguration(credential, subscription_id, **kwargs)
53+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
54+
55+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
56+
self._serialize = Serializer(client_models)
57+
self._serialize.client_side_validation = False
58+
self._deserialize = Deserializer(client_models)
59+
60+
self.operationalization_clusters = OperationalizationClustersOperations(
61+
self._client, self._config, self._serialize, self._deserialize)
62+
self.machine_learning_compute = MachineLearningComputeOperations(
63+
self._client, self._config, self._serialize, self._deserialize)
64+
65+
def _send_request(self, http_request, **kwargs):
66+
# type: (HttpRequest, Any) -> HttpResponse
67+
"""Runs the network request through the client's chained policies.
68+
69+
:param http_request: The network request you want to make. Required.
70+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
71+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
72+
:return: The response of your network call. Does not do error handling on your response.
73+
:rtype: ~azure.core.pipeline.transport.HttpResponse
74+
"""
75+
path_format_arguments = {
76+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
77+
}
78+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
79+
stream = kwargs.pop("stream", True)
80+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
81+
return pipeline_response.http_response
82+
83+
def close(self):
84+
# type: () -> None
85+
self._client.close()
86+
87+
def __enter__(self):
88+
# type: () -> MachineLearningComputeManagementClient
89+
self._client.__enter__()
90+
return self
91+
92+
def __exit__(self, *exc_details):
93+
# type: (Any) -> None
94+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)