Skip to content

Commit b24e6f8

Browse files
authored
[T2] datamigration (#15886)
1 parent c5745c1 commit b24e6f8

38 files changed

+16151
-10841
lines changed

sdk/datalake/azure-mgmt-datalake-store/tests/test_mgmt_datalake_store.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
PRIVATE_ENDPOINT_NAME = "myPrivateEndpoint"
2020

2121

22+
@unittest.skip("skip test")
2223
class MgmtDataLakeStoreTest(AzureMgmtTestCase):
2324

2425
def setUp(self):

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

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

3+
## 9.0.0b1 (2020-12-21)
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+
333
## 4.0.0 (2019-10-24)
434

535
**Features**

sdk/datamigration/azure-mgmt-datamigration/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ For a more complete set of Azure libraries, see the
1616

1717
## Usage
1818

19-
For code examples, see [Data
20-
Migration](https://docs.microsoft.com/python/api/overview/azure/) on
21-
docs.microsoft.com.
19+
20+
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
21+
22+
23+
24+
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
25+
Code samples for this package can be found at [Data Migration Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
26+
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
27+
2228

2329
## Provide Feedback
2430

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
#
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
75
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
107
# --------------------------------------------------------------------------
118

12-
from ._configuration import DataMigrationServiceClientConfiguration
13-
from ._data_migration_service_client import DataMigrationServiceClient
14-
__all__ = ['DataMigrationServiceClient', 'DataMigrationServiceClientConfiguration']
15-
16-
from .version import VERSION
9+
from ._data_migration_management_client import DataMigrationManagementClient
10+
from ._version import VERSION
1711

1812
__version__ = VERSION
13+
__all__ = ['DataMigrationManagementClient']
1914

15+
try:
16+
from ._patch import patch_sdk # type: ignore
17+
patch_sdk()
18+
except ImportError:
19+
pass
Lines changed: 52 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,71 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
#
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
75
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
107
# --------------------------------------------------------------------------
11-
from msrestazure import AzureConfiguration
128

13-
from .version import VERSION
9+
from typing import TYPE_CHECKING
1410

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 DataMigrationManagementClientConfiguration(Configuration):
25+
"""Configuration for DataMigrationManagementClient.
1526
16-
class DataMigrationServiceClientConfiguration(AzureConfiguration):
17-
"""Configuration for DataMigrationServiceClient
1827
Note that all parameters used to create this instance are saved as instance
1928
attributes.
2029
21-
:param credentials: Credentials needed for the client to connect to Azure.
22-
:type credentials: :mod:`A msrestazure Credentials
23-
object<msrestazure.azure_active_directory>`
24-
:param subscription_id: Identifier of the subscription
30+
:param credential: Credential needed for the client to connect to Azure.
31+
:type credential: ~azure.core.credentials.TokenCredential
32+
:param subscription_id: Identifier of the subscription.
2533
:type subscription_id: str
26-
:param str base_url: Service URL
2734
"""
2835

2936
def __init__(
30-
self, credentials, subscription_id, base_url=None):
31-
32-
if credentials is None:
33-
raise ValueError("Parameter 'credentials' must not be None.")
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.")
3445
if subscription_id is None:
3546
raise ValueError("Parameter 'subscription_id' must not be None.")
36-
if not base_url:
37-
base_url = 'https://management.azure.com'
38-
39-
super(DataMigrationServiceClientConfiguration, self).__init__(base_url)
40-
41-
# Starting Autorest.Python 4.0.64, make connection pool activated by default
42-
self.keep_alive = True
47+
super(DataMigrationManagementClientConfiguration, self).__init__(**kwargs)
4348

44-
self.add_user_agent('azure-mgmt-datamigration/{}'.format(VERSION))
45-
self.add_user_agent('Azure-SDK-For-Python')
46-
47-
self.credentials = credentials
49+
self.credential = credential
4850
self.subscription_id = subscription_id
51+
self.api_version = "2018-07-15-preview"
52+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53+
kwargs.setdefault('sdk_moniker', 'mgmt-datamigration/{}'.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)
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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+
20+
from ._configuration import DataMigrationManagementClientConfiguration
21+
from .operations import ResourceSkusOperations
22+
from .operations import ServicesOperations
23+
from .operations import TasksOperations
24+
from .operations import ServiceTasksOperations
25+
from .operations import ProjectsOperations
26+
from .operations import UsagesOperations
27+
from .operations import Operations
28+
from .operations import FilesOperations
29+
from . import models
30+
31+
32+
class DataMigrationManagementClient(object):
33+
"""Data Migration Client.
34+
35+
:ivar resource_skus: ResourceSkusOperations operations
36+
:vartype resource_skus: azure.mgmt.datamigration.operations.ResourceSkusOperations
37+
:ivar services: ServicesOperations operations
38+
:vartype services: azure.mgmt.datamigration.operations.ServicesOperations
39+
:ivar tasks: TasksOperations operations
40+
:vartype tasks: azure.mgmt.datamigration.operations.TasksOperations
41+
:ivar service_tasks: ServiceTasksOperations operations
42+
:vartype service_tasks: azure.mgmt.datamigration.operations.ServiceTasksOperations
43+
:ivar projects: ProjectsOperations operations
44+
:vartype projects: azure.mgmt.datamigration.operations.ProjectsOperations
45+
:ivar usages: UsagesOperations operations
46+
:vartype usages: azure.mgmt.datamigration.operations.UsagesOperations
47+
:ivar operations: Operations operations
48+
:vartype operations: azure.mgmt.datamigration.operations.Operations
49+
:ivar files: FilesOperations operations
50+
:vartype files: azure.mgmt.datamigration.operations.FilesOperations
51+
:param credential: Credential needed for the client to connect to Azure.
52+
:type credential: ~azure.core.credentials.TokenCredential
53+
:param subscription_id: Identifier of the subscription.
54+
:type subscription_id: str
55+
:param str base_url: Service URL
56+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
57+
"""
58+
59+
def __init__(
60+
self,
61+
credential, # type: "TokenCredential"
62+
subscription_id, # type: str
63+
base_url=None, # type: Optional[str]
64+
**kwargs # type: Any
65+
):
66+
# type: (...) -> None
67+
if not base_url:
68+
base_url = 'https://management.azure.com'
69+
self._config = DataMigrationManagementClientConfiguration(credential, 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._serialize.client_side_validation = False
75+
self._deserialize = Deserializer(client_models)
76+
77+
self.resource_skus = ResourceSkusOperations(
78+
self._client, self._config, self._serialize, self._deserialize)
79+
self.services = ServicesOperations(
80+
self._client, self._config, self._serialize, self._deserialize)
81+
self.tasks = TasksOperations(
82+
self._client, self._config, self._serialize, self._deserialize)
83+
self.service_tasks = ServiceTasksOperations(
84+
self._client, self._config, self._serialize, self._deserialize)
85+
self.projects = ProjectsOperations(
86+
self._client, self._config, self._serialize, self._deserialize)
87+
self.usages = UsagesOperations(
88+
self._client, self._config, self._serialize, self._deserialize)
89+
self.operations = Operations(
90+
self._client, self._config, self._serialize, self._deserialize)
91+
self.files = FilesOperations(
92+
self._client, self._config, self._serialize, self._deserialize)
93+
94+
def close(self):
95+
# type: () -> None
96+
self._client.close()
97+
98+
def __enter__(self):
99+
# type: () -> DataMigrationManagementClient
100+
self._client.__enter__()
101+
return self
102+
103+
def __exit__(self, *exc_details):
104+
# type: (Any) -> None
105+
self._client.__exit__(*exc_details)

sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_data_migration_service_client.py

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)