diff --git a/sdk/datamigration/azure-mgmt-datamigration/_meta.json b/sdk/datamigration/azure-mgmt-datamigration/_meta.json index a8d432b309aa..ac9c5a4c8ce3 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/_meta.json +++ b/sdk/datamigration/azure-mgmt-datamigration/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.5", + "autorest": "3.7.2", "use": [ - "@autorest/python@5.8.4", - "@autorest/modelerfour@4.19.2" + "@autorest/python@5.12.0", + "@autorest/modelerfour@4.19.3" ], - "commit": "850425353115aa23d469f12f44847ff9e8326294", + "commit": "2ded927e0a97ba1e79744ac167fb4d7f1c53b24d", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/datamigration/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.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "autorest_command": "autorest specification/datamigration/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/datamigration/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/__init__.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/__init__.py index b82e09a5b435..feb6b8a7de7b 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/__init__.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['DataMigrationManagementClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_configuration.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_configuration.py index 1cf3678b0b78..1bf41a7bcabb 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_configuration.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_configuration.py @@ -6,18 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential @@ -29,26 +27,25 @@ class DataMigrationManagementClientConfiguration(Configuration): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Identifier of the subscription. + :param subscription_id: Subscription ID that identifies an Azure subscription. :type subscription_id: str """ def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataMigrationManagementClientConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataMigrationManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-06-30" + self.api_version = "2022-03-30-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-datamigration/{}'.format(VERSION)) self._configure(**kwargs) @@ -68,4 +65,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_data_migration_management_client.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_data_migration_management_client.py index 356d1f60be9b..cb244e705ea4 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_data_migration_management_client.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_data_migration_management_client.py @@ -6,33 +6,38 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import DataMigrationManagementClientConfiguration +from .operations import DatabaseMigrationsSqlDbOperations, DatabaseMigrationsSqlMiOperations, DatabaseMigrationsSqlVmOperations, FilesOperations, Operations, ProjectsOperations, ResourceSkusOperations, ServiceTasksOperations, ServicesOperations, SqlMigrationServicesOperations, TasksOperations, UsagesOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import DataMigrationManagementClientConfiguration -from .operations import ResourceSkusOperations -from .operations import ServicesOperations -from .operations import TasksOperations -from .operations import ServiceTasksOperations -from .operations import ProjectsOperations -from .operations import UsagesOperations -from .operations import Operations -from .operations import FilesOperations -from . import models - -class DataMigrationManagementClient(object): +class DataMigrationManagementClient: """Data Migration Client. + :ivar database_migrations_sql_db: DatabaseMigrationsSqlDbOperations operations + :vartype database_migrations_sql_db: + azure.mgmt.datamigration.operations.DatabaseMigrationsSqlDbOperations + :ivar database_migrations_sql_mi: DatabaseMigrationsSqlMiOperations operations + :vartype database_migrations_sql_mi: + azure.mgmt.datamigration.operations.DatabaseMigrationsSqlMiOperations + :ivar database_migrations_sql_vm: DatabaseMigrationsSqlVmOperations operations + :vartype database_migrations_sql_vm: + azure.mgmt.datamigration.operations.DatabaseMigrationsSqlVmOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.datamigration.operations.Operations + :ivar sql_migration_services: SqlMigrationServicesOperations operations + :vartype sql_migration_services: + azure.mgmt.datamigration.operations.SqlMigrationServicesOperations :ivar resource_skus: ResourceSkusOperations operations :vartype resource_skus: azure.mgmt.datamigration.operations.ResourceSkusOperations :ivar services: ServicesOperations operations @@ -45,70 +50,71 @@ class DataMigrationManagementClient(object): :vartype projects: azure.mgmt.datamigration.operations.ProjectsOperations :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.datamigration.operations.UsagesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.datamigration.operations.Operations :ivar files: FilesOperations operations :vartype files: azure.mgmt.datamigration.operations.FilesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Identifier of the subscription. + :param subscription_id: Subscription ID that identifies an Azure subscription. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataMigrationManagementClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = DataMigrationManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - - self.resource_skus = ResourceSkusOperations( - self._client, self._config, self._serialize, self._deserialize) - self.services = ServicesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.tasks = TasksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.service_tasks = ServiceTasksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.projects = ProjectsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.files = FilesOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + self._serialize.client_side_validation = False + self.database_migrations_sql_db = DatabaseMigrationsSqlDbOperations(self._client, self._config, self._serialize, self._deserialize) + self.database_migrations_sql_mi = DatabaseMigrationsSqlMiOperations(self._client, self._config, self._serialize, self._deserialize) + self.database_migrations_sql_vm = DatabaseMigrationsSqlVmOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.sql_migration_services = SqlMigrationServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resource_skus = ResourceSkusOperations(self._client, self._config, self._serialize, self._deserialize) + self.services = ServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.tasks = TasksOperations(self._client, self._config, self._serialize, self._deserialize) + self.service_tasks = ServiceTasksOperations(self._client, self._config, self._serialize, self._deserialize) + self.projects = ProjectsOperations(self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.files = FilesOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: Any + ) -> HttpResponse: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_metadata.json b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_metadata.json index fea5b14b43b6..ee64930be535 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_metadata.json +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_metadata.json @@ -1,17 +1,17 @@ { - "chosen_version": "2021-06-30", - "total_api_version_list": ["2021-06-30"], + "chosen_version": "2022-03-30-preview", + "total_api_version_list": ["2022-03-30-preview"], "client": { "name": "DataMigrationManagementClient", "filename": "_data_migration_management_client", "description": "Data Migration Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataMigrationManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataMigrationManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataMigrationManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataMigrationManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -23,7 +23,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "Identifier of the subscription.", + "description": "Subscription ID that identifies an Azure subscription.", "docstring_type": "str", "required": true } @@ -37,7 +37,7 @@ }, "subscription_id": { "signature": "subscription_id: str,", - "description": "Identifier of the subscription.", + "description": "Subscription ID that identifies an Azure subscription.", "docstring_type": "str", "required": true } @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,20 +91,23 @@ "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "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\"]}}}", + "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\"]}}}" }, "operation_groups": { + "database_migrations_sql_db": "DatabaseMigrationsSqlDbOperations", + "database_migrations_sql_mi": "DatabaseMigrationsSqlMiOperations", + "database_migrations_sql_vm": "DatabaseMigrationsSqlVmOperations", + "operations": "Operations", + "sql_migration_services": "SqlMigrationServicesOperations", "resource_skus": "ResourceSkusOperations", "services": "ServicesOperations", "tasks": "TasksOperations", "service_tasks": "ServiceTasksOperations", "projects": "ProjectsOperations", "usages": "UsagesOperations", - "operations": "Operations", "files": "FilesOperations" } } \ No newline at end of file diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_patch.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_vendor.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_version.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_version.py index 9f8bb24bdd99..e5754a47ce68 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_version.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/__init__.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/__init__.py index 29a86c66d2b0..1d807c61a6d0 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/__init__.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/__init__.py @@ -8,3 +8,8 @@ from ._data_migration_management_client import DataMigrationManagementClient __all__ = ['DataMigrationManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_configuration.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_configuration.py index 6a35d74a7602..42a9a0ef032b 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_configuration.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -27,7 +27,7 @@ class DataMigrationManagementClientConfiguration(Configuration): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Identifier of the subscription. + :param subscription_id: Subscription ID that identifies an Azure subscription. :type subscription_id: str """ @@ -37,15 +37,15 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(DataMigrationManagementClientConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataMigrationManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-06-30" + self.api_version = "2022-03-30-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-datamigration/{}'.format(VERSION)) self._configure(**kwargs) @@ -64,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_data_migration_management_client.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_data_migration_management_client.py index 672ca04d1562..8f44173f33d5 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_data_migration_management_client.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_data_migration_management_client.py @@ -6,31 +6,38 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import DataMigrationManagementClientConfiguration +from .operations import DatabaseMigrationsSqlDbOperations, DatabaseMigrationsSqlMiOperations, DatabaseMigrationsSqlVmOperations, FilesOperations, Operations, ProjectsOperations, ResourceSkusOperations, ServiceTasksOperations, ServicesOperations, SqlMigrationServicesOperations, TasksOperations, UsagesOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import DataMigrationManagementClientConfiguration -from .operations import ResourceSkusOperations -from .operations import ServicesOperations -from .operations import TasksOperations -from .operations import ServiceTasksOperations -from .operations import ProjectsOperations -from .operations import UsagesOperations -from .operations import Operations -from .operations import FilesOperations -from .. import models - - -class DataMigrationManagementClient(object): +class DataMigrationManagementClient: """Data Migration Client. + :ivar database_migrations_sql_db: DatabaseMigrationsSqlDbOperations operations + :vartype database_migrations_sql_db: + azure.mgmt.datamigration.aio.operations.DatabaseMigrationsSqlDbOperations + :ivar database_migrations_sql_mi: DatabaseMigrationsSqlMiOperations operations + :vartype database_migrations_sql_mi: + azure.mgmt.datamigration.aio.operations.DatabaseMigrationsSqlMiOperations + :ivar database_migrations_sql_vm: DatabaseMigrationsSqlVmOperations operations + :vartype database_migrations_sql_vm: + azure.mgmt.datamigration.aio.operations.DatabaseMigrationsSqlVmOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.datamigration.aio.operations.Operations + :ivar sql_migration_services: SqlMigrationServicesOperations operations + :vartype sql_migration_services: + azure.mgmt.datamigration.aio.operations.SqlMigrationServicesOperations :ivar resource_skus: ResourceSkusOperations operations :vartype resource_skus: azure.mgmt.datamigration.aio.operations.ResourceSkusOperations :ivar services: ServicesOperations operations @@ -43,68 +50,71 @@ class DataMigrationManagementClient(object): :vartype projects: azure.mgmt.datamigration.aio.operations.ProjectsOperations :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.datamigration.aio.operations.UsagesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.datamigration.aio.operations.Operations :ivar files: FilesOperations operations :vartype files: azure.mgmt.datamigration.aio.operations.FilesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Identifier of the subscription. + :param subscription_id: Subscription ID that identifies an Azure subscription. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataMigrationManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataMigrationManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.database_migrations_sql_db = DatabaseMigrationsSqlDbOperations(self._client, self._config, self._serialize, self._deserialize) + self.database_migrations_sql_mi = DatabaseMigrationsSqlMiOperations(self._client, self._config, self._serialize, self._deserialize) + self.database_migrations_sql_vm = DatabaseMigrationsSqlVmOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.sql_migration_services = SqlMigrationServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resource_skus = ResourceSkusOperations(self._client, self._config, self._serialize, self._deserialize) + self.services = ServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.tasks = TasksOperations(self._client, self._config, self._serialize, self._deserialize) + self.service_tasks = ServiceTasksOperations(self._client, self._config, self._serialize, self._deserialize) + self.projects = ProjectsOperations(self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.files = FilesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_skus = ResourceSkusOperations( - self._client, self._config, self._serialize, self._deserialize) - self.services = ServicesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.tasks = TasksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.service_tasks = ServiceTasksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.projects = ProjectsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.files = FilesOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_patch.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/__init__.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/__init__.py index 6fcef949b4af..f225cba43b6f 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/__init__.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/__init__.py @@ -6,22 +6,30 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._database_migrations_sql_db_operations import DatabaseMigrationsSqlDbOperations +from ._database_migrations_sql_mi_operations import DatabaseMigrationsSqlMiOperations +from ._database_migrations_sql_vm_operations import DatabaseMigrationsSqlVmOperations +from ._operations import Operations +from ._sql_migration_services_operations import SqlMigrationServicesOperations from ._resource_skus_operations import ResourceSkusOperations from ._services_operations import ServicesOperations from ._tasks_operations import TasksOperations from ._service_tasks_operations import ServiceTasksOperations from ._projects_operations import ProjectsOperations from ._usages_operations import UsagesOperations -from ._operations import Operations from ._files_operations import FilesOperations __all__ = [ + 'DatabaseMigrationsSqlDbOperations', + 'DatabaseMigrationsSqlMiOperations', + 'DatabaseMigrationsSqlVmOperations', + 'Operations', + 'SqlMigrationServicesOperations', 'ResourceSkusOperations', 'ServicesOperations', 'TasksOperations', 'ServiceTasksOperations', 'ProjectsOperations', 'UsagesOperations', - 'Operations', 'FilesOperations', ] diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_database_migrations_sql_db_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_database_migrations_sql_db_operations.py new file mode 100644 index 000000000000..93b3f246d529 --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_database_migrations_sql_db_operations.py @@ -0,0 +1,466 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._database_migrations_sql_db_operations import build_cancel_request_initial, build_create_or_update_request_initial, build_delete_request_initial, build_get_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DatabaseMigrationsSqlDbOperations: + """DatabaseMigrationsSqlDbOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.datamigration.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + migration_operation_id: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlDb": + """Retrieve the Database Migration resource. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_db_instance_name: + :type sql_db_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param migration_operation_id: Optional migration operation ID. If this is provided, then + details of migration operation for that ID are retrieved. If not provided (default), then + details related to most recent or current operation are retrieved. + :type migration_operation_id: str + :param expand: Complete migration details be included in the response. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabaseMigrationSqlDb, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlDb + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlDb"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + migration_operation_id=migration_operation_id, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabaseMigrationSqlDb', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlDb", + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlDb": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlDb"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DatabaseMigrationSqlDb') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseMigrationSqlDb', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DatabaseMigrationSqlDb', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlDb", + **kwargs: Any + ) -> AsyncLROPoller["_models.DatabaseMigrationSqlDb"]: + """Create or Update Database Migration resource. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_db_instance_name: + :type sql_db_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Details of Sql Db migration resource. + :type parameters: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlDb + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DatabaseMigrationSqlDb or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datamigration.models.DatabaseMigrationSqlDb] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlDb"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DatabaseMigrationSqlDb', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + force=force, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + force: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete Database Migration resource. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_db_instance_name: + :type sql_db_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param force: Optional force delete boolean. If this is provided as true, migration will be + deleted even if active. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + async def _cancel_initial( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MigrationOperationInput') + + request = build_cancel_request_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore + + + @distributed_trace_async + async def begin_cancel( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stop on going migration for the database. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_db_instance_name: + :type sql_db_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Required migration operation ID for which cancel will be initiated. + :type parameters: ~azure.mgmt.datamigration.models.MigrationOperationInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._cancel_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_database_migrations_sql_mi_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_database_migrations_sql_mi_operations.py new file mode 100644 index 000000000000..054a92099ebf --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_database_migrations_sql_mi_operations.py @@ -0,0 +1,471 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._database_migrations_sql_mi_operations import build_cancel_request_initial, build_create_or_update_request_initial, build_cutover_request_initial, build_get_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DatabaseMigrationsSqlMiOperations: + """DatabaseMigrationsSqlMiOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.datamigration.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + migration_operation_id: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlMi": + """Retrieve the specified database migration for a given SQL Managed Instance. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: + :type managed_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param migration_operation_id: Optional migration operation ID. If this is provided, then + details of migration operation for that ID are retrieved. If not provided (default), then + details related to most recent or current operation are retrieved. + :type migration_operation_id: str + :param expand: Complete migration details be included in the response. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabaseMigrationSqlMi, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlMi + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlMi"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + migration_operation_id=migration_operation_id, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabaseMigrationSqlMi', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlMi", + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlMi": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlMi"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DatabaseMigrationSqlMi') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseMigrationSqlMi', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DatabaseMigrationSqlMi', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlMi", + **kwargs: Any + ) -> AsyncLROPoller["_models.DatabaseMigrationSqlMi"]: + """Create a new database migration to a given SQL Managed Instance. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: + :type managed_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlMi + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DatabaseMigrationSqlMi or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datamigration.models.DatabaseMigrationSqlMi] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlMi"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DatabaseMigrationSqlMi', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + async def _cancel_initial( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MigrationOperationInput') + + request = build_cancel_request_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore + + + @distributed_trace_async + async def begin_cancel( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stop in-progress database migration to SQL Managed Instance. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: + :type managed_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Required migration operation ID for which cancel will be initiated. + :type parameters: ~azure.mgmt.datamigration.models.MigrationOperationInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._cancel_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore + + async def _cutover_initial( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MigrationOperationInput') + + request = build_cutover_request_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._cutover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _cutover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover'} # type: ignore + + + @distributed_trace_async + async def begin_cutover( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Initiate cutover for in-progress online database migration to SQL Managed Instance. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: + :type managed_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Required migration operation ID for which cutover will be initiated. + :type parameters: ~azure.mgmt.datamigration.models.MigrationOperationInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._cutover_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_cutover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover'} # type: ignore diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_database_migrations_sql_vm_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_database_migrations_sql_vm_operations.py new file mode 100644 index 000000000000..7380e2398c65 --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_database_migrations_sql_vm_operations.py @@ -0,0 +1,471 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._database_migrations_sql_vm_operations import build_cancel_request_initial, build_create_or_update_request_initial, build_cutover_request_initial, build_get_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DatabaseMigrationsSqlVmOperations: + """DatabaseMigrationsSqlVmOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.datamigration.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + migration_operation_id: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlVm": + """Retrieve the specified database migration for a given SQL VM. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_virtual_machine_name: + :type sql_virtual_machine_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param migration_operation_id: Optional migration operation ID. If this is provided, then + details of migration operation for that ID are retrieved. If not provided (default), then + details related to most recent or current operation are retrieved. + :type migration_operation_id: str + :param expand: Complete migration details be included in the response. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabaseMigrationSqlVm, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlVm + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlVm"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + migration_operation_id=migration_operation_id, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabaseMigrationSqlVm', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlVm", + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlVm": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlVm"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DatabaseMigrationSqlVm') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseMigrationSqlVm', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DatabaseMigrationSqlVm', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlVm", + **kwargs: Any + ) -> AsyncLROPoller["_models.DatabaseMigrationSqlVm"]: + """Create a new database migration to a given SQL VM. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_virtual_machine_name: + :type sql_virtual_machine_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlVm + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DatabaseMigrationSqlVm or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datamigration.models.DatabaseMigrationSqlVm] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlVm"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DatabaseMigrationSqlVm', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + async def _cancel_initial( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MigrationOperationInput') + + request = build_cancel_request_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore + + + @distributed_trace_async + async def begin_cancel( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stop in-progress database migration to SQL VM. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_virtual_machine_name: + :type sql_virtual_machine_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: + :type parameters: ~azure.mgmt.datamigration.models.MigrationOperationInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._cancel_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore + + async def _cutover_initial( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MigrationOperationInput') + + request = build_cutover_request_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._cutover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _cutover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover'} # type: ignore + + + @distributed_trace_async + async def begin_cutover( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Initiate cutover for in-progress online database migration to SQL VM. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_virtual_machine_name: + :type sql_virtual_machine_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: + :type parameters: ~azure.mgmt.datamigration.models.MigrationOperationInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._cutover_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_cutover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover'} # type: ignore diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_files_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_files_operations.py index b9ff418d9a5c..848cd0bbedf4 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_files_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_files_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._files_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_read_request, build_read_write_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, group_name: str, @@ -69,37 +75,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('FileList', pipeline_response) + deserialized = self._deserialize("FileList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +116,19 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files'} # type: ignore + @distributed_trace_async async def get( self, group_name: str, @@ -154,35 +160,25 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectFile', pipeline_response) @@ -191,8 +187,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, group_name: str, @@ -226,40 +225,30 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'ProjectFile') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectFile') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,8 +261,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'} # type: ignore + + @distributed_trace_async async def delete( self, group_name: str, @@ -304,35 +296,25 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,6 +322,8 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'} # type: ignore + + @distributed_trace_async async def update( self, group_name: str, @@ -373,40 +357,30 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'ProjectFile') + + request = build_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectFile') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectFile', pipeline_response) @@ -415,8 +389,11 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'} # type: ignore + + @distributed_trace_async async def read( self, group_name: str, @@ -448,35 +425,25 @@ async def read( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.read.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_read_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + template_url=self.read.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FileStorageInfo', pipeline_response) @@ -485,8 +452,11 @@ async def read( return cls(pipeline_response, deserialized, {}) return deserialized + read.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/read'} # type: ignore + + @distributed_trace_async async def read_write( self, group_name: str, @@ -517,35 +487,25 @@ async def read_write( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.read_write.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_read_write_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + template_url=self.read_write.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FileStorageInfo', pipeline_response) @@ -554,4 +514,6 @@ async def read_write( return cls(pipeline_response, deserialized, {}) return deserialized + read_write.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/readwrite'} # type: ignore + diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_operations.py index 084ece29dd8c..4610767f3f48 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,48 +46,45 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any - ) -> AsyncIterable["_models.ServiceOperationList"]: - """Get available resource provider actions (operations). - - Lists all available actions exposed by the Database Migration Service resource provider. + ) -> AsyncIterable["_models.OperationListResult"]: + """Lists all of the available SQL Migration REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ServiceOperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.ServiceOperationList] + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceOperationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ServiceOperationList', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -95,12 +97,12 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_projects_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_projects_operations.py index a46f80a04bdb..3b7fbaa07f61 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_projects_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_projects_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._projects_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, group_name: str, @@ -66,36 +72,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ProjectList', pipeline_response) + deserialized = self._deserialize("ProjectList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -108,17 +111,19 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects'} # type: ignore + @distributed_trace_async async def create_or_update( self, group_name: str, @@ -150,39 +155,29 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'Project') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Project') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -195,8 +190,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} # type: ignore + + @distributed_trace_async async def get( self, group_name: str, @@ -225,34 +223,24 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Project', pipeline_response) @@ -261,8 +249,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} # type: ignore + + @distributed_trace_async async def delete( self, group_name: str, @@ -294,36 +285,25 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if delete_running_tasks is not None: - query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + delete_running_tasks=delete_running_tasks, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,6 +311,8 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} # type: ignore + + @distributed_trace_async async def update( self, group_name: str, @@ -362,39 +344,29 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Project') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Project') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Project', pipeline_response) @@ -403,4 +375,6 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} # type: ignore + diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_resource_skus_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_resource_skus_operations.py index a14042c2e597..9fe319e2c9c3 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_resource_skus_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_resource_skus_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resource_skus_operations import build_list_skus_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_skus( self, **kwargs: Any @@ -51,7 +57,8 @@ def list_skus( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.ResourceSkusResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.ResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkusResult"] @@ -59,34 +66,29 @@ def list_skus( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_skus_request( + subscription_id=self._config.subscription_id, + template_url=self.list_skus.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_skus_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceSkusResult', pipeline_response) + deserialized = self._deserialize("ResourceSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -99,12 +101,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_service_tasks_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_service_tasks_operations.py index bfe711b48276..2538a7e2f5fa 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_service_tasks_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_service_tasks_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._service_tasks_operations import build_cancel_request, build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, group_name: str, @@ -71,38 +77,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if task_type is not None: - query_parameters['taskType'] = self._serialize.query("task_type", task_type, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_type=task_type, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_type=task_type, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('TaskList', pipeline_response) + deserialized = self._deserialize("TaskList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,17 +118,19 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks'} # type: ignore + @distributed_trace_async async def create_or_update( self, group_name: str, @@ -159,39 +164,29 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'ProjectTask') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_name=task_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectTask') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -204,8 +199,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'} # type: ignore + + @distributed_trace_async async def get( self, group_name: str, @@ -237,36 +235,25 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_name=task_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -275,8 +262,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'} # type: ignore + + @distributed_trace_async async def delete( self, group_name: str, @@ -308,36 +298,25 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if delete_running_tasks is not None: - query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_name=task_name, + delete_running_tasks=delete_running_tasks, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -345,6 +324,8 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'} # type: ignore + + @distributed_trace_async async def update( self, group_name: str, @@ -377,39 +358,29 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ProjectTask') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_name=task_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectTask') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -418,8 +389,11 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'} # type: ignore + + @distributed_trace_async async def cancel( self, group_name: str, @@ -448,34 +422,24 @@ async def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_name=task_name, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -484,4 +448,6 @@ async def cancel( return cls(pipeline_response, deserialized, {}) return deserialized + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}/cancel'} # type: ignore + diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_services_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_services_operations.py index 04467e7f1a2a..5ad1af5050ed 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_services_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_services_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._services_operations import build_check_children_name_availability_request, build_check_name_availability_request, build_check_status_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_request, build_list_skus_request, build_start_request_initial, build_stop_request_initial, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -55,39 +60,28 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DataMigrationService') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'DataMigrationService') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -100,8 +94,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, group_name: str, @@ -128,15 +125,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.datamigration.models.DataMigrationService :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataMigrationService or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datamigration.models.DataMigrationService] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DataMigrationService or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datamigration.models.DataMigrationService] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DataMigrationService"] lro_delay = kwargs.pop( 'polling_interval', @@ -148,27 +150,21 @@ async def begin_create_or_update( group_name=group_name, service_name=service_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('DataMigrationService', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -180,8 +176,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + @distributed_trace_async async def get( self, group_name: str, @@ -207,33 +205,23 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DataMigrationService', pipeline_response) @@ -242,8 +230,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + async def _delete_initial( self, group_name: str, @@ -256,42 +246,32 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if delete_running_tasks is not None: - query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + delete_running_tasks=delete_running_tasks, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, group_name: str, @@ -312,15 +292,17 @@ async def begin_delete( :type delete_running_tasks: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -335,21 +317,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -361,6 +336,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore async def _update_initial( @@ -375,39 +351,28 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DataMigrationService') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'DataMigrationService') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -417,8 +382,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, group_name: str, @@ -441,15 +409,20 @@ async def begin_update( :type parameters: ~azure.mgmt.datamigration.models.DataMigrationService :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataMigrationService or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datamigration.models.DataMigrationService] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DataMigrationService or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datamigration.models.DataMigrationService] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DataMigrationService"] lro_delay = kwargs.pop( 'polling_interval', @@ -461,27 +434,21 @@ async def begin_update( group_name=group_name, service_name=service_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('DataMigrationService', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -493,8 +460,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + @distributed_trace_async async def check_status( self, group_name: str, @@ -521,33 +490,23 @@ async def check_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.check_status.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_check_status_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self.check_status.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DataMigrationServiceStatusResponse', pipeline_response) @@ -556,8 +515,10 @@ async def check_status( return cls(pipeline_response, deserialized, {}) return deserialized + check_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus'} # type: ignore + async def _start_initial( self, group_name: str, @@ -569,40 +530,31 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, group_name: str, @@ -620,15 +572,17 @@ async def begin_start( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -642,21 +596,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -668,6 +615,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start'} # type: ignore async def _stop_initial( @@ -681,40 +629,31 @@ async def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, group_name: str, @@ -733,15 +672,17 @@ async def begin_stop( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -755,21 +696,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -781,8 +715,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop'} # type: ignore + @distributed_trace def list_skus( self, group_name: str, @@ -800,7 +736,8 @@ def list_skus( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceSkuList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.ServiceSkuList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.ServiceSkuList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceSkuList"] @@ -808,36 +745,33 @@ def list_skus( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_skus_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self.list_skus.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_skus_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ServiceSkuList', pipeline_response) + deserialized = self._deserialize("ServiceSkuList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -850,17 +784,19 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/skus'} # type: ignore + @distributed_trace_async async def check_children_name_availability( self, group_name: str, @@ -888,38 +824,28 @@ async def check_children_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_children_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NameAvailabilityRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_check_children_name_availability_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + content_type=content_type, + json=_json, + template_url=self.check_children_name_availability.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NameAvailabilityRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NameAvailabilityResponse', pipeline_response) @@ -928,8 +854,11 @@ async def check_children_name_availability( return cls(pipeline_response, deserialized, {}) return deserialized + check_children_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability'} # type: ignore + + @distributed_trace def list_by_resource_group( self, group_name: str, @@ -943,8 +872,10 @@ def list_by_resource_group( :param group_name: Name of the resource group. :type group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataMigrationServiceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.DataMigrationServiceList] + :return: An iterator like instance of either DataMigrationServiceList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.DataMigrationServiceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataMigrationServiceList"] @@ -952,35 +883,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('DataMigrationServiceList', pipeline_response) + deserialized = self._deserialize("DataMigrationServiceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -993,17 +920,19 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services'} # type: ignore + @distributed_trace def list( self, **kwargs: Any @@ -1014,8 +943,10 @@ def list( This method returns a list of service resources in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataMigrationServiceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.DataMigrationServiceList] + :return: An iterator like instance of either DataMigrationServiceList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.DataMigrationServiceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataMigrationServiceList"] @@ -1023,34 +954,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('DataMigrationServiceList', pipeline_response) + deserialized = self._deserialize("DataMigrationServiceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1063,17 +989,19 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services'} # type: ignore + @distributed_trace_async async def check_name_availability( self, location: str, @@ -1098,37 +1026,27 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NameAvailabilityRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_check_name_availability_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.check_name_availability.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NameAvailabilityRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NameAvailabilityResponse', pipeline_response) @@ -1137,4 +1055,6 @@ async def check_name_availability( return cls(pipeline_response, deserialized, {}) return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability'} # type: ignore + diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_sql_migration_services_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_sql_migration_services_operations.py new file mode 100644 index 000000000000..b0c63946c3c2 --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_sql_migration_services_operations.py @@ -0,0 +1,879 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._sql_migration_services_operations import build_create_or_update_request_initial, build_delete_node_request, build_delete_request_initial, build_get_request, build_list_auth_keys_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_migrations_request, build_list_monitoring_data_request, build_regenerate_auth_keys_request, build_update_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SqlMigrationServicesOperations: + """SqlMigrationServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.datamigration.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> "_models.SqlMigrationService": + """Retrieve the Database Migration Service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SqlMigrationService, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.SqlMigrationService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.SqlMigrationService", + **kwargs: Any + ) -> "_models.SqlMigrationService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SqlMigrationService') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.SqlMigrationService", + **kwargs: Any + ) -> AsyncLROPoller["_models.SqlMigrationService"]: + """Create or Update Database Migration Service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.SqlMigrationService + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SqlMigrationService or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datamigration.models.SqlMigrationService] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete Database Migration Service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.SqlMigrationServiceUpdate", + **kwargs: Any + ) -> "_models.SqlMigrationService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SqlMigrationServiceUpdate') + + request = build_update_request_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.SqlMigrationServiceUpdate", + **kwargs: Any + ) -> AsyncLROPoller["_models.SqlMigrationService"]: + """Update Database Migration Service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.SqlMigrationServiceUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SqlMigrationService or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datamigration.models.SqlMigrationService] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SqlMigrationListResult"]: + """Retrieve all SQL migration services in the resource group. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlMigrationListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.SqlMigrationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SqlMigrationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices'} # type: ignore + + @distributed_trace_async + async def list_auth_keys( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> "_models.AuthenticationKeys": + """Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthenticationKeys, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.AuthenticationKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthenticationKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_auth_keys_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=self.list_auth_keys.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthenticationKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_auth_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listAuthKeys'} # type: ignore + + + @distributed_trace_async + async def regenerate_auth_keys( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.RegenAuthKeys", + **kwargs: Any + ) -> "_models.RegenAuthKeys": + """Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.RegenAuthKeys + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegenAuthKeys, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.RegenAuthKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegenAuthKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'RegenAuthKeys') + + request = build_regenerate_auth_keys_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self.regenerate_auth_keys.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegenAuthKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + regenerate_auth_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys'} # type: ignore + + + @distributed_trace_async + async def delete_node( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.DeleteNode", + **kwargs: Any + ) -> "_models.DeleteNode": + """Delete the integration runtime node. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.DeleteNode + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeleteNode, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.DeleteNode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeleteNode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DeleteNode') + + request = build_delete_node_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self.delete_node.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeleteNode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + delete_node.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode'} # type: ignore + + + @distributed_trace + def list_migrations( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.DatabaseMigrationListResult"]: + """Retrieve the List of database migrations attached to the service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DatabaseMigrationListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.DatabaseMigrationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_migrations_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=self.list_migrations.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_migrations_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DatabaseMigrationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_migrations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMigrations'} # type: ignore + + @distributed_trace_async + async def list_monitoring_data( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> "_models.IntegrationRuntimeMonitoringData": + """Retrieve the registered Integration Runtime nodes and their monitoring data for a given + Database Migration Service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationRuntimeMonitoringData, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.IntegrationRuntimeMonitoringData + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationRuntimeMonitoringData"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_monitoring_data_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=self.list_monitoring_data.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IntegrationRuntimeMonitoringData', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_monitoring_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMonitoringData'} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.SqlMigrationListResult"]: + """Retrieve all SQL migration services in the subscriptions. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlMigrationListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datamigration.models.SqlMigrationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SqlMigrationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/sqlMigrationServices'} # type: ignore diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_tasks_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_tasks_operations.py index df5a2348ffa3..a0773fd6c84e 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_tasks_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_tasks_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._tasks_operations import build_cancel_request, build_command_request, build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, group_name: str, @@ -73,39 +79,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if task_type is not None: - query_parameters['taskType'] = self._serialize.query("task_type", task_type, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_type=task_type, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_type=task_type, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('TaskList', pipeline_response) + deserialized = self._deserialize("TaskList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,17 +122,19 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks'} # type: ignore + @distributed_trace_async async def create_or_update( self, group_name: str, @@ -164,40 +170,30 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ProjectTask') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectTask') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -210,8 +206,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} # type: ignore + + @distributed_trace_async async def get( self, group_name: str, @@ -246,37 +245,26 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -285,8 +273,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} # type: ignore + + @distributed_trace_async async def delete( self, group_name: str, @@ -321,37 +312,26 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if delete_running_tasks is not None: - query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + delete_running_tasks=delete_running_tasks, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -359,6 +339,8 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} # type: ignore + + @distributed_trace_async async def update( self, group_name: str, @@ -394,40 +376,30 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'ProjectTask') + + request = build_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectTask') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -436,8 +408,11 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} # type: ignore + + @distributed_trace_async async def cancel( self, group_name: str, @@ -469,35 +444,25 @@ async def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -506,8 +471,11 @@ async def cancel( return cls(pipeline_response, deserialized, {}) return deserialized + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel'} # type: ignore + + @distributed_trace_async async def command( self, group_name: str, @@ -542,40 +510,30 @@ async def command( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.command.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'CommandProperties') + + request = build_command_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + content_type=content_type, + json=_json, + template_url=self.command.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'CommandProperties') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CommandProperties', pipeline_response) @@ -584,4 +542,6 @@ async def command( return cls(pipeline_response, deserialized, {}) return deserialized + command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/command'} # type: ignore + diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_usages_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_usages_operations.py index 53c421bb9941..1461b56e06da 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_usages_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/aio/operations/_usages_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._usages_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, location: str, @@ -63,35 +69,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('QuotaList', pipeline_response) + deserialized = self._deserialize("QuotaList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,12 +106,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py index c0f8d87c93ca..8cadd6647c3b 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py @@ -6,570 +6,324 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ApiError - from ._models_py3 import AvailableServiceSku - from ._models_py3 import AvailableServiceSkuCapacity - from ._models_py3 import AvailableServiceSkuSku - from ._models_py3 import AzureActiveDirectoryApp - from ._models_py3 import BackupFileInfo - from ._models_py3 import BackupSetInfo - from ._models_py3 import BlobShare - from ._models_py3 import CheckOCIDriverTaskInput - from ._models_py3 import CheckOCIDriverTaskOutput - from ._models_py3 import CheckOCIDriverTaskProperties - from ._models_py3 import CommandProperties - from ._models_py3 import ConnectToMongoDbTaskProperties - from ._models_py3 import ConnectToSourceMySqlTaskInput - from ._models_py3 import ConnectToSourceMySqlTaskProperties - from ._models_py3 import ConnectToSourceNonSqlTaskOutput - from ._models_py3 import ConnectToSourceOracleSyncTaskInput - from ._models_py3 import ConnectToSourceOracleSyncTaskOutput - from ._models_py3 import ConnectToSourceOracleSyncTaskProperties - from ._models_py3 import ConnectToSourcePostgreSqlSyncTaskInput - from ._models_py3 import ConnectToSourcePostgreSqlSyncTaskOutput - from ._models_py3 import ConnectToSourcePostgreSqlSyncTaskProperties - from ._models_py3 import ConnectToSourceSqlServerSyncTaskProperties - from ._models_py3 import ConnectToSourceSqlServerTaskInput - from ._models_py3 import ConnectToSourceSqlServerTaskOutput - from ._models_py3 import ConnectToSourceSqlServerTaskOutputAgentJobLevel - from ._models_py3 import ConnectToSourceSqlServerTaskOutputDatabaseLevel - from ._models_py3 import ConnectToSourceSqlServerTaskOutputLoginLevel - from ._models_py3 import ConnectToSourceSqlServerTaskOutputTaskLevel - from ._models_py3 import ConnectToSourceSqlServerTaskProperties - from ._models_py3 import ConnectToTargetAzureDbForMySqlTaskInput - from ._models_py3 import ConnectToTargetAzureDbForMySqlTaskOutput - from ._models_py3 import ConnectToTargetAzureDbForMySqlTaskProperties - from ._models_py3 import ConnectToTargetAzureDbForPostgreSqlSyncTaskInput - from ._models_py3 import ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput - from ._models_py3 import ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties - from ._models_py3 import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput - from ._models_py3 import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput - from ._models_py3 import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem - from ._models_py3 import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties - from ._models_py3 import ConnectToTargetSqlDbSyncTaskInput - from ._models_py3 import ConnectToTargetSqlDbSyncTaskProperties - from ._models_py3 import ConnectToTargetSqlDbTaskInput - from ._models_py3 import ConnectToTargetSqlDbTaskOutput - from ._models_py3 import ConnectToTargetSqlDbTaskProperties - from ._models_py3 import ConnectToTargetSqlMISyncTaskInput - from ._models_py3 import ConnectToTargetSqlMISyncTaskOutput - from ._models_py3 import ConnectToTargetSqlMISyncTaskProperties - from ._models_py3 import ConnectToTargetSqlMITaskInput - from ._models_py3 import ConnectToTargetSqlMITaskOutput - from ._models_py3 import ConnectToTargetSqlMITaskProperties - from ._models_py3 import ConnectionInfo - from ._models_py3 import DataIntegrityValidationResult - from ._models_py3 import DataItemMigrationSummaryResult - from ._models_py3 import DataMigrationError - from ._models_py3 import DataMigrationProjectMetadata - from ._models_py3 import DataMigrationService - from ._models_py3 import DataMigrationServiceList - from ._models_py3 import DataMigrationServiceStatusResponse - from ._models_py3 import Database - from ._models_py3 import DatabaseBackupInfo - from ._models_py3 import DatabaseFileInfo - from ._models_py3 import DatabaseFileInput - from ._models_py3 import DatabaseInfo - from ._models_py3 import DatabaseObjectName - from ._models_py3 import DatabaseSummaryResult - from ._models_py3 import DatabaseTable - from ._models_py3 import ExecutionStatistics - from ._models_py3 import FileList - from ._models_py3 import FileShare - from ._models_py3 import FileStorageInfo - from ._models_py3 import GetProjectDetailsNonSqlTaskInput - from ._models_py3 import GetTdeCertificatesSqlTaskInput - from ._models_py3 import GetTdeCertificatesSqlTaskOutput - from ._models_py3 import GetTdeCertificatesSqlTaskProperties - from ._models_py3 import GetUserTablesMySqlTaskInput - from ._models_py3 import GetUserTablesMySqlTaskOutput - from ._models_py3 import GetUserTablesMySqlTaskProperties - from ._models_py3 import GetUserTablesOracleTaskInput - from ._models_py3 import GetUserTablesOracleTaskOutput - from ._models_py3 import GetUserTablesOracleTaskProperties - from ._models_py3 import GetUserTablesPostgreSqlTaskInput - from ._models_py3 import GetUserTablesPostgreSqlTaskOutput - from ._models_py3 import GetUserTablesPostgreSqlTaskProperties - from ._models_py3 import GetUserTablesSqlSyncTaskInput - from ._models_py3 import GetUserTablesSqlSyncTaskOutput - from ._models_py3 import GetUserTablesSqlSyncTaskProperties - from ._models_py3 import GetUserTablesSqlTaskInput - from ._models_py3 import GetUserTablesSqlTaskOutput - from ._models_py3 import GetUserTablesSqlTaskProperties - from ._models_py3 import InstallOCIDriverTaskInput - from ._models_py3 import InstallOCIDriverTaskOutput - from ._models_py3 import InstallOCIDriverTaskProperties - from ._models_py3 import MiSqlConnectionInfo - from ._models_py3 import MigrateMISyncCompleteCommandInput - from ._models_py3 import MigrateMISyncCompleteCommandOutput - from ._models_py3 import MigrateMISyncCompleteCommandProperties - from ._models_py3 import MigrateMongoDbTaskProperties - from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineDatabaseInput - from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskInput - from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskOutput - from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel - from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskOutputError - from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel - from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel - from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskProperties - from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncDatabaseInput - from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskInput - from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutput - from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError - from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel - from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutputError - from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel - from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel - from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskProperties - from ._models_py3 import MigrateOracleAzureDbForPostgreSqlSyncTaskProperties - from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncDatabaseInput - from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskInput - from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutput - from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError - from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel - from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutputError - from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel - from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel - from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput - from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput - from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput - from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput - from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError - from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel - from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError - from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel - from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel - from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties - from ._models_py3 import MigrateSchemaSqlServerSqlDbDatabaseInput - from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskInput - from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskOutput - from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel - from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskOutputError - from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel - from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskProperties - from ._models_py3 import MigrateSchemaSqlTaskOutputError - from ._models_py3 import MigrateSqlServerDatabaseInput - from ._models_py3 import MigrateSqlServerSqlDbDatabaseInput - from ._models_py3 import MigrateSqlServerSqlDbSyncDatabaseInput - from ._models_py3 import MigrateSqlServerSqlDbSyncTaskInput - from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutput - from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutputDatabaseError - from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel - from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutputError - from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel - from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutputTableLevel - from ._models_py3 import MigrateSqlServerSqlDbSyncTaskProperties - from ._models_py3 import MigrateSqlServerSqlDbTaskInput - from ._models_py3 import MigrateSqlServerSqlDbTaskOutput - from ._models_py3 import MigrateSqlServerSqlDbTaskOutputDatabaseLevel - from ._models_py3 import MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult - from ._models_py3 import MigrateSqlServerSqlDbTaskOutputError - from ._models_py3 import MigrateSqlServerSqlDbTaskOutputMigrationLevel - from ._models_py3 import MigrateSqlServerSqlDbTaskOutputTableLevel - from ._models_py3 import MigrateSqlServerSqlDbTaskOutputValidationResult - from ._models_py3 import MigrateSqlServerSqlDbTaskProperties - from ._models_py3 import MigrateSqlServerSqlMIDatabaseInput - from ._models_py3 import MigrateSqlServerSqlMISyncTaskInput - from ._models_py3 import MigrateSqlServerSqlMISyncTaskOutput - from ._models_py3 import MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel - from ._models_py3 import MigrateSqlServerSqlMISyncTaskOutputError - from ._models_py3 import MigrateSqlServerSqlMISyncTaskOutputMigrationLevel - from ._models_py3 import MigrateSqlServerSqlMISyncTaskProperties - from ._models_py3 import MigrateSqlServerSqlMITaskInput - from ._models_py3 import MigrateSqlServerSqlMITaskOutput - from ._models_py3 import MigrateSqlServerSqlMITaskOutputAgentJobLevel - from ._models_py3 import MigrateSqlServerSqlMITaskOutputDatabaseLevel - from ._models_py3 import MigrateSqlServerSqlMITaskOutputError - from ._models_py3 import MigrateSqlServerSqlMITaskOutputLoginLevel - from ._models_py3 import MigrateSqlServerSqlMITaskOutputMigrationLevel - from ._models_py3 import MigrateSqlServerSqlMITaskProperties - from ._models_py3 import MigrateSsisTaskInput - from ._models_py3 import MigrateSsisTaskOutput - from ._models_py3 import MigrateSsisTaskOutputMigrationLevel - from ._models_py3 import MigrateSsisTaskOutputProjectLevel - from ._models_py3 import MigrateSsisTaskProperties - from ._models_py3 import MigrateSyncCompleteCommandInput - from ._models_py3 import MigrateSyncCompleteCommandOutput - from ._models_py3 import MigrateSyncCompleteCommandProperties - from ._models_py3 import MigrationEligibilityInfo - from ._models_py3 import MigrationReportResult - from ._models_py3 import MigrationTableMetadata - from ._models_py3 import MigrationValidationDatabaseLevelResult - from ._models_py3 import MigrationValidationDatabaseSummaryResult - from ._models_py3 import MigrationValidationOptions - from ._models_py3 import MigrationValidationResult - from ._models_py3 import MongoDbCancelCommand - from ._models_py3 import MongoDbClusterInfo - from ._models_py3 import MongoDbCollectionInfo - from ._models_py3 import MongoDbCollectionProgress - from ._models_py3 import MongoDbCollectionSettings - from ._models_py3 import MongoDbCommandInput - from ._models_py3 import MongoDbConnectionInfo - from ._models_py3 import MongoDbDatabaseInfo - from ._models_py3 import MongoDbDatabaseProgress - from ._models_py3 import MongoDbDatabaseSettings - from ._models_py3 import MongoDbError - from ._models_py3 import MongoDbFinishCommand - from ._models_py3 import MongoDbFinishCommandInput - from ._models_py3 import MongoDbMigrationProgress - from ._models_py3 import MongoDbMigrationSettings - from ._models_py3 import MongoDbObjectInfo - from ._models_py3 import MongoDbProgress - from ._models_py3 import MongoDbRestartCommand - from ._models_py3 import MongoDbShardKeyField - from ._models_py3 import MongoDbShardKeyInfo - from ._models_py3 import MongoDbShardKeySetting - from ._models_py3 import MongoDbThrottlingSettings - from ._models_py3 import MySqlConnectionInfo - from ._models_py3 import NameAvailabilityRequest - from ._models_py3 import NameAvailabilityResponse - from ._models_py3 import NonSqlDataMigrationTable - from ._models_py3 import NonSqlDataMigrationTableResult - from ._models_py3 import NonSqlMigrationTaskInput - from ._models_py3 import NonSqlMigrationTaskOutput - from ._models_py3 import ODataError - from ._models_py3 import OracleConnectionInfo - from ._models_py3 import OracleOCIDriverInfo - from ._models_py3 import OrphanedUserInfo - from ._models_py3 import PostgreSqlConnectionInfo - from ._models_py3 import Project - from ._models_py3 import ProjectFile - from ._models_py3 import ProjectFileProperties - from ._models_py3 import ProjectList - from ._models_py3 import ProjectTask - from ._models_py3 import ProjectTaskProperties - from ._models_py3 import QueryAnalysisValidationResult - from ._models_py3 import QueryExecutionResult - from ._models_py3 import Quota - from ._models_py3 import QuotaList - from ._models_py3 import QuotaName - from ._models_py3 import ReportableException - from ._models_py3 import Resource - from ._models_py3 import ResourceSku - from ._models_py3 import ResourceSkuCapabilities - from ._models_py3 import ResourceSkuCapacity - from ._models_py3 import ResourceSkuCosts - from ._models_py3 import ResourceSkuRestrictions - from ._models_py3 import ResourceSkusResult - from ._models_py3 import SchemaComparisonValidationResult - from ._models_py3 import SchemaComparisonValidationResultType - from ._models_py3 import SchemaMigrationSetting - from ._models_py3 import SelectedCertificateInput - from ._models_py3 import ServerProperties - from ._models_py3 import ServiceOperation - from ._models_py3 import ServiceOperationDisplay - from ._models_py3 import ServiceOperationList - from ._models_py3 import ServiceSku - from ._models_py3 import ServiceSkuList - from ._models_py3 import SqlConnectionInfo - from ._models_py3 import SqlMigrationTaskInput - from ._models_py3 import SqlServerSqlMISyncTaskInput - from ._models_py3 import SsisMigrationInfo - from ._models_py3 import StartMigrationScenarioServerRoleResult - from ._models_py3 import SyncMigrationDatabaseErrorEvent - from ._models_py3 import SystemData - from ._models_py3 import TaskList - from ._models_py3 import TrackedResource - from ._models_py3 import UploadOCIDriverTaskInput - from ._models_py3 import UploadOCIDriverTaskOutput - from ._models_py3 import UploadOCIDriverTaskProperties - from ._models_py3 import ValidateMigrationInputSqlServerSqlDbSyncTaskProperties - from ._models_py3 import ValidateMigrationInputSqlServerSqlMISyncTaskInput - from ._models_py3 import ValidateMigrationInputSqlServerSqlMISyncTaskOutput - from ._models_py3 import ValidateMigrationInputSqlServerSqlMISyncTaskProperties - from ._models_py3 import ValidateMigrationInputSqlServerSqlMITaskInput - from ._models_py3 import ValidateMigrationInputSqlServerSqlMITaskOutput - from ._models_py3 import ValidateMigrationInputSqlServerSqlMITaskProperties - from ._models_py3 import ValidateMongoDbTaskProperties - from ._models_py3 import ValidateOracleAzureDbForPostgreSqlSyncTaskProperties - from ._models_py3 import ValidateOracleAzureDbPostgreSqlSyncTaskOutput - from ._models_py3 import ValidateSyncMigrationInputSqlServerTaskInput - from ._models_py3 import ValidateSyncMigrationInputSqlServerTaskOutput - from ._models_py3 import ValidationError - from ._models_py3 import WaitStatistics -except (SyntaxError, ImportError): - from ._models import ApiError # type: ignore - from ._models import AvailableServiceSku # type: ignore - from ._models import AvailableServiceSkuCapacity # type: ignore - from ._models import AvailableServiceSkuSku # type: ignore - from ._models import AzureActiveDirectoryApp # type: ignore - from ._models import BackupFileInfo # type: ignore - from ._models import BackupSetInfo # type: ignore - from ._models import BlobShare # type: ignore - from ._models import CheckOCIDriverTaskInput # type: ignore - from ._models import CheckOCIDriverTaskOutput # type: ignore - from ._models import CheckOCIDriverTaskProperties # type: ignore - from ._models import CommandProperties # type: ignore - from ._models import ConnectToMongoDbTaskProperties # type: ignore - from ._models import ConnectToSourceMySqlTaskInput # type: ignore - from ._models import ConnectToSourceMySqlTaskProperties # type: ignore - from ._models import ConnectToSourceNonSqlTaskOutput # type: ignore - from ._models import ConnectToSourceOracleSyncTaskInput # type: ignore - from ._models import ConnectToSourceOracleSyncTaskOutput # type: ignore - from ._models import ConnectToSourceOracleSyncTaskProperties # type: ignore - from ._models import ConnectToSourcePostgreSqlSyncTaskInput # type: ignore - from ._models import ConnectToSourcePostgreSqlSyncTaskOutput # type: ignore - from ._models import ConnectToSourcePostgreSqlSyncTaskProperties # type: ignore - from ._models import ConnectToSourceSqlServerSyncTaskProperties # type: ignore - from ._models import ConnectToSourceSqlServerTaskInput # type: ignore - from ._models import ConnectToSourceSqlServerTaskOutput # type: ignore - from ._models import ConnectToSourceSqlServerTaskOutputAgentJobLevel # type: ignore - from ._models import ConnectToSourceSqlServerTaskOutputDatabaseLevel # type: ignore - from ._models import ConnectToSourceSqlServerTaskOutputLoginLevel # type: ignore - from ._models import ConnectToSourceSqlServerTaskOutputTaskLevel # type: ignore - from ._models import ConnectToSourceSqlServerTaskProperties # type: ignore - from ._models import ConnectToTargetAzureDbForMySqlTaskInput # type: ignore - from ._models import ConnectToTargetAzureDbForMySqlTaskOutput # type: ignore - from ._models import ConnectToTargetAzureDbForMySqlTaskProperties # type: ignore - from ._models import ConnectToTargetAzureDbForPostgreSqlSyncTaskInput # type: ignore - from ._models import ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput # type: ignore - from ._models import ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties # type: ignore - from ._models import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput # type: ignore - from ._models import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput # type: ignore - from ._models import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem # type: ignore - from ._models import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties # type: ignore - from ._models import ConnectToTargetSqlDbSyncTaskInput # type: ignore - from ._models import ConnectToTargetSqlDbSyncTaskProperties # type: ignore - from ._models import ConnectToTargetSqlDbTaskInput # type: ignore - from ._models import ConnectToTargetSqlDbTaskOutput # type: ignore - from ._models import ConnectToTargetSqlDbTaskProperties # type: ignore - from ._models import ConnectToTargetSqlMISyncTaskInput # type: ignore - from ._models import ConnectToTargetSqlMISyncTaskOutput # type: ignore - from ._models import ConnectToTargetSqlMISyncTaskProperties # type: ignore - from ._models import ConnectToTargetSqlMITaskInput # type: ignore - from ._models import ConnectToTargetSqlMITaskOutput # type: ignore - from ._models import ConnectToTargetSqlMITaskProperties # type: ignore - from ._models import ConnectionInfo # type: ignore - from ._models import DataIntegrityValidationResult # type: ignore - from ._models import DataItemMigrationSummaryResult # type: ignore - from ._models import DataMigrationError # type: ignore - from ._models import DataMigrationProjectMetadata # type: ignore - from ._models import DataMigrationService # type: ignore - from ._models import DataMigrationServiceList # type: ignore - from ._models import DataMigrationServiceStatusResponse # type: ignore - from ._models import Database # type: ignore - from ._models import DatabaseBackupInfo # type: ignore - from ._models import DatabaseFileInfo # type: ignore - from ._models import DatabaseFileInput # type: ignore - from ._models import DatabaseInfo # type: ignore - from ._models import DatabaseObjectName # type: ignore - from ._models import DatabaseSummaryResult # type: ignore - from ._models import DatabaseTable # type: ignore - from ._models import ExecutionStatistics # type: ignore - from ._models import FileList # type: ignore - from ._models import FileShare # type: ignore - from ._models import FileStorageInfo # type: ignore - from ._models import GetProjectDetailsNonSqlTaskInput # type: ignore - from ._models import GetTdeCertificatesSqlTaskInput # type: ignore - from ._models import GetTdeCertificatesSqlTaskOutput # type: ignore - from ._models import GetTdeCertificatesSqlTaskProperties # type: ignore - from ._models import GetUserTablesMySqlTaskInput # type: ignore - from ._models import GetUserTablesMySqlTaskOutput # type: ignore - from ._models import GetUserTablesMySqlTaskProperties # type: ignore - from ._models import GetUserTablesOracleTaskInput # type: ignore - from ._models import GetUserTablesOracleTaskOutput # type: ignore - from ._models import GetUserTablesOracleTaskProperties # type: ignore - from ._models import GetUserTablesPostgreSqlTaskInput # type: ignore - from ._models import GetUserTablesPostgreSqlTaskOutput # type: ignore - from ._models import GetUserTablesPostgreSqlTaskProperties # type: ignore - from ._models import GetUserTablesSqlSyncTaskInput # type: ignore - from ._models import GetUserTablesSqlSyncTaskOutput # type: ignore - from ._models import GetUserTablesSqlSyncTaskProperties # type: ignore - from ._models import GetUserTablesSqlTaskInput # type: ignore - from ._models import GetUserTablesSqlTaskOutput # type: ignore - from ._models import GetUserTablesSqlTaskProperties # type: ignore - from ._models import InstallOCIDriverTaskInput # type: ignore - from ._models import InstallOCIDriverTaskOutput # type: ignore - from ._models import InstallOCIDriverTaskProperties # type: ignore - from ._models import MiSqlConnectionInfo # type: ignore - from ._models import MigrateMISyncCompleteCommandInput # type: ignore - from ._models import MigrateMISyncCompleteCommandOutput # type: ignore - from ._models import MigrateMISyncCompleteCommandProperties # type: ignore - from ._models import MigrateMongoDbTaskProperties # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlOfflineDatabaseInput # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlOfflineTaskInput # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlOfflineTaskOutput # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlOfflineTaskOutputError # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlOfflineTaskProperties # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlSyncDatabaseInput # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlSyncTaskInput # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlSyncTaskOutput # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlSyncTaskOutputError # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel # type: ignore - from ._models import MigrateMySqlAzureDbForMySqlSyncTaskProperties # type: ignore - from ._models import MigrateOracleAzureDbForPostgreSqlSyncTaskProperties # type: ignore - from ._models import MigrateOracleAzureDbPostgreSqlSyncDatabaseInput # type: ignore - from ._models import MigrateOracleAzureDbPostgreSqlSyncTaskInput # type: ignore - from ._models import MigrateOracleAzureDbPostgreSqlSyncTaskOutput # type: ignore - from ._models import MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError # type: ignore - from ._models import MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel # type: ignore - from ._models import MigrateOracleAzureDbPostgreSqlSyncTaskOutputError # type: ignore - from ._models import MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel # type: ignore - from ._models import MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel # type: ignore - from ._models import MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput # type: ignore - from ._models import MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput # type: ignore - from ._models import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput # type: ignore - from ._models import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput # type: ignore - from ._models import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError # type: ignore - from ._models import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel # type: ignore - from ._models import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError # type: ignore - from ._models import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel # type: ignore - from ._models import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel # type: ignore - from ._models import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties # type: ignore - from ._models import MigrateSchemaSqlServerSqlDbDatabaseInput # type: ignore - from ._models import MigrateSchemaSqlServerSqlDbTaskInput # type: ignore - from ._models import MigrateSchemaSqlServerSqlDbTaskOutput # type: ignore - from ._models import MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel # type: ignore - from ._models import MigrateSchemaSqlServerSqlDbTaskOutputError # type: ignore - from ._models import MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel # type: ignore - from ._models import MigrateSchemaSqlServerSqlDbTaskProperties # type: ignore - from ._models import MigrateSchemaSqlTaskOutputError # type: ignore - from ._models import MigrateSqlServerDatabaseInput # type: ignore - from ._models import MigrateSqlServerSqlDbDatabaseInput # type: ignore - from ._models import MigrateSqlServerSqlDbSyncDatabaseInput # type: ignore - from ._models import MigrateSqlServerSqlDbSyncTaskInput # type: ignore - from ._models import MigrateSqlServerSqlDbSyncTaskOutput # type: ignore - from ._models import MigrateSqlServerSqlDbSyncTaskOutputDatabaseError # type: ignore - from ._models import MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel # type: ignore - from ._models import MigrateSqlServerSqlDbSyncTaskOutputError # type: ignore - from ._models import MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel # type: ignore - from ._models import MigrateSqlServerSqlDbSyncTaskOutputTableLevel # type: ignore - from ._models import MigrateSqlServerSqlDbSyncTaskProperties # type: ignore - from ._models import MigrateSqlServerSqlDbTaskInput # type: ignore - from ._models import MigrateSqlServerSqlDbTaskOutput # type: ignore - from ._models import MigrateSqlServerSqlDbTaskOutputDatabaseLevel # type: ignore - from ._models import MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult # type: ignore - from ._models import MigrateSqlServerSqlDbTaskOutputError # type: ignore - from ._models import MigrateSqlServerSqlDbTaskOutputMigrationLevel # type: ignore - from ._models import MigrateSqlServerSqlDbTaskOutputTableLevel # type: ignore - from ._models import MigrateSqlServerSqlDbTaskOutputValidationResult # type: ignore - from ._models import MigrateSqlServerSqlDbTaskProperties # type: ignore - from ._models import MigrateSqlServerSqlMIDatabaseInput # type: ignore - from ._models import MigrateSqlServerSqlMISyncTaskInput # type: ignore - from ._models import MigrateSqlServerSqlMISyncTaskOutput # type: ignore - from ._models import MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel # type: ignore - from ._models import MigrateSqlServerSqlMISyncTaskOutputError # type: ignore - from ._models import MigrateSqlServerSqlMISyncTaskOutputMigrationLevel # type: ignore - from ._models import MigrateSqlServerSqlMISyncTaskProperties # type: ignore - from ._models import MigrateSqlServerSqlMITaskInput # type: ignore - from ._models import MigrateSqlServerSqlMITaskOutput # type: ignore - from ._models import MigrateSqlServerSqlMITaskOutputAgentJobLevel # type: ignore - from ._models import MigrateSqlServerSqlMITaskOutputDatabaseLevel # type: ignore - from ._models import MigrateSqlServerSqlMITaskOutputError # type: ignore - from ._models import MigrateSqlServerSqlMITaskOutputLoginLevel # type: ignore - from ._models import MigrateSqlServerSqlMITaskOutputMigrationLevel # type: ignore - from ._models import MigrateSqlServerSqlMITaskProperties # type: ignore - from ._models import MigrateSsisTaskInput # type: ignore - from ._models import MigrateSsisTaskOutput # type: ignore - from ._models import MigrateSsisTaskOutputMigrationLevel # type: ignore - from ._models import MigrateSsisTaskOutputProjectLevel # type: ignore - from ._models import MigrateSsisTaskProperties # type: ignore - from ._models import MigrateSyncCompleteCommandInput # type: ignore - from ._models import MigrateSyncCompleteCommandOutput # type: ignore - from ._models import MigrateSyncCompleteCommandProperties # type: ignore - from ._models import MigrationEligibilityInfo # type: ignore - from ._models import MigrationReportResult # type: ignore - from ._models import MigrationTableMetadata # type: ignore - from ._models import MigrationValidationDatabaseLevelResult # type: ignore - from ._models import MigrationValidationDatabaseSummaryResult # type: ignore - from ._models import MigrationValidationOptions # type: ignore - from ._models import MigrationValidationResult # type: ignore - from ._models import MongoDbCancelCommand # type: ignore - from ._models import MongoDbClusterInfo # type: ignore - from ._models import MongoDbCollectionInfo # type: ignore - from ._models import MongoDbCollectionProgress # type: ignore - from ._models import MongoDbCollectionSettings # type: ignore - from ._models import MongoDbCommandInput # type: ignore - from ._models import MongoDbConnectionInfo # type: ignore - from ._models import MongoDbDatabaseInfo # type: ignore - from ._models import MongoDbDatabaseProgress # type: ignore - from ._models import MongoDbDatabaseSettings # type: ignore - from ._models import MongoDbError # type: ignore - from ._models import MongoDbFinishCommand # type: ignore - from ._models import MongoDbFinishCommandInput # type: ignore - from ._models import MongoDbMigrationProgress # type: ignore - from ._models import MongoDbMigrationSettings # type: ignore - from ._models import MongoDbObjectInfo # type: ignore - from ._models import MongoDbProgress # type: ignore - from ._models import MongoDbRestartCommand # type: ignore - from ._models import MongoDbShardKeyField # type: ignore - from ._models import MongoDbShardKeyInfo # type: ignore - from ._models import MongoDbShardKeySetting # type: ignore - from ._models import MongoDbThrottlingSettings # type: ignore - from ._models import MySqlConnectionInfo # type: ignore - from ._models import NameAvailabilityRequest # type: ignore - from ._models import NameAvailabilityResponse # type: ignore - from ._models import NonSqlDataMigrationTable # type: ignore - from ._models import NonSqlDataMigrationTableResult # type: ignore - from ._models import NonSqlMigrationTaskInput # type: ignore - from ._models import NonSqlMigrationTaskOutput # type: ignore - from ._models import ODataError # type: ignore - from ._models import OracleConnectionInfo # type: ignore - from ._models import OracleOCIDriverInfo # type: ignore - from ._models import OrphanedUserInfo # type: ignore - from ._models import PostgreSqlConnectionInfo # type: ignore - from ._models import Project # type: ignore - from ._models import ProjectFile # type: ignore - from ._models import ProjectFileProperties # type: ignore - from ._models import ProjectList # type: ignore - from ._models import ProjectTask # type: ignore - from ._models import ProjectTaskProperties # type: ignore - from ._models import QueryAnalysisValidationResult # type: ignore - from ._models import QueryExecutionResult # type: ignore - from ._models import Quota # type: ignore - from ._models import QuotaList # type: ignore - from ._models import QuotaName # type: ignore - from ._models import ReportableException # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceSku # type: ignore - from ._models import ResourceSkuCapabilities # type: ignore - from ._models import ResourceSkuCapacity # type: ignore - from ._models import ResourceSkuCosts # type: ignore - from ._models import ResourceSkuRestrictions # type: ignore - from ._models import ResourceSkusResult # type: ignore - from ._models import SchemaComparisonValidationResult # type: ignore - from ._models import SchemaComparisonValidationResultType # type: ignore - from ._models import SchemaMigrationSetting # type: ignore - from ._models import SelectedCertificateInput # type: ignore - from ._models import ServerProperties # type: ignore - from ._models import ServiceOperation # type: ignore - from ._models import ServiceOperationDisplay # type: ignore - from ._models import ServiceOperationList # type: ignore - from ._models import ServiceSku # type: ignore - from ._models import ServiceSkuList # type: ignore - from ._models import SqlConnectionInfo # type: ignore - from ._models import SqlMigrationTaskInput # type: ignore - from ._models import SqlServerSqlMISyncTaskInput # type: ignore - from ._models import SsisMigrationInfo # type: ignore - from ._models import StartMigrationScenarioServerRoleResult # type: ignore - from ._models import SyncMigrationDatabaseErrorEvent # type: ignore - from ._models import SystemData # type: ignore - from ._models import TaskList # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import UploadOCIDriverTaskInput # type: ignore - from ._models import UploadOCIDriverTaskOutput # type: ignore - from ._models import UploadOCIDriverTaskProperties # type: ignore - from ._models import ValidateMigrationInputSqlServerSqlDbSyncTaskProperties # type: ignore - from ._models import ValidateMigrationInputSqlServerSqlMISyncTaskInput # type: ignore - from ._models import ValidateMigrationInputSqlServerSqlMISyncTaskOutput # type: ignore - from ._models import ValidateMigrationInputSqlServerSqlMISyncTaskProperties # type: ignore - from ._models import ValidateMigrationInputSqlServerSqlMITaskInput # type: ignore - from ._models import ValidateMigrationInputSqlServerSqlMITaskOutput # type: ignore - from ._models import ValidateMigrationInputSqlServerSqlMITaskProperties # type: ignore - from ._models import ValidateMongoDbTaskProperties # type: ignore - from ._models import ValidateOracleAzureDbForPostgreSqlSyncTaskProperties # type: ignore - from ._models import ValidateOracleAzureDbPostgreSqlSyncTaskOutput # type: ignore - from ._models import ValidateSyncMigrationInputSqlServerTaskInput # type: ignore - from ._models import ValidateSyncMigrationInputSqlServerTaskOutput # type: ignore - from ._models import ValidationError # type: ignore - from ._models import WaitStatistics # type: ignore +from ._models_py3 import ApiError +from ._models_py3 import AuthenticationKeys +from ._models_py3 import AvailableServiceSku +from ._models_py3 import AvailableServiceSkuCapacity +from ._models_py3 import AvailableServiceSkuSku +from ._models_py3 import AzureActiveDirectoryApp +from ._models_py3 import AzureBlob +from ._models_py3 import BackupConfiguration +from ._models_py3 import BackupFileInfo +from ._models_py3 import BackupSetInfo +from ._models_py3 import BlobShare +from ._models_py3 import CheckOCIDriverTaskInput +from ._models_py3 import CheckOCIDriverTaskOutput +from ._models_py3 import CheckOCIDriverTaskProperties +from ._models_py3 import CommandProperties +from ._models_py3 import ConnectToMongoDbTaskProperties +from ._models_py3 import ConnectToSourceMySqlTaskInput +from ._models_py3 import ConnectToSourceMySqlTaskProperties +from ._models_py3 import ConnectToSourceNonSqlTaskOutput +from ._models_py3 import ConnectToSourceOracleSyncTaskInput +from ._models_py3 import ConnectToSourceOracleSyncTaskOutput +from ._models_py3 import ConnectToSourceOracleSyncTaskProperties +from ._models_py3 import ConnectToSourcePostgreSqlSyncTaskInput +from ._models_py3 import ConnectToSourcePostgreSqlSyncTaskOutput +from ._models_py3 import ConnectToSourcePostgreSqlSyncTaskProperties +from ._models_py3 import ConnectToSourceSqlServerSyncTaskProperties +from ._models_py3 import ConnectToSourceSqlServerTaskInput +from ._models_py3 import ConnectToSourceSqlServerTaskOutput +from ._models_py3 import ConnectToSourceSqlServerTaskOutputAgentJobLevel +from ._models_py3 import ConnectToSourceSqlServerTaskOutputDatabaseLevel +from ._models_py3 import ConnectToSourceSqlServerTaskOutputLoginLevel +from ._models_py3 import ConnectToSourceSqlServerTaskOutputTaskLevel +from ._models_py3 import ConnectToSourceSqlServerTaskProperties +from ._models_py3 import ConnectToTargetAzureDbForMySqlTaskInput +from ._models_py3 import ConnectToTargetAzureDbForMySqlTaskOutput +from ._models_py3 import ConnectToTargetAzureDbForMySqlTaskProperties +from ._models_py3 import ConnectToTargetAzureDbForPostgreSqlSyncTaskInput +from ._models_py3 import ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput +from ._models_py3 import ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties +from ._models_py3 import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput +from ._models_py3 import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput +from ._models_py3 import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem +from ._models_py3 import ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties +from ._models_py3 import ConnectToTargetSqlDbSyncTaskInput +from ._models_py3 import ConnectToTargetSqlDbSyncTaskProperties +from ._models_py3 import ConnectToTargetSqlDbTaskInput +from ._models_py3 import ConnectToTargetSqlDbTaskOutput +from ._models_py3 import ConnectToTargetSqlDbTaskProperties +from ._models_py3 import ConnectToTargetSqlMISyncTaskInput +from ._models_py3 import ConnectToTargetSqlMISyncTaskOutput +from ._models_py3 import ConnectToTargetSqlMISyncTaskProperties +from ._models_py3 import ConnectToTargetSqlMITaskInput +from ._models_py3 import ConnectToTargetSqlMITaskOutput +from ._models_py3 import ConnectToTargetSqlMITaskProperties +from ._models_py3 import ConnectionInfo +from ._models_py3 import CopyProgressDetails +from ._models_py3 import DataIntegrityValidationResult +from ._models_py3 import DataItemMigrationSummaryResult +from ._models_py3 import DataMigrationError +from ._models_py3 import DataMigrationProjectMetadata +from ._models_py3 import DataMigrationService +from ._models_py3 import DataMigrationServiceList +from ._models_py3 import DataMigrationServiceStatusResponse +from ._models_py3 import Database +from ._models_py3 import DatabaseBackupInfo +from ._models_py3 import DatabaseFileInfo +from ._models_py3 import DatabaseFileInput +from ._models_py3 import DatabaseInfo +from ._models_py3 import DatabaseMigration +from ._models_py3 import DatabaseMigrationListResult +from ._models_py3 import DatabaseMigrationProperties +from ._models_py3 import DatabaseMigrationPropertiesSqlDb +from ._models_py3 import DatabaseMigrationPropertiesSqlMi +from ._models_py3 import DatabaseMigrationPropertiesSqlVm +from ._models_py3 import DatabaseMigrationSqlDb +from ._models_py3 import DatabaseMigrationSqlMi +from ._models_py3 import DatabaseMigrationSqlVm +from ._models_py3 import DatabaseObjectName +from ._models_py3 import DatabaseSummaryResult +from ._models_py3 import DatabaseTable +from ._models_py3 import DeleteNode +from ._models_py3 import ErrorInfo +from ._models_py3 import ExecutionStatistics +from ._models_py3 import FileList +from ._models_py3 import FileShare +from ._models_py3 import FileStorageInfo +from ._models_py3 import GetProjectDetailsNonSqlTaskInput +from ._models_py3 import GetTdeCertificatesSqlTaskInput +from ._models_py3 import GetTdeCertificatesSqlTaskOutput +from ._models_py3 import GetTdeCertificatesSqlTaskProperties +from ._models_py3 import GetUserTablesMySqlTaskInput +from ._models_py3 import GetUserTablesMySqlTaskOutput +from ._models_py3 import GetUserTablesMySqlTaskProperties +from ._models_py3 import GetUserTablesOracleTaskInput +from ._models_py3 import GetUserTablesOracleTaskOutput +from ._models_py3 import GetUserTablesOracleTaskProperties +from ._models_py3 import GetUserTablesPostgreSqlTaskInput +from ._models_py3 import GetUserTablesPostgreSqlTaskOutput +from ._models_py3 import GetUserTablesPostgreSqlTaskProperties +from ._models_py3 import GetUserTablesSqlSyncTaskInput +from ._models_py3 import GetUserTablesSqlSyncTaskOutput +from ._models_py3 import GetUserTablesSqlSyncTaskProperties +from ._models_py3 import GetUserTablesSqlTaskInput +from ._models_py3 import GetUserTablesSqlTaskOutput +from ._models_py3 import GetUserTablesSqlTaskProperties +from ._models_py3 import InstallOCIDriverTaskInput +from ._models_py3 import InstallOCIDriverTaskOutput +from ._models_py3 import InstallOCIDriverTaskProperties +from ._models_py3 import IntegrationRuntimeMonitoringData +from ._models_py3 import MiSqlConnectionInfo +from ._models_py3 import MigrateMISyncCompleteCommandInput +from ._models_py3 import MigrateMISyncCompleteCommandOutput +from ._models_py3 import MigrateMISyncCompleteCommandProperties +from ._models_py3 import MigrateMongoDbTaskProperties +from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineDatabaseInput +from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskInput +from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskOutput +from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel +from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskOutputError +from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel +from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel +from ._models_py3 import MigrateMySqlAzureDbForMySqlOfflineTaskProperties +from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncDatabaseInput +from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskInput +from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutput +from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError +from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel +from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutputError +from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel +from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel +from ._models_py3 import MigrateMySqlAzureDbForMySqlSyncTaskProperties +from ._models_py3 import MigrateOracleAzureDbForPostgreSqlSyncTaskProperties +from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncDatabaseInput +from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskInput +from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutput +from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError +from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel +from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutputError +from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel +from ._models_py3 import MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel +from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput +from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput +from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput +from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError +from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel +from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError +from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel +from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel +from ._models_py3 import MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties +from ._models_py3 import MigrateSchemaSqlServerSqlDbDatabaseInput +from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskInput +from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskOutput +from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel +from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskOutputError +from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel +from ._models_py3 import MigrateSchemaSqlServerSqlDbTaskProperties +from ._models_py3 import MigrateSchemaSqlTaskOutputError +from ._models_py3 import MigrateSqlServerDatabaseInput +from ._models_py3 import MigrateSqlServerSqlDbDatabaseInput +from ._models_py3 import MigrateSqlServerSqlDbSyncDatabaseInput +from ._models_py3 import MigrateSqlServerSqlDbSyncTaskInput +from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutput +from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutputDatabaseError +from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel +from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutputError +from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel +from ._models_py3 import MigrateSqlServerSqlDbSyncTaskOutputTableLevel +from ._models_py3 import MigrateSqlServerSqlDbSyncTaskProperties +from ._models_py3 import MigrateSqlServerSqlDbTaskInput +from ._models_py3 import MigrateSqlServerSqlDbTaskOutput +from ._models_py3 import MigrateSqlServerSqlDbTaskOutputDatabaseLevel +from ._models_py3 import MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult +from ._models_py3 import MigrateSqlServerSqlDbTaskOutputError +from ._models_py3 import MigrateSqlServerSqlDbTaskOutputMigrationLevel +from ._models_py3 import MigrateSqlServerSqlDbTaskOutputTableLevel +from ._models_py3 import MigrateSqlServerSqlDbTaskOutputValidationResult +from ._models_py3 import MigrateSqlServerSqlDbTaskProperties +from ._models_py3 import MigrateSqlServerSqlMIDatabaseInput +from ._models_py3 import MigrateSqlServerSqlMISyncTaskInput +from ._models_py3 import MigrateSqlServerSqlMISyncTaskOutput +from ._models_py3 import MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel +from ._models_py3 import MigrateSqlServerSqlMISyncTaskOutputError +from ._models_py3 import MigrateSqlServerSqlMISyncTaskOutputMigrationLevel +from ._models_py3 import MigrateSqlServerSqlMISyncTaskProperties +from ._models_py3 import MigrateSqlServerSqlMITaskInput +from ._models_py3 import MigrateSqlServerSqlMITaskOutput +from ._models_py3 import MigrateSqlServerSqlMITaskOutputAgentJobLevel +from ._models_py3 import MigrateSqlServerSqlMITaskOutputDatabaseLevel +from ._models_py3 import MigrateSqlServerSqlMITaskOutputError +from ._models_py3 import MigrateSqlServerSqlMITaskOutputLoginLevel +from ._models_py3 import MigrateSqlServerSqlMITaskOutputMigrationLevel +from ._models_py3 import MigrateSqlServerSqlMITaskProperties +from ._models_py3 import MigrateSsisTaskInput +from ._models_py3 import MigrateSsisTaskOutput +from ._models_py3 import MigrateSsisTaskOutputMigrationLevel +from ._models_py3 import MigrateSsisTaskOutputProjectLevel +from ._models_py3 import MigrateSsisTaskProperties +from ._models_py3 import MigrateSyncCompleteCommandInput +from ._models_py3 import MigrateSyncCompleteCommandOutput +from ._models_py3 import MigrateSyncCompleteCommandProperties +from ._models_py3 import MigrationEligibilityInfo +from ._models_py3 import MigrationOperationInput +from ._models_py3 import MigrationReportResult +from ._models_py3 import MigrationStatusDetails +from ._models_py3 import MigrationTableMetadata +from ._models_py3 import MigrationValidationDatabaseLevelResult +from ._models_py3 import MigrationValidationDatabaseSummaryResult +from ._models_py3 import MigrationValidationOptions +from ._models_py3 import MigrationValidationResult +from ._models_py3 import MongoDbCancelCommand +from ._models_py3 import MongoDbClusterInfo +from ._models_py3 import MongoDbCollectionInfo +from ._models_py3 import MongoDbCollectionProgress +from ._models_py3 import MongoDbCollectionSettings +from ._models_py3 import MongoDbCommandInput +from ._models_py3 import MongoDbConnectionInfo +from ._models_py3 import MongoDbDatabaseInfo +from ._models_py3 import MongoDbDatabaseProgress +from ._models_py3 import MongoDbDatabaseSettings +from ._models_py3 import MongoDbError +from ._models_py3 import MongoDbFinishCommand +from ._models_py3 import MongoDbFinishCommandInput +from ._models_py3 import MongoDbMigrationProgress +from ._models_py3 import MongoDbMigrationSettings +from ._models_py3 import MongoDbObjectInfo +from ._models_py3 import MongoDbProgress +from ._models_py3 import MongoDbRestartCommand +from ._models_py3 import MongoDbShardKeyField +from ._models_py3 import MongoDbShardKeyInfo +from ._models_py3 import MongoDbShardKeySetting +from ._models_py3 import MongoDbThrottlingSettings +from ._models_py3 import MySqlConnectionInfo +from ._models_py3 import NameAvailabilityRequest +from ._models_py3 import NameAvailabilityResponse +from ._models_py3 import NodeMonitoringData +from ._models_py3 import NonSqlDataMigrationTable +from ._models_py3 import NonSqlDataMigrationTableResult +from ._models_py3 import NonSqlMigrationTaskInput +from ._models_py3 import NonSqlMigrationTaskOutput +from ._models_py3 import ODataError +from ._models_py3 import OfflineConfiguration +from ._models_py3 import OperationListResult +from ._models_py3 import OperationsDefinition +from ._models_py3 import OperationsDisplayDefinition +from ._models_py3 import OracleConnectionInfo +from ._models_py3 import OracleOCIDriverInfo +from ._models_py3 import OrphanedUserInfo +from ._models_py3 import PostgreSqlConnectionInfo +from ._models_py3 import Project +from ._models_py3 import ProjectFile +from ._models_py3 import ProjectFileProperties +from ._models_py3 import ProjectList +from ._models_py3 import ProjectTask +from ._models_py3 import ProjectTaskProperties +from ._models_py3 import ProxyResource +from ._models_py3 import QueryAnalysisValidationResult +from ._models_py3 import QueryExecutionResult +from ._models_py3 import Quota +from ._models_py3 import QuotaList +from ._models_py3 import QuotaName +from ._models_py3 import RegenAuthKeys +from ._models_py3 import ReportableException +from ._models_py3 import Resource +from ._models_py3 import ResourceSku +from ._models_py3 import ResourceSkuCapabilities +from ._models_py3 import ResourceSkuCapacity +from ._models_py3 import ResourceSkuCosts +from ._models_py3 import ResourceSkuRestrictions +from ._models_py3 import ResourceSkusResult +from ._models_py3 import SchemaComparisonValidationResult +from ._models_py3 import SchemaComparisonValidationResultType +from ._models_py3 import SchemaMigrationSetting +from ._models_py3 import SelectedCertificateInput +from ._models_py3 import ServerProperties +from ._models_py3 import ServiceOperation +from ._models_py3 import ServiceOperationDisplay +from ._models_py3 import ServiceOperationList +from ._models_py3 import ServiceSku +from ._models_py3 import ServiceSkuList +from ._models_py3 import SourceLocation +from ._models_py3 import SqlBackupFileInfo +from ._models_py3 import SqlBackupSetInfo +from ._models_py3 import SqlConnectionInfo +from ._models_py3 import SqlConnectionInformation +from ._models_py3 import SqlDbMigrationStatusDetails +from ._models_py3 import SqlDbOfflineConfiguration +from ._models_py3 import SqlFileShare +from ._models_py3 import SqlMigrationListResult +from ._models_py3 import SqlMigrationService +from ._models_py3 import SqlMigrationServiceUpdate +from ._models_py3 import SqlMigrationTaskInput +from ._models_py3 import SqlServerSqlMISyncTaskInput +from ._models_py3 import SsisMigrationInfo +from ._models_py3 import StartMigrationScenarioServerRoleResult +from ._models_py3 import SyncMigrationDatabaseErrorEvent +from ._models_py3 import SystemData +from ._models_py3 import TargetLocation +from ._models_py3 import TaskList +from ._models_py3 import TrackedResource +from ._models_py3 import UploadOCIDriverTaskInput +from ._models_py3 import UploadOCIDriverTaskOutput +from ._models_py3 import UploadOCIDriverTaskProperties +from ._models_py3 import ValidateMigrationInputSqlServerSqlDbSyncTaskProperties +from ._models_py3 import ValidateMigrationInputSqlServerSqlMISyncTaskInput +from ._models_py3 import ValidateMigrationInputSqlServerSqlMISyncTaskOutput +from ._models_py3 import ValidateMigrationInputSqlServerSqlMISyncTaskProperties +from ._models_py3 import ValidateMigrationInputSqlServerSqlMITaskInput +from ._models_py3 import ValidateMigrationInputSqlServerSqlMITaskOutput +from ._models_py3 import ValidateMigrationInputSqlServerSqlMITaskProperties +from ._models_py3 import ValidateMongoDbTaskProperties +from ._models_py3 import ValidateOracleAzureDbForPostgreSqlSyncTaskProperties +from ._models_py3 import ValidateOracleAzureDbPostgreSqlSyncTaskOutput +from ._models_py3 import ValidateSyncMigrationInputSqlServerTaskInput +from ._models_py3 import ValidateSyncMigrationInputSqlServerTaskOutput +from ._models_py3 import ValidationError +from ._models_py3 import WaitStatistics + from ._data_migration_management_client_enums import ( AuthenticationType, @@ -577,6 +331,7 @@ BackupMode, BackupType, CommandState, + CommandType, CreatedByType, DataMigrationResultCode, DatabaseCompatLevel, @@ -598,6 +353,7 @@ MySqlTargetPlatformType, NameCheckFailureReason, ObjectType, + OperationOrigin, ProjectProvisioningState, ProjectSourcePlatform, ProjectTargetPlatform, @@ -605,6 +361,7 @@ ResourceSkuCapacityScaleType, ResourceSkuRestrictionsReasonCode, ResourceSkuRestrictionsType, + ResourceType, ScenarioSource, ScenarioTarget, SchemaMigrationOption, @@ -620,16 +377,20 @@ SyncDatabaseMigrationReportingState, SyncTableMigrationState, TaskState, + TaskType, UpdateActionType, ValidationStatus, ) __all__ = [ 'ApiError', + 'AuthenticationKeys', 'AvailableServiceSku', 'AvailableServiceSkuCapacity', 'AvailableServiceSkuSku', 'AzureActiveDirectoryApp', + 'AzureBlob', + 'BackupConfiguration', 'BackupFileInfo', 'BackupSetInfo', 'BlobShare', @@ -677,6 +438,7 @@ 'ConnectToTargetSqlMITaskOutput', 'ConnectToTargetSqlMITaskProperties', 'ConnectionInfo', + 'CopyProgressDetails', 'DataIntegrityValidationResult', 'DataItemMigrationSummaryResult', 'DataMigrationError', @@ -689,9 +451,20 @@ 'DatabaseFileInfo', 'DatabaseFileInput', 'DatabaseInfo', + 'DatabaseMigration', + 'DatabaseMigrationListResult', + 'DatabaseMigrationProperties', + 'DatabaseMigrationPropertiesSqlDb', + 'DatabaseMigrationPropertiesSqlMi', + 'DatabaseMigrationPropertiesSqlVm', + 'DatabaseMigrationSqlDb', + 'DatabaseMigrationSqlMi', + 'DatabaseMigrationSqlVm', 'DatabaseObjectName', 'DatabaseSummaryResult', 'DatabaseTable', + 'DeleteNode', + 'ErrorInfo', 'ExecutionStatistics', 'FileList', 'FileShare', @@ -718,6 +491,7 @@ 'InstallOCIDriverTaskInput', 'InstallOCIDriverTaskOutput', 'InstallOCIDriverTaskProperties', + 'IntegrationRuntimeMonitoringData', 'MiSqlConnectionInfo', 'MigrateMISyncCompleteCommandInput', 'MigrateMISyncCompleteCommandOutput', @@ -811,7 +585,9 @@ 'MigrateSyncCompleteCommandOutput', 'MigrateSyncCompleteCommandProperties', 'MigrationEligibilityInfo', + 'MigrationOperationInput', 'MigrationReportResult', + 'MigrationStatusDetails', 'MigrationTableMetadata', 'MigrationValidationDatabaseLevelResult', 'MigrationValidationDatabaseSummaryResult', @@ -842,11 +618,16 @@ 'MySqlConnectionInfo', 'NameAvailabilityRequest', 'NameAvailabilityResponse', + 'NodeMonitoringData', 'NonSqlDataMigrationTable', 'NonSqlDataMigrationTableResult', 'NonSqlMigrationTaskInput', 'NonSqlMigrationTaskOutput', 'ODataError', + 'OfflineConfiguration', + 'OperationListResult', + 'OperationsDefinition', + 'OperationsDisplayDefinition', 'OracleConnectionInfo', 'OracleOCIDriverInfo', 'OrphanedUserInfo', @@ -857,11 +638,13 @@ 'ProjectList', 'ProjectTask', 'ProjectTaskProperties', + 'ProxyResource', 'QueryAnalysisValidationResult', 'QueryExecutionResult', 'Quota', 'QuotaList', 'QuotaName', + 'RegenAuthKeys', 'ReportableException', 'Resource', 'ResourceSku', @@ -880,13 +663,24 @@ 'ServiceOperationList', 'ServiceSku', 'ServiceSkuList', + 'SourceLocation', + 'SqlBackupFileInfo', + 'SqlBackupSetInfo', 'SqlConnectionInfo', + 'SqlConnectionInformation', + 'SqlDbMigrationStatusDetails', + 'SqlDbOfflineConfiguration', + 'SqlFileShare', + 'SqlMigrationListResult', + 'SqlMigrationService', + 'SqlMigrationServiceUpdate', 'SqlMigrationTaskInput', 'SqlServerSqlMISyncTaskInput', 'SsisMigrationInfo', 'StartMigrationScenarioServerRoleResult', 'SyncMigrationDatabaseErrorEvent', 'SystemData', + 'TargetLocation', 'TaskList', 'TrackedResource', 'UploadOCIDriverTaskInput', @@ -911,6 +705,7 @@ 'BackupMode', 'BackupType', 'CommandState', + 'CommandType', 'CreatedByType', 'DataMigrationResultCode', 'DatabaseCompatLevel', @@ -932,6 +727,7 @@ 'MySqlTargetPlatformType', 'NameCheckFailureReason', 'ObjectType', + 'OperationOrigin', 'ProjectProvisioningState', 'ProjectSourcePlatform', 'ProjectTargetPlatform', @@ -939,6 +735,7 @@ 'ResourceSkuCapacityScaleType', 'ResourceSkuRestrictionsReasonCode', 'ResourceSkuRestrictionsType', + 'ResourceType', 'ScenarioSource', 'ScenarioTarget', 'SchemaMigrationOption', @@ -954,6 +751,7 @@ 'SyncDatabaseMigrationReportingState', 'SyncTableMigrationState', 'TaskState', + 'TaskType', 'UpdateActionType', 'ValidationStatus', ] diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_data_migration_management_client_enums.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_data_migration_management_client_enums.py index b3e390d66cab..2fa8bd389250 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_data_migration_management_client_enums.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_data_migration_management_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class AuthenticationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AuthenticationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of possible authentication types when connecting """ @@ -36,7 +21,7 @@ class AuthenticationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ACTIVE_DIRECTORY_INTEGRATED = "ActiveDirectoryIntegrated" ACTIVE_DIRECTORY_PASSWORD = "ActiveDirectoryPassword" -class BackupFileStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class BackupFileStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of Status of the log backup file. """ @@ -48,14 +33,14 @@ class BackupFileStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): RESTORED = "Restored" CANCELLED = "Cancelled" -class BackupMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class BackupMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of backup modes """ CREATE_BACKUP = "CreateBackup" EXISTING_BACKUP = "ExistingBackup" -class BackupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class BackupType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Enum of the different backup types. """ @@ -67,7 +52,7 @@ class BackupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PARTIAL = "Partial" DIFFERENTIAL_PARTIAL = "DifferentialPartial" -class CommandState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CommandState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The state of the command. This is ignored if submitted. """ @@ -77,16 +62,24 @@ class CommandState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SUCCEEDED = "Succeeded" FAILED = "Failed" -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. +class CommandType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Command type. """ + MIGRATE_SYNC_COMPLETE_DATABASE = "Migrate.Sync.Complete.Database" + MIGRATE_SQL_SERVER_AZURE_DB_SQL_MI_COMPLETE = "Migrate.SqlServer.AzureDbSqlMi.Complete" + CANCEL = "cancel" + FINISH = "finish" + RESTART = "restart" + +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class DatabaseCompatLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DatabaseCompatLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of SQL Server database compatibility levels """ @@ -98,7 +91,7 @@ class DatabaseCompatLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): COMPAT_LEVEL130 = "CompatLevel130" COMPAT_LEVEL140 = "CompatLevel140" -class DatabaseFileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DatabaseFileType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of SQL Server database file types """ @@ -108,7 +101,7 @@ class DatabaseFileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NOT_SUPPORTED = "NotSupported" FULLTEXT = "Fulltext" -class DatabaseMigrationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DatabaseMigrationStage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Current stage of migration """ @@ -119,7 +112,7 @@ class DatabaseMigrationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) RESTORE = "Restore" COMPLETED = "Completed" -class DatabaseMigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DatabaseMigrationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Database level migration state. """ @@ -134,7 +127,7 @@ class DatabaseMigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) CANCELLED = "CANCELLED" FAILED = "FAILED" -class DatabaseState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DatabaseState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of SQL Server Database states """ @@ -148,7 +141,7 @@ class DatabaseState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): COPYING = "Copying" OFFLINE_SECONDARY = "OfflineSecondary" -class DataMigrationResultCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DataMigrationResultCode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Result code of the data migration """ @@ -159,7 +152,7 @@ class DataMigrationResultCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum TARGET_OBJECT_IS_INACCESSIBLE = "TargetObjectIsInaccessible" FATAL_ERROR = "FatalError" -class ErrorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ErrorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Error type """ @@ -167,7 +160,7 @@ class ErrorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" ERROR = "Error" -class LoginMigrationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoginMigrationStage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Enum of the different stage of login migration. """ @@ -181,7 +174,7 @@ class LoginMigrationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ESTABLISH_OBJECT_PERMISSIONS = "EstablishObjectPermissions" COMPLETED = "Completed" -class LoginType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoginType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Enum mapping of SMO LoginType. """ @@ -193,7 +186,7 @@ class LoginType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): EXTERNAL_USER = "ExternalUser" EXTERNAL_GROUP = "ExternalGroup" -class MigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MigrationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Current state of migration """ @@ -205,7 +198,7 @@ class MigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SKIPPED = "Skipped" STOPPED = "Stopped" -class MigrationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MigrationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Current status of migration """ @@ -220,7 +213,7 @@ class MigrationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): COMPLETED = "Completed" COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" -class MongoDbClusterType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MongoDbClusterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of data source """ @@ -228,7 +221,7 @@ class MongoDbClusterType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): COSMOS_DB = "CosmosDb" MONGO_DB = "MongoDb" -class MongoDbErrorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MongoDbErrorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of error or warning """ @@ -236,7 +229,7 @@ class MongoDbErrorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VALIDATION_ERROR = "ValidationError" WARNING = "Warning" -class MongoDbMigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MongoDbMigrationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): NOT_STARTED = "NotStarted" VALIDATING_INPUT = "ValidatingInput" @@ -250,7 +243,7 @@ class MongoDbMigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) CANCELED = "Canceled" FAILED = "Failed" -class MongoDbProgressResultType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MongoDbProgressResultType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of progress object """ @@ -258,7 +251,7 @@ class MongoDbProgressResultType(with_metaclass(_CaseInsensitiveEnumMeta, str, En DATABASE = "Database" COLLECTION = "Collection" -class MongoDbReplication(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MongoDbReplication(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes how changes will be replicated from the source to the target. The default is OneTime. """ @@ -266,7 +259,7 @@ class MongoDbReplication(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ONE_TIME = "OneTime" CONTINUOUS = "Continuous" -class MongoDbShardKeyOrder(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MongoDbShardKeyOrder(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The field ordering """ @@ -274,21 +267,21 @@ class MongoDbShardKeyOrder(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REVERSE = "Reverse" HASHED = "Hashed" -class MySqlTargetPlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MySqlTargetPlatformType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of possible target types when migrating from MySQL """ SQL_SERVER = "SqlServer" AZURE_DB_FOR_MY_SQL = "AzureDbForMySQL" -class NameCheckFailureReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NameCheckFailureReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The reason why the name is not available, if nameAvailable is false """ ALREADY_EXISTS = "AlreadyExists" INVALID = "Invalid" -class ObjectType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ObjectType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of type of objects """ @@ -298,14 +291,19 @@ class ObjectType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VIEW = "View" FUNCTION = "Function" -class ProjectProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OperationOrigin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + USER = "user" + SYSTEM = "system" + +class ProjectProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The project's provisioning state """ DELETING = "Deleting" SUCCEEDED = "Succeeded" -class ProjectSourcePlatform(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ProjectSourcePlatform(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Source platform of the project """ @@ -315,7 +313,7 @@ class ProjectSourcePlatform(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) MONGO_DB = "MongoDb" UNKNOWN = "Unknown" -class ProjectTargetPlatform(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ProjectTargetPlatform(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Target platform of the project """ @@ -326,7 +324,7 @@ class ProjectTargetPlatform(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) MONGO_DB = "MongoDb" UNKNOWN = "Unknown" -class ReplicateMigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ReplicateMigrationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Wrapper for replicate reported migration states. """ @@ -337,7 +335,7 @@ class ReplicateMigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum ACTION_REQUIRED = "ACTION_REQUIRED" FAILED = "FAILED" -class ResourceSkuCapacityScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceSkuCapacityScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the SKU. """ @@ -345,20 +343,26 @@ class ResourceSkuCapacityScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, MANUAL = "Manual" NONE = "None" -class ResourceSkuRestrictionsReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceSkuRestrictionsReasonCode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The reason code for restriction. """ QUOTA_ID = "QuotaId" NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" -class ResourceSkuRestrictionsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceSkuRestrictionsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of restrictions. """ LOCATION = "location" -class ScenarioSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + SQL_MI = "SqlMi" + SQL_VM = "SqlVm" + SQL_DB = "SqlDb" + +class ScenarioSource(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of source type """ @@ -374,7 +378,7 @@ class ScenarioSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MY_SQLRDS = "MySQLRDS" POSTGRE_SQLRDS = "PostgreSQLRDS" -class ScenarioTarget(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScenarioTarget(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of target type """ @@ -386,7 +390,7 @@ class ScenarioTarget(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): AZURE_DB_FOR_POSTGRES_SQL = "AzureDBForPostgresSQL" MONGO_DB = "MongoDB" -class SchemaMigrationOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SchemaMigrationOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Option for how schema is extracted and applied to target """ @@ -394,7 +398,7 @@ class SchemaMigrationOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) EXTRACT_FROM_SOURCE = "ExtractFromSource" USE_STORAGE_FILE = "UseStorageFile" -class SchemaMigrationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SchemaMigrationStage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Current stage of schema migration """ @@ -409,7 +413,7 @@ class SchemaMigrationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" FAILED = "Failed" -class ServerLevelPermissionsGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ServerLevelPermissionsGroup(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Permission group for validations. These groups will run a set of permissions for validating user activity. Select the permission group for the activity that you are performing. """ @@ -418,8 +422,9 @@ class ServerLevelPermissionsGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, MIGRATION_FROM_SQL_SERVER_TO_AZURE_DB = "MigrationFromSqlServerToAzureDB" MIGRATION_FROM_SQL_SERVER_TO_AZURE_MI = "MigrationFromSqlServerToAzureMI" MIGRATION_FROM_MY_SQL_TO_AZURE_DB_FOR_MY_SQL = "MigrationFromMySQLToAzureDBForMySQL" + MIGRATION_FROM_SQL_SERVER_TO_AZURE_VM = "MigrationFromSqlServerToAzureVM" -class ServiceProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ServiceProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The resource's provisioning state """ @@ -434,7 +439,7 @@ class ServiceProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enu SUCCEEDED = "Succeeded" FAILED = "Failed" -class ServiceScalability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ServiceScalability(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The scalability approach """ @@ -442,7 +447,7 @@ class ServiceScalability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANUAL = "manual" AUTOMATIC = "automatic" -class Severity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Severity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Severity of the validation error """ @@ -450,13 +455,13 @@ class Severity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" ERROR = "Error" -class SqlSourcePlatform(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SqlSourcePlatform(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of source platform types """ SQL_ON_PREM = "SqlOnPrem" -class SsisMigrationOverwriteOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SsisMigrationOverwriteOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The overwrite option for SSIS object migration, only ignore and overwrite are supported in DMS now and future may add Reuse option for container object """ @@ -464,7 +469,7 @@ class SsisMigrationOverwriteOption(with_metaclass(_CaseInsensitiveEnumMeta, str, IGNORE = "Ignore" OVERWRITE = "Overwrite" -class SsisMigrationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SsisMigrationStage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Current stage of SSIS migration """ @@ -473,13 +478,13 @@ class SsisMigrationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): IN_PROGRESS = "InProgress" COMPLETED = "Completed" -class SsisStoreType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SsisStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """An enumeration of supported source SSIS store type in DMS """ SSIS_CATALOG = "SsisCatalog" -class SyncDatabaseMigrationReportingState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SyncDatabaseMigrationReportingState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Enum of the different state of database level online migration. """ @@ -502,7 +507,7 @@ class SyncDatabaseMigrationReportingState(with_metaclass(_CaseInsensitiveEnumMet BACKUP_IN_PROGRESS = "BACKUP_IN_PROGRESS" BACKUP_COMPLETED = "BACKUP_COMPLETED" -class SyncTableMigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SyncTableMigrationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Enum of the different state of table level online migration. """ @@ -513,7 +518,7 @@ class SyncTableMigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum ERROR = "ERROR" FAILED = "FAILED" -class TaskState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TaskState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The state of the task. This is ignored if submitted. """ @@ -526,7 +531,50 @@ class TaskState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): FAILED_INPUT_VALIDATION = "FailedInputValidation" FAULTED = "Faulted" -class UpdateActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Task type. + """ + + CONNECT_MONGO_DB = "Connect.MongoDb" + CONNECT_TO_SOURCE_SQL_SERVER = "ConnectToSource.SqlServer" + CONNECT_TO_SOURCE_SQL_SERVER_SYNC = "ConnectToSource.SqlServer.Sync" + CONNECT_TO_SOURCE_POSTGRE_SQL_SYNC = "ConnectToSource.PostgreSql.Sync" + CONNECT_TO_SOURCE_MY_SQL = "ConnectToSource.MySql" + CONNECT_TO_SOURCE_ORACLE_SYNC = "ConnectToSource.Oracle.Sync" + CONNECT_TO_TARGET_SQL_DB = "ConnectToTarget.SqlDb" + CONNECT_TO_TARGET_SQL_DB_SYNC = "ConnectToTarget.SqlDb.Sync" + CONNECT_TO_TARGET_AZURE_DB_FOR_POSTGRE_SQL_SYNC = "ConnectToTarget.AzureDbForPostgreSql.Sync" + CONNECT_TO_TARGET_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + CONNECT_TO_TARGET_AZURE_SQL_DB_MI = "ConnectToTarget.AzureSqlDbMI" + CONNECT_TO_TARGET_AZURE_SQL_DB_MI_SYNC_LRS = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + CONNECT_TO_TARGET_AZURE_DB_FOR_MY_SQL = "ConnectToTarget.AzureDbForMySql" + GET_USER_TABLES_SQL = "GetUserTables.Sql" + GET_USER_TABLES_AZURE_SQL_DB_SYNC = "GetUserTables.AzureSqlDb.Sync" + GET_USER_TABLES_ORACLE = "GetUserTablesOracle" + GET_USER_TABLES_POSTGRE_SQL = "GetUserTablesPostgreSql" + GET_USER_TABLES_MY_SQL = "GetUserTablesMySql" + MIGRATE_MONGO_DB = "Migrate.MongoDb" + MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI = "Migrate.SqlServer.AzureSqlDbMI" + MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + MIGRATE_SQL_SERVER_SQL_DB = "Migrate.SqlServer.SqlDb" + MIGRATE_SQL_SERVER_AZURE_SQL_DB_SYNC = "Migrate.SqlServer.AzureSqlDb.Sync" + MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL_SYNC = "Migrate.MySql.AzureDbForMySql.Sync" + MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL = "Migrate.MySql.AzureDbForMySql" + MIGRATE_POSTGRE_SQL_AZURE_DB_FOR_POSTGRE_SQL_SYNC_V2 = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + MIGRATE_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + VALIDATE_MIGRATION_INPUT_SQL_SERVER_SQL_DB_SYNC = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + VALIDATE_MONGO_DB = "Validate.MongoDb" + VALIDATE_ORACLE_AZURE_DB_POSTGRE_SQL_SYNC = "Validate.Oracle.AzureDbPostgreSql.Sync" + GET_TDE_CERTIFICATES_SQL = "GetTDECertificates.Sql" + MIGRATE_SSIS = "Migrate.Ssis" + SERVICE_CHECK_OCI = "Service.Check.OCI" + SERVICE_UPLOAD_OCI = "Service.Upload.OCI" + SERVICE_INSTALL_OCI = "Service.Install.OCI" + MIGRATE_SCHEMA_SQL_SERVER_SQL_DB = "MigrateSchemaSqlServerSqlDb" + +class UpdateActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of the actual difference for the compared object, while performing schema comparison """ @@ -534,7 +582,7 @@ class UpdateActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): CHANGED_ON_TARGET = "ChangedOnTarget" ADDED_ON_TARGET = "AddedOnTarget" -class ValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Current status of the validation """ diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_models.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_models.py deleted file mode 100644 index bed787077512..000000000000 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_models.py +++ /dev/null @@ -1,13006 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class ApiError(msrest.serialization.Model): - """Error information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param error: Error information in OData format. - :type error: ~azure.mgmt.datamigration.models.ODataError - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.datamigration.models.SystemData - """ - - _validation = { - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ODataError'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(ApiError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - self.system_data = None - - -class AvailableServiceSku(msrest.serialization.Model): - """Describes the available service SKU. - - :param resource_type: The resource type, including the provider namespace. - :type resource_type: str - :param sku: SKU name, tier, etc. - :type sku: ~azure.mgmt.datamigration.models.AvailableServiceSkuSku - :param capacity: A description of the scaling capacities of the SKU. - :type capacity: ~azure.mgmt.datamigration.models.AvailableServiceSkuCapacity - """ - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'AvailableServiceSkuSku'}, - 'capacity': {'key': 'capacity', 'type': 'AvailableServiceSkuCapacity'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableServiceSku, self).__init__(**kwargs) - self.resource_type = kwargs.get('resource_type', None) - self.sku = kwargs.get('sku', None) - self.capacity = kwargs.get('capacity', None) - - -class AvailableServiceSkuCapacity(msrest.serialization.Model): - """A description of the scaling capacities of the SKU. - - :param minimum: The minimum capacity, usually 0 or 1. - :type minimum: int - :param maximum: The maximum capacity. - :type maximum: int - :param default: The default capacity. - :type default: int - :param scale_type: The scalability approach. Possible values include: "none", "manual", - "automatic". - :type scale_type: str or ~azure.mgmt.datamigration.models.ServiceScalability - """ - - _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableServiceSkuCapacity, self).__init__(**kwargs) - self.minimum = kwargs.get('minimum', None) - self.maximum = kwargs.get('maximum', None) - self.default = kwargs.get('default', None) - self.scale_type = kwargs.get('scale_type', None) - - -class AvailableServiceSkuSku(msrest.serialization.Model): - """SKU name, tier, etc. - - :param name: The name of the SKU. - :type name: str - :param family: SKU family. - :type family: str - :param size: SKU size. - :type size: str - :param tier: The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical". - :type tier: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableServiceSkuSku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.family = kwargs.get('family', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class AzureActiveDirectoryApp(msrest.serialization.Model): - """Azure Active Directory Application. - - All required parameters must be populated in order to send to Azure. - - :param application_id: Required. Application ID of the Azure Active Directory Application. - :type application_id: str - :param app_key: Required. Key used to authenticate to the Azure Active Directory Application. - :type app_key: str - :param tenant_id: Required. Tenant id of the customer. - :type tenant_id: str - """ - - _validation = { - 'application_id': {'required': True}, - 'app_key': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'application_id': {'key': 'applicationId', 'type': 'str'}, - 'app_key': {'key': 'appKey', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureActiveDirectoryApp, self).__init__(**kwargs) - self.application_id = kwargs['application_id'] - self.app_key = kwargs['app_key'] - self.tenant_id = kwargs['tenant_id'] - - -class BackupFileInfo(msrest.serialization.Model): - """Information of the backup file. - - :param file_location: Location of the backup file in shared folder. - :type file_location: str - :param family_sequence_number: Sequence number of the backup file in the backup set. - :type family_sequence_number: int - :param status: Status of the backup file during migration. Possible values include: "Arrived", - "Queued", "Uploading", "Uploaded", "Restoring", "Restored", "Cancelled". - :type status: str or ~azure.mgmt.datamigration.models.BackupFileStatus - """ - - _attribute_map = { - 'file_location': {'key': 'fileLocation', 'type': 'str'}, - 'family_sequence_number': {'key': 'familySequenceNumber', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(BackupFileInfo, self).__init__(**kwargs) - self.file_location = kwargs.get('file_location', None) - self.family_sequence_number = kwargs.get('family_sequence_number', None) - self.status = kwargs.get('status', None) - - -class BackupSetInfo(msrest.serialization.Model): - """Information of backup set. - - :param backup_set_id: Id for the set of backup files. - :type backup_set_id: str - :param first_lsn: First log sequence number of the backup file. - :type first_lsn: str - :param last_lsn: Last log sequence number of the backup file. - :type last_lsn: str - :param last_modified_time: Last modified time of the backup file in share location. - :type last_modified_time: ~datetime.datetime - :param backup_type: Enum of the different backup types. Possible values include: "Database", - "TransactionLog", "File", "DifferentialDatabase", "DifferentialFile", "Partial", - "DifferentialPartial". - :type backup_type: str or ~azure.mgmt.datamigration.models.BackupType - :param list_of_backup_files: List of files in the backup set. - :type list_of_backup_files: list[~azure.mgmt.datamigration.models.BackupFileInfo] - :param database_name: Name of the database to which the backup set belongs. - :type database_name: str - :param backup_start_date: Date and time that the backup operation began. - :type backup_start_date: ~datetime.datetime - :param backup_finished_date: Date and time that the backup operation finished. - :type backup_finished_date: ~datetime.datetime - :param is_backup_restored: Whether the backup set is restored or not. - :type is_backup_restored: bool - """ - - _attribute_map = { - 'backup_set_id': {'key': 'backupSetId', 'type': 'str'}, - 'first_lsn': {'key': 'firstLsn', 'type': 'str'}, - 'last_lsn': {'key': 'lastLsn', 'type': 'str'}, - 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, - 'backup_type': {'key': 'backupType', 'type': 'str'}, - 'list_of_backup_files': {'key': 'listOfBackupFiles', 'type': '[BackupFileInfo]'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'backup_start_date': {'key': 'backupStartDate', 'type': 'iso-8601'}, - 'backup_finished_date': {'key': 'backupFinishedDate', 'type': 'iso-8601'}, - 'is_backup_restored': {'key': 'isBackupRestored', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(BackupSetInfo, self).__init__(**kwargs) - self.backup_set_id = kwargs.get('backup_set_id', None) - self.first_lsn = kwargs.get('first_lsn', None) - self.last_lsn = kwargs.get('last_lsn', None) - self.last_modified_time = kwargs.get('last_modified_time', None) - self.backup_type = kwargs.get('backup_type', None) - self.list_of_backup_files = kwargs.get('list_of_backup_files', None) - self.database_name = kwargs.get('database_name', None) - self.backup_start_date = kwargs.get('backup_start_date', None) - self.backup_finished_date = kwargs.get('backup_finished_date', None) - self.is_backup_restored = kwargs.get('is_backup_restored', None) - - -class BlobShare(msrest.serialization.Model): - """Blob container storage information. - - All required parameters must be populated in order to send to Azure. - - :param sas_uri: Required. SAS URI of Azure Storage Account Container. - :type sas_uri: str - """ - - _validation = { - 'sas_uri': {'required': True}, - } - - _attribute_map = { - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(BlobShare, self).__init__(**kwargs) - self.sas_uri = kwargs['sas_uri'] - - -class CheckOCIDriverTaskInput(msrest.serialization.Model): - """Input for the service task to check for OCI drivers. - - :param server_version: Version of the source server to check against. Optional. - :type server_version: str - """ - - _attribute_map = { - 'server_version': {'key': 'serverVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CheckOCIDriverTaskInput, self).__init__(**kwargs) - self.server_version = kwargs.get('server_version', None) - - -class CheckOCIDriverTaskOutput(msrest.serialization.Model): - """Output for the service task to check for OCI drivers. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param installed_driver: Information about the installed driver if found and valid. - :type installed_driver: ~azure.mgmt.datamigration.models.OracleOCIDriverInfo - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'installed_driver': {'key': 'installedDriver', 'type': 'OracleOCIDriverInfo'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(CheckOCIDriverTaskOutput, self).__init__(**kwargs) - self.installed_driver = kwargs.get('installed_driver', None) - self.validation_errors = None - - -class ProjectTaskProperties(msrest.serialization.Model): - """Base class for all types of DMS task properties. If task is not supported by current client, this object is returned. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ConnectToMongoDbTaskProperties, ConnectToSourceMySqlTaskProperties, ConnectToSourceOracleSyncTaskProperties, ConnectToSourcePostgreSqlSyncTaskProperties, ConnectToSourceSqlServerTaskProperties, ConnectToSourceSqlServerSyncTaskProperties, ConnectToTargetAzureDbForMySqlTaskProperties, ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties, ConnectToTargetSqlMITaskProperties, ConnectToTargetSqlMISyncTaskProperties, ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties, ConnectToTargetSqlDbTaskProperties, ConnectToTargetSqlDbSyncTaskProperties, GetTdeCertificatesSqlTaskProperties, GetUserTablesSqlSyncTaskProperties, GetUserTablesSqlTaskProperties, GetUserTablesMySqlTaskProperties, GetUserTablesOracleTaskProperties, GetUserTablesPostgreSqlTaskProperties, MigrateMongoDbTaskProperties, MigrateMySqlAzureDbForMySqlOfflineTaskProperties, MigrateMySqlAzureDbForMySqlSyncTaskProperties, MigrateOracleAzureDbForPostgreSqlSyncTaskProperties, MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties, MigrateSqlServerSqlDbSyncTaskProperties, MigrateSqlServerSqlMITaskProperties, MigrateSqlServerSqlMISyncTaskProperties, MigrateSqlServerSqlDbTaskProperties, MigrateSsisTaskProperties, MigrateSchemaSqlServerSqlDbTaskProperties, CheckOCIDriverTaskProperties, InstallOCIDriverTaskProperties, UploadOCIDriverTaskProperties, ValidateMongoDbTaskProperties, ValidateOracleAzureDbForPostgreSqlSyncTaskProperties, ValidateMigrationInputSqlServerSqlMITaskProperties, ValidateMigrationInputSqlServerSqlMISyncTaskProperties, ValidateMigrationInputSqlServerSqlDbSyncTaskProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - } - - _subtype_map = { - 'task_type': {'Connect.MongoDb': 'ConnectToMongoDbTaskProperties', 'ConnectToSource.MySql': 'ConnectToSourceMySqlTaskProperties', 'ConnectToSource.Oracle.Sync': 'ConnectToSourceOracleSyncTaskProperties', 'ConnectToSource.PostgreSql.Sync': 'ConnectToSourcePostgreSqlSyncTaskProperties', 'ConnectToSource.SqlServer': 'ConnectToSourceSqlServerTaskProperties', 'ConnectToSource.SqlServer.Sync': 'ConnectToSourceSqlServerSyncTaskProperties', 'ConnectToTarget.AzureDbForMySql': 'ConnectToTargetAzureDbForMySqlTaskProperties', 'ConnectToTarget.AzureDbForPostgreSql.Sync': 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties', 'ConnectToTarget.AzureSqlDbMI': 'ConnectToTargetSqlMITaskProperties', 'ConnectToTarget.AzureSqlDbMI.Sync.LRS': 'ConnectToTargetSqlMISyncTaskProperties', 'ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync': 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties', 'ConnectToTarget.SqlDb': 'ConnectToTargetSqlDbTaskProperties', 'ConnectToTarget.SqlDb.Sync': 'ConnectToTargetSqlDbSyncTaskProperties', 'GetTDECertificates.Sql': 'GetTdeCertificatesSqlTaskProperties', 'GetUserTables.AzureSqlDb.Sync': 'GetUserTablesSqlSyncTaskProperties', 'GetUserTables.Sql': 'GetUserTablesSqlTaskProperties', 'GetUserTablesMySql': 'GetUserTablesMySqlTaskProperties', 'GetUserTablesOracle': 'GetUserTablesOracleTaskProperties', 'GetUserTablesPostgreSql': 'GetUserTablesPostgreSqlTaskProperties', 'Migrate.MongoDb': 'MigrateMongoDbTaskProperties', 'Migrate.MySql.AzureDbForMySql': 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties', 'Migrate.MySql.AzureDbForMySql.Sync': 'MigrateMySqlAzureDbForMySqlSyncTaskProperties', 'Migrate.Oracle.AzureDbForPostgreSql.Sync': 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties', 'Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties', 'Migrate.SqlServer.AzureSqlDb.Sync': 'MigrateSqlServerSqlDbSyncTaskProperties', 'Migrate.SqlServer.AzureSqlDbMI': 'MigrateSqlServerSqlMITaskProperties', 'Migrate.SqlServer.AzureSqlDbMI.Sync.LRS': 'MigrateSqlServerSqlMISyncTaskProperties', 'Migrate.SqlServer.SqlDb': 'MigrateSqlServerSqlDbTaskProperties', 'Migrate.Ssis': 'MigrateSsisTaskProperties', 'MigrateSchemaSqlServerSqlDb': 'MigrateSchemaSqlServerSqlDbTaskProperties', 'Service.Check.OCI': 'CheckOCIDriverTaskProperties', 'Service.Install.OCI': 'InstallOCIDriverTaskProperties', 'Service.Upload.OCI': 'UploadOCIDriverTaskProperties', 'Validate.MongoDb': 'ValidateMongoDbTaskProperties', 'Validate.Oracle.AzureDbPostgreSql.Sync': 'ValidateOracleAzureDbForPostgreSqlSyncTaskProperties', 'ValidateMigrationInput.SqlServer.AzureSqlDbMI': 'ValidateMigrationInputSqlServerSqlMITaskProperties', 'ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS': 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties', 'ValidateMigrationInput.SqlServer.SqlDb.Sync': 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties'} - } - - def __init__( - self, - **kwargs - ): - super(ProjectTaskProperties, self).__init__(**kwargs) - self.task_type = None # type: Optional[str] - self.errors = None - self.state = None - self.commands = None - self.client_data = kwargs.get('client_data', None) - - -class CheckOCIDriverTaskProperties(ProjectTaskProperties): - """Properties for the task that checks for OCI drivers. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Input for the service task to check for OCI drivers. - :type input: ~azure.mgmt.datamigration.models.CheckOCIDriverTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.CheckOCIDriverTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'CheckOCIDriverTaskInput'}, - 'output': {'key': 'output', 'type': '[CheckOCIDriverTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(CheckOCIDriverTaskProperties, self).__init__(**kwargs) - self.task_type = 'Service.Check.OCI' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class CommandProperties(msrest.serialization.Model): - """Base class for all types of DMS command properties. If command is not supported by current client, this object is returned. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigrateMISyncCompleteCommandProperties, MigrateSyncCompleteCommandProperties, MongoDbCancelCommand, MongoDbFinishCommand, MongoDbRestartCommand. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the command. This is ignored if submitted. Possible values include: - "Unknown", "Accepted", "Running", "Succeeded", "Failed". - :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - """ - - _validation = { - 'command_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'command_type': {'key': 'commandType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - } - - _subtype_map = { - 'command_type': {'Migrate.SqlServer.AzureDbSqlMi.Complete': 'MigrateMISyncCompleteCommandProperties', 'Migrate.Sync.Complete.Database': 'MigrateSyncCompleteCommandProperties', 'cancel': 'MongoDbCancelCommand', 'finish': 'MongoDbFinishCommand', 'restart': 'MongoDbRestartCommand'} - } - - def __init__( - self, - **kwargs - ): - super(CommandProperties, self).__init__(**kwargs) - self.command_type = None # type: Optional[str] - self.errors = None - self.state = None - - -class ConnectionInfo(msrest.serialization.Model): - """Defines the connection properties of a server. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MiSqlConnectionInfo, MongoDbConnectionInfo, MySqlConnectionInfo, OracleConnectionInfo, PostgreSqlConnectionInfo, SqlConnectionInfo. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'MiSqlConnectionInfo': 'MiSqlConnectionInfo', 'MongoDbConnectionInfo': 'MongoDbConnectionInfo', 'MySqlConnectionInfo': 'MySqlConnectionInfo', 'OracleConnectionInfo': 'OracleConnectionInfo', 'PostgreSqlConnectionInfo': 'PostgreSqlConnectionInfo', 'SqlConnectionInfo': 'SqlConnectionInfo'} - } - - def __init__( - self, - **kwargs - ): - super(ConnectionInfo, self).__init__(**kwargs) - self.type = None # type: Optional[str] - self.user_name = kwargs.get('user_name', None) - self.password = kwargs.get('password', None) - - -class ConnectToMongoDbTaskProperties(ProjectTaskProperties): - """Properties for the task that validates the connection to and provides information about a MongoDB server. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Describes a connection to a MongoDB data source. - :type input: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo - :ivar output: An array containing a single MongoDbClusterInfo object. - :vartype output: list[~azure.mgmt.datamigration.models.MongoDbClusterInfo] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MongoDbConnectionInfo'}, - 'output': {'key': 'output', 'type': '[MongoDbClusterInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToMongoDbTaskProperties, self).__init__(**kwargs) - self.task_type = 'Connect.MongoDb' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToSourceMySqlTaskInput(msrest.serialization.Model): - """Input for the task that validates MySQL database connection. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Information for connecting to MySQL source. - :type source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param target_platform: Target Platform for the migration. Possible values include: - "SqlServer", "AzureDbForMySQL". - :type target_platform: str or ~azure.mgmt.datamigration.models.MySqlTargetPlatformType - :param check_permissions_group: Permission group for validations. Possible values include: - "Default", "MigrationFromSqlServerToAzureDB", "MigrationFromSqlServerToAzureMI", - "MigrationFromMySQLToAzureDBForMySQL". - :type check_permissions_group: str or - ~azure.mgmt.datamigration.models.ServerLevelPermissionsGroup - :param is_offline_migration: Flag for whether or not the migration is offline. - :type is_offline_migration: bool - """ - - _validation = { - 'source_connection_info': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'MySqlConnectionInfo'}, - 'target_platform': {'key': 'targetPlatform', 'type': 'str'}, - 'check_permissions_group': {'key': 'checkPermissionsGroup', 'type': 'str'}, - 'is_offline_migration': {'key': 'isOfflineMigration', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceMySqlTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.target_platform = kwargs.get('target_platform', None) - self.check_permissions_group = kwargs.get('check_permissions_group', None) - self.is_offline_migration = kwargs.get('is_offline_migration', False) - - -class ConnectToSourceMySqlTaskProperties(ProjectTaskProperties): - """Properties for the task that validates MySQL database connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToSourceMySqlTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceNonSqlTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToSourceMySqlTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToSourceNonSqlTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceMySqlTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToSource.MySql' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToSourceNonSqlTaskOutput(msrest.serialization.Model): - """Output for connect to MySQL type source. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar source_server_brand_version: Server brand version. - :vartype source_server_brand_version: str - :ivar server_properties: Server properties. - :vartype server_properties: ~azure.mgmt.datamigration.models.ServerProperties - :ivar databases: List of databases on the server. - :vartype databases: list[str] - :ivar validation_errors: Validation errors associated with the task. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'source_server_brand_version': {'readonly': True}, - 'server_properties': {'readonly': True}, - 'databases': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, - 'server_properties': {'key': 'serverProperties', 'type': 'ServerProperties'}, - 'databases': {'key': 'databases', 'type': '[str]'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceNonSqlTaskOutput, self).__init__(**kwargs) - self.id = None - self.source_server_brand_version = None - self.server_properties = None - self.databases = None - self.validation_errors = None - - -class ConnectToSourceOracleSyncTaskInput(msrest.serialization.Model): - """Input for the task that validates Oracle database connection. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Information for connecting to Oracle source. - :type source_connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo - """ - - _validation = { - 'source_connection_info': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'OracleConnectionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceOracleSyncTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - - -class ConnectToSourceOracleSyncTaskOutput(msrest.serialization.Model): - """Output for the task that validates Oracle database connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar source_server_version: Version of the source server. - :vartype source_server_version: str - :ivar databases: List of schemas on source server. - :vartype databases: list[str] - :ivar source_server_brand_version: Source server brand version. - :vartype source_server_brand_version: str - :ivar validation_errors: Validation errors associated with the task. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'source_server_version': {'readonly': True}, - 'databases': {'readonly': True}, - 'source_server_brand_version': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'databases': {'key': 'databases', 'type': '[str]'}, - 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceOracleSyncTaskOutput, self).__init__(**kwargs) - self.source_server_version = None - self.databases = None - self.source_server_brand_version = None - self.validation_errors = None - - -class ConnectToSourceOracleSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that validates Oracle database connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToSourceOracleSyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceOracleSyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToSourceOracleSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToSourceOracleSyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceOracleSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToSource.Oracle.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToSourcePostgreSqlSyncTaskInput(msrest.serialization.Model): - """Input for the task that validates connection to PostgreSQL and source server requirements. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Connection information for source PostgreSQL server. - :type source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - """ - - _validation = { - 'source_connection_info': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'PostgreSqlConnectionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourcePostgreSqlSyncTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - - -class ConnectToSourcePostgreSqlSyncTaskOutput(msrest.serialization.Model): - """Output for the task that validates connection to PostgreSQL and source server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar source_server_version: Version of the source server. - :vartype source_server_version: str - :ivar databases: List of databases on source server. - :vartype databases: list[str] - :ivar source_server_brand_version: Source server brand version. - :vartype source_server_brand_version: str - :ivar validation_errors: Validation errors associated with the task. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'databases': {'readonly': True}, - 'source_server_brand_version': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'databases': {'key': 'databases', 'type': '[str]'}, - 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourcePostgreSqlSyncTaskOutput, self).__init__(**kwargs) - self.id = None - self.source_server_version = None - self.databases = None - self.source_server_brand_version = None - self.validation_errors = None - - -class ConnectToSourcePostgreSqlSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that validates connection to PostgreSQL server and source server requirements for online migration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToSourcePostgreSqlSyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourcePostgreSqlSyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToSourcePostgreSqlSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToSourcePostgreSqlSyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourcePostgreSqlSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToSource.PostgreSql.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToSourceSqlServerSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that validates connection to SQL Server and source server requirements for online migration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToSourceSqlServerTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToSourceSqlServerTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceSqlServerSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToSource.SqlServer.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToSourceSqlServerTaskInput(msrest.serialization.Model): - """Input for the task that validates connection to SQL Server and also validates source server requirements. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Connection information for Source SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param check_permissions_group: Permission group for validations. Possible values include: - "Default", "MigrationFromSqlServerToAzureDB", "MigrationFromSqlServerToAzureMI", - "MigrationFromMySQLToAzureDBForMySQL". - :type check_permissions_group: str or - ~azure.mgmt.datamigration.models.ServerLevelPermissionsGroup - :param collect_databases: Flag for whether to collect databases from source server. - :type collect_databases: bool - :param collect_logins: Flag for whether to collect logins from source server. - :type collect_logins: bool - :param collect_agent_jobs: Flag for whether to collect agent jobs from source server. - :type collect_agent_jobs: bool - :param collect_tde_certificate_info: Flag for whether to collect TDE Certificate names from - source server. - :type collect_tde_certificate_info: bool - :param validate_ssis_catalog_only: Flag for whether to validate SSIS catalog is reachable on - the source server. - :type validate_ssis_catalog_only: bool - """ - - _validation = { - 'source_connection_info': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'check_permissions_group': {'key': 'checkPermissionsGroup', 'type': 'str'}, - 'collect_databases': {'key': 'collectDatabases', 'type': 'bool'}, - 'collect_logins': {'key': 'collectLogins', 'type': 'bool'}, - 'collect_agent_jobs': {'key': 'collectAgentJobs', 'type': 'bool'}, - 'collect_tde_certificate_info': {'key': 'collectTdeCertificateInfo', 'type': 'bool'}, - 'validate_ssis_catalog_only': {'key': 'validateSsisCatalogOnly', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceSqlServerTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.check_permissions_group = kwargs.get('check_permissions_group', None) - self.collect_databases = kwargs.get('collect_databases', True) - self.collect_logins = kwargs.get('collect_logins', False) - self.collect_agent_jobs = kwargs.get('collect_agent_jobs', False) - self.collect_tde_certificate_info = kwargs.get('collect_tde_certificate_info', False) - self.validate_ssis_catalog_only = kwargs.get('validate_ssis_catalog_only', False) - - -class ConnectToSourceSqlServerTaskOutput(msrest.serialization.Model): - """Output for the task that validates connection to SQL Server and also validates source server requirements. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ConnectToSourceSqlServerTaskOutputAgentJobLevel, ConnectToSourceSqlServerTaskOutputDatabaseLevel, ConnectToSourceSqlServerTaskOutputLoginLevel, ConnectToSourceSqlServerTaskOutputTaskLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Type of result - database level or task level.Constant filled by - server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'AgentJobLevelOutput': 'ConnectToSourceSqlServerTaskOutputAgentJobLevel', 'DatabaseLevelOutput': 'ConnectToSourceSqlServerTaskOutputDatabaseLevel', 'LoginLevelOutput': 'ConnectToSourceSqlServerTaskOutputLoginLevel', 'TaskLevelOutput': 'ConnectToSourceSqlServerTaskOutputTaskLevel'} - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceSqlServerTaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class ConnectToSourceSqlServerTaskOutputAgentJobLevel(ConnectToSourceSqlServerTaskOutput): - """Agent Job level output for the task that validates connection to SQL Server and also validates source server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Type of result - database level or task level.Constant filled by - server. - :type result_type: str - :ivar name: Agent Job name. - :vartype name: str - :ivar job_category: The type of Agent Job. - :vartype job_category: str - :ivar is_enabled: The state of the original Agent Job. - :vartype is_enabled: bool - :ivar job_owner: The owner of the Agent Job. - :vartype job_owner: str - :ivar last_executed_on: UTC Date and time when the Agent Job was last executed. - :vartype last_executed_on: ~datetime.datetime - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - :ivar migration_eligibility: Information about eligibility of agent job for migration. - :vartype migration_eligibility: ~azure.mgmt.datamigration.models.MigrationEligibilityInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'name': {'readonly': True}, - 'job_category': {'readonly': True}, - 'is_enabled': {'readonly': True}, - 'job_owner': {'readonly': True}, - 'last_executed_on': {'readonly': True}, - 'validation_errors': {'readonly': True}, - 'migration_eligibility': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'job_category': {'key': 'jobCategory', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'job_owner': {'key': 'jobOwner', 'type': 'str'}, - 'last_executed_on': {'key': 'lastExecutedOn', 'type': 'iso-8601'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - 'migration_eligibility': {'key': 'migrationEligibility', 'type': 'MigrationEligibilityInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceSqlServerTaskOutputAgentJobLevel, self).__init__(**kwargs) - self.result_type = 'AgentJobLevelOutput' # type: str - self.name = None - self.job_category = None - self.is_enabled = None - self.job_owner = None - self.last_executed_on = None - self.validation_errors = None - self.migration_eligibility = None - - -class ConnectToSourceSqlServerTaskOutputDatabaseLevel(ConnectToSourceSqlServerTaskOutput): - """Database level output for the task that validates connection to SQL Server and also validates source server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Type of result - database level or task level.Constant filled by - server. - :type result_type: str - :ivar name: Database name. - :vartype name: str - :ivar size_mb: Size of the file in megabytes. - :vartype size_mb: float - :ivar database_files: The list of database files. - :vartype database_files: list[~azure.mgmt.datamigration.models.DatabaseFileInfo] - :ivar compatibility_level: SQL Server compatibility level of database. Possible values include: - "CompatLevel80", "CompatLevel90", "CompatLevel100", "CompatLevel110", "CompatLevel120", - "CompatLevel130", "CompatLevel140". - :vartype compatibility_level: str or ~azure.mgmt.datamigration.models.DatabaseCompatLevel - :ivar database_state: State of the database. Possible values include: "Online", "Restoring", - "Recovering", "RecoveryPending", "Suspect", "Emergency", "Offline", "Copying", - "OfflineSecondary". - :vartype database_state: str or ~azure.mgmt.datamigration.models.DatabaseState - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'name': {'readonly': True}, - 'size_mb': {'readonly': True}, - 'database_files': {'readonly': True}, - 'compatibility_level': {'readonly': True}, - 'database_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size_mb': {'key': 'sizeMB', 'type': 'float'}, - 'database_files': {'key': 'databaseFiles', 'type': '[DatabaseFileInfo]'}, - 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'str'}, - 'database_state': {'key': 'databaseState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceSqlServerTaskOutputDatabaseLevel, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelOutput' # type: str - self.name = None - self.size_mb = None - self.database_files = None - self.compatibility_level = None - self.database_state = None - - -class ConnectToSourceSqlServerTaskOutputLoginLevel(ConnectToSourceSqlServerTaskOutput): - """Login level output for the task that validates connection to SQL Server and also validates source server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Type of result - database level or task level.Constant filled by - server. - :type result_type: str - :ivar name: Login name. - :vartype name: str - :ivar login_type: The type of login. Possible values include: "WindowsUser", "WindowsGroup", - "SqlLogin", "Certificate", "AsymmetricKey", "ExternalUser", "ExternalGroup". - :vartype login_type: str or ~azure.mgmt.datamigration.models.LoginType - :ivar default_database: The default database for the login. - :vartype default_database: str - :ivar is_enabled: The state of the login. - :vartype is_enabled: bool - :ivar migration_eligibility: Information about eligibility of login for migration. - :vartype migration_eligibility: ~azure.mgmt.datamigration.models.MigrationEligibilityInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'name': {'readonly': True}, - 'login_type': {'readonly': True}, - 'default_database': {'readonly': True}, - 'is_enabled': {'readonly': True}, - 'migration_eligibility': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'login_type': {'key': 'loginType', 'type': 'str'}, - 'default_database': {'key': 'defaultDatabase', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'migration_eligibility': {'key': 'migrationEligibility', 'type': 'MigrationEligibilityInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceSqlServerTaskOutputLoginLevel, self).__init__(**kwargs) - self.result_type = 'LoginLevelOutput' # type: str - self.name = None - self.login_type = None - self.default_database = None - self.is_enabled = None - self.migration_eligibility = None - - -class ConnectToSourceSqlServerTaskOutputTaskLevel(ConnectToSourceSqlServerTaskOutput): - """Task level output for the task that validates connection to SQL Server and also validates source server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Type of result - database level or task level.Constant filled by - server. - :type result_type: str - :ivar databases: Source databases as a map from database name to database id. - :vartype databases: str - :ivar logins: Source logins as a map from login name to login id. - :vartype logins: str - :ivar agent_jobs: Source agent jobs as a map from agent job name to id. - :vartype agent_jobs: str - :ivar database_tde_certificate_mapping: Mapping from database name to TDE certificate name, if - applicable. - :vartype database_tde_certificate_mapping: str - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server_brand_version: Source server brand version. - :vartype source_server_brand_version: str - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'databases': {'readonly': True}, - 'logins': {'readonly': True}, - 'agent_jobs': {'readonly': True}, - 'database_tde_certificate_mapping': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server_brand_version': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'databases': {'key': 'databases', 'type': 'str'}, - 'logins': {'key': 'logins', 'type': 'str'}, - 'agent_jobs': {'key': 'agentJobs', 'type': 'str'}, - 'database_tde_certificate_mapping': {'key': 'databaseTdeCertificateMapping', 'type': 'str'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceSqlServerTaskOutputTaskLevel, self).__init__(**kwargs) - self.result_type = 'TaskLevelOutput' # type: str - self.databases = None - self.logins = None - self.agent_jobs = None - self.database_tde_certificate_mapping = None - self.source_server_version = None - self.source_server_brand_version = None - self.validation_errors = None - - -class ConnectToSourceSqlServerTaskProperties(ProjectTaskProperties): - """Properties for the task that validates connection to SQL Server and also validates source server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToSourceSqlServerTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToSourceSqlServerTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToSourceSqlServerTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToSource.SqlServer' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToTargetAzureDbForMySqlTaskInput(msrest.serialization.Model): - """Input for the task that validates connection to Azure Database for MySQL and target server requirements. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Connection information for source MySQL server. - :type source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param target_connection_info: Required. Connection information for target Azure Database for - MySQL server. - :type target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param is_offline_migration: Flag for whether or not the migration is offline. - :type is_offline_migration: bool - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'MySqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'MySqlConnectionInfo'}, - 'is_offline_migration': {'key': 'isOfflineMigration', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetAzureDbForMySqlTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.target_connection_info = kwargs['target_connection_info'] - self.is_offline_migration = kwargs.get('is_offline_migration', False) - - -class ConnectToTargetAzureDbForMySqlTaskOutput(msrest.serialization.Model): - """Output for the task that validates connection to Azure Database for MySQL and target server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar server_version: Version of the target server. - :vartype server_version: str - :ivar databases: List of databases on target server. - :vartype databases: list[str] - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - :ivar validation_errors: Validation errors associated with the task. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'server_version': {'readonly': True}, - 'databases': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'server_version': {'key': 'serverVersion', 'type': 'str'}, - 'databases': {'key': 'databases', 'type': '[str]'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetAzureDbForMySqlTaskOutput, self).__init__(**kwargs) - self.id = None - self.server_version = None - self.databases = None - self.target_server_brand_version = None - self.validation_errors = None - - -class ConnectToTargetAzureDbForMySqlTaskProperties(ProjectTaskProperties): - """Properties for the task that validates connection to Azure Database for MySQL and target server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForMySqlTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: - list[~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForMySqlTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToTargetAzureDbForMySqlTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToTargetAzureDbForMySqlTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetAzureDbForMySqlTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToTarget.AzureDbForMySql' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToTargetAzureDbForPostgreSqlSyncTaskInput(msrest.serialization.Model): - """Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Connection information for source PostgreSQL server. - :type source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - :param target_connection_info: Required. Connection information for target Azure Database for - PostgreSQL server. - :type target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'PostgreSqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'PostgreSqlConnectionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetAzureDbForPostgreSqlSyncTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.target_connection_info = kwargs['target_connection_info'] - - -class ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput(msrest.serialization.Model): - """Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar target_server_version: Version of the target server. - :vartype target_server_version: str - :ivar databases: List of databases on target server. - :vartype databases: list[str] - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - :ivar validation_errors: Validation errors associated with the task. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'databases': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'databases': {'key': 'databases', 'type': '[str]'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput, self).__init__(**kwargs) - self.id = None - self.target_server_version = None - self.databases = None - self.target_server_brand_version = None - self.validation_errors = None - - -class ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements for online migration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForPostgreSqlSyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: - list[~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToTargetAzureDbForPostgreSqlSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToTarget.AzureDbForPostgreSql.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(msrest.serialization.Model): - """Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle source. - - All required parameters must be populated in order to send to Azure. - - :param target_connection_info: Required. Connection information for target Azure Database for - PostgreSQL server. - :type target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - """ - - _validation = { - 'target_connection_info': {'required': True}, - } - - _attribute_map = { - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'PostgreSqlConnectionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput, self).__init__(**kwargs) - self.target_connection_info = kwargs['target_connection_info'] - - -class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(msrest.serialization.Model): - """Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements for Oracle source. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar target_server_version: Version of the target server. - :vartype target_server_version: str - :ivar databases: List of databases on target server. - :vartype databases: list[str] - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - :ivar validation_errors: Validation errors associated with the task. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - :param database_schema_map: Mapping of schemas per database. - :type database_schema_map: - list[~azure.mgmt.datamigration.models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem] - """ - - _validation = { - 'target_server_version': {'readonly': True}, - 'databases': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'databases': {'key': 'databases', 'type': '[str]'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - 'database_schema_map': {'key': 'databaseSchemaMap', 'type': '[ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput, self).__init__(**kwargs) - self.target_server_version = None - self.databases = None - self.target_server_brand_version = None - self.validation_errors = None - self.database_schema_map = kwargs.get('database_schema_map', None) - - -class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem(msrest.serialization.Model): - """ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem. - - :param database: - :type database: str - :param schemas: - :type schemas: list[str] - """ - - _attribute_map = { - 'database': {'key': 'database', 'type': 'str'}, - 'schemas': {'key': 'schemas', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem, self).__init__(**kwargs) - self.database = kwargs.get('database', None) - self.schemas = kwargs.get('schemas', None) - - -class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that validates connection to Azure Database For PostgreSQL server and target server requirements for online migration for Oracle source. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: - ~azure.mgmt.datamigration.models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: - list[~azure.mgmt.datamigration.models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToTargetSqlDbSyncTaskInput(msrest.serialization.Model): - """Input for the task that validates connection to Azure SQL DB and target server requirements. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Connection information for source SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Connection information for target SQL DB. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlDbSyncTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.target_connection_info = kwargs['target_connection_info'] - - -class ConnectToTargetSqlDbSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that validates connection to SQL DB and target server requirements for online migration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlDbSyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToTargetSqlDbSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToTargetSqlDbTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlDbSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToTarget.SqlDb.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToTargetSqlDbTaskInput(msrest.serialization.Model): - """Input for the task that validates connection to SQL DB and target server requirements. - - All required parameters must be populated in order to send to Azure. - - :param target_connection_info: Required. Connection information for target SQL DB. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - """ - - _validation = { - 'target_connection_info': {'required': True}, - } - - _attribute_map = { - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlDbTaskInput, self).__init__(**kwargs) - self.target_connection_info = kwargs['target_connection_info'] - - -class ConnectToTargetSqlDbTaskOutput(msrest.serialization.Model): - """Output for the task that validates connection to SQL DB and target server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar databases: Source databases as a map from database name to database id. - :vartype databases: str - :ivar target_server_version: Version of the target server. - :vartype target_server_version: str - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'databases': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'databases': {'key': 'databases', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlDbTaskOutput, self).__init__(**kwargs) - self.id = None - self.databases = None - self.target_server_version = None - self.target_server_brand_version = None - - -class ConnectToTargetSqlDbTaskProperties(ProjectTaskProperties): - """Properties for the task that validates connection to SQL DB and target server requirements. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToTargetSqlDbTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToTargetSqlDbTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlDbTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToTarget.SqlDb' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToTargetSqlMISyncTaskInput(msrest.serialization.Model): - """Input for the task that validates connection to Azure SQL Database Managed Instance online scenario. - - All required parameters must be populated in order to send to Azure. - - :param target_connection_info: Required. Connection information for Azure SQL Database Managed - Instance. - :type target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo - :param azure_app: Required. Azure Active Directory Application the DMS instance will use to - connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage - Account. - :type azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp - """ - - _validation = { - 'target_connection_info': {'required': True}, - 'azure_app': {'required': True}, - } - - _attribute_map = { - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'MiSqlConnectionInfo'}, - 'azure_app': {'key': 'azureApp', 'type': 'AzureActiveDirectoryApp'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlMISyncTaskInput, self).__init__(**kwargs) - self.target_connection_info = kwargs['target_connection_info'] - self.azure_app = kwargs['azure_app'] - - -class ConnectToTargetSqlMISyncTaskOutput(msrest.serialization.Model): - """Output for the task that validates connection to Azure SQL Database Managed Instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'target_server_version': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlMISyncTaskOutput, self).__init__(**kwargs) - self.target_server_version = None - self.target_server_brand_version = None - self.validation_errors = None - - -class ConnectToTargetSqlMISyncTaskProperties(ProjectTaskProperties): - """Properties for the task that validates connection to Azure SQL Database Managed Instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlMISyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlMISyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToTargetSqlMISyncTaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToTargetSqlMISyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlMISyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToTarget.AzureSqlDbMI.Sync.LRS' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ConnectToTargetSqlMITaskInput(msrest.serialization.Model): - """Input for the task that validates connection to Azure SQL Database Managed Instance. - - All required parameters must be populated in order to send to Azure. - - :param target_connection_info: Required. Connection information for target SQL Server. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param collect_logins: Flag for whether to collect logins from target SQL MI server. - :type collect_logins: bool - :param collect_agent_jobs: Flag for whether to collect agent jobs from target SQL MI server. - :type collect_agent_jobs: bool - :param validate_ssis_catalog_only: Flag for whether to validate SSIS catalog is reachable on - the target SQL MI server. - :type validate_ssis_catalog_only: bool - """ - - _validation = { - 'target_connection_info': {'required': True}, - } - - _attribute_map = { - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'collect_logins': {'key': 'collectLogins', 'type': 'bool'}, - 'collect_agent_jobs': {'key': 'collectAgentJobs', 'type': 'bool'}, - 'validate_ssis_catalog_only': {'key': 'validateSsisCatalogOnly', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlMITaskInput, self).__init__(**kwargs) - self.target_connection_info = kwargs['target_connection_info'] - self.collect_logins = kwargs.get('collect_logins', True) - self.collect_agent_jobs = kwargs.get('collect_agent_jobs', True) - self.validate_ssis_catalog_only = kwargs.get('validate_ssis_catalog_only', False) - - -class ConnectToTargetSqlMITaskOutput(msrest.serialization.Model): - """Output for the task that validates connection to Azure SQL Database Managed Instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - :ivar logins: List of logins on the target server. - :vartype logins: list[str] - :ivar agent_jobs: List of agent jobs on the target server. - :vartype agent_jobs: list[str] - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - 'logins': {'readonly': True}, - 'agent_jobs': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - 'logins': {'key': 'logins', 'type': '[str]'}, - 'agent_jobs': {'key': 'agentJobs', 'type': '[str]'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlMITaskOutput, self).__init__(**kwargs) - self.id = None - self.target_server_version = None - self.target_server_brand_version = None - self.logins = None - self.agent_jobs = None - self.validation_errors = None - - -class ConnectToTargetSqlMITaskProperties(ProjectTaskProperties): - """Properties for the task that validates connection to Azure SQL Database Managed Instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlMITaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlMITaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ConnectToTargetSqlMITaskInput'}, - 'output': {'key': 'output', 'type': '[ConnectToTargetSqlMITaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectToTargetSqlMITaskProperties, self).__init__(**kwargs) - self.task_type = 'ConnectToTarget.AzureSqlDbMI' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class Database(msrest.serialization.Model): - """Information about a single database. - - :param id: Unique identifier for the database. - :type id: str - :param name: Name of the database. - :type name: str - :param compatibility_level: SQL Server compatibility level of database. Possible values - include: "CompatLevel80", "CompatLevel90", "CompatLevel100", "CompatLevel110", - "CompatLevel120", "CompatLevel130", "CompatLevel140". - :type compatibility_level: str or ~azure.mgmt.datamigration.models.DatabaseCompatLevel - :param collation: Collation name of the database. - :type collation: str - :param server_name: Name of the server. - :type server_name: str - :param fqdn: Fully qualified name. - :type fqdn: str - :param install_id: Install id of the database. - :type install_id: str - :param server_version: Version of the server. - :type server_version: str - :param server_edition: Edition of the server. - :type server_edition: str - :param server_level: Product level of the server (RTM, SP, CTP). - :type server_level: str - :param server_default_data_path: Default path of the data files. - :type server_default_data_path: str - :param server_default_log_path: Default path of the log files. - :type server_default_log_path: str - :param server_default_backup_path: Default path of the backup folder. - :type server_default_backup_path: str - :param server_core_count: Number of cores on the server. - :type server_core_count: int - :param server_visible_online_core_count: Number of cores on the server that have VISIBLE ONLINE - status. - :type server_visible_online_core_count: int - :param database_state: State of the database. Possible values include: "Online", "Restoring", - "Recovering", "RecoveryPending", "Suspect", "Emergency", "Offline", "Copying", - "OfflineSecondary". - :type database_state: str or ~azure.mgmt.datamigration.models.DatabaseState - :param server_id: The unique Server Id. - :type server_id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'str'}, - 'collation': {'key': 'collation', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'install_id': {'key': 'installId', 'type': 'str'}, - 'server_version': {'key': 'serverVersion', 'type': 'str'}, - 'server_edition': {'key': 'serverEdition', 'type': 'str'}, - 'server_level': {'key': 'serverLevel', 'type': 'str'}, - 'server_default_data_path': {'key': 'serverDefaultDataPath', 'type': 'str'}, - 'server_default_log_path': {'key': 'serverDefaultLogPath', 'type': 'str'}, - 'server_default_backup_path': {'key': 'serverDefaultBackupPath', 'type': 'str'}, - 'server_core_count': {'key': 'serverCoreCount', 'type': 'int'}, - 'server_visible_online_core_count': {'key': 'serverVisibleOnlineCoreCount', 'type': 'int'}, - 'database_state': {'key': 'databaseState', 'type': 'str'}, - 'server_id': {'key': 'serverId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Database, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.compatibility_level = kwargs.get('compatibility_level', None) - self.collation = kwargs.get('collation', None) - self.server_name = kwargs.get('server_name', None) - self.fqdn = kwargs.get('fqdn', None) - self.install_id = kwargs.get('install_id', None) - self.server_version = kwargs.get('server_version', None) - self.server_edition = kwargs.get('server_edition', None) - self.server_level = kwargs.get('server_level', None) - self.server_default_data_path = kwargs.get('server_default_data_path', None) - self.server_default_log_path = kwargs.get('server_default_log_path', None) - self.server_default_backup_path = kwargs.get('server_default_backup_path', None) - self.server_core_count = kwargs.get('server_core_count', None) - self.server_visible_online_core_count = kwargs.get('server_visible_online_core_count', None) - self.database_state = kwargs.get('database_state', None) - self.server_id = kwargs.get('server_id', None) - - -class DatabaseBackupInfo(msrest.serialization.Model): - """Information about backup files when existing backup mode is used. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar database_name: Database name. - :vartype database_name: str - :ivar backup_type: Backup Type. Possible values include: "Database", "TransactionLog", "File", - "DifferentialDatabase", "DifferentialFile", "Partial", "DifferentialPartial". - :vartype backup_type: str or ~azure.mgmt.datamigration.models.BackupType - :ivar backup_files: The list of backup files for the current database. - :vartype backup_files: list[str] - :ivar position: Position of current database backup in the file. - :vartype position: int - :ivar is_damaged: Database was damaged when backed up, but the backup operation was requested - to continue despite errors. - :vartype is_damaged: bool - :ivar is_compressed: Whether the backup set is compressed. - :vartype is_compressed: bool - :ivar family_count: Number of files in the backup set. - :vartype family_count: int - :ivar backup_finish_date: Date and time when the backup operation finished. - :vartype backup_finish_date: ~datetime.datetime - """ - - _validation = { - 'database_name': {'readonly': True}, - 'backup_type': {'readonly': True}, - 'backup_files': {'readonly': True}, - 'position': {'readonly': True}, - 'is_damaged': {'readonly': True}, - 'is_compressed': {'readonly': True}, - 'family_count': {'readonly': True}, - 'backup_finish_date': {'readonly': True}, - } - - _attribute_map = { - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'backup_type': {'key': 'backupType', 'type': 'str'}, - 'backup_files': {'key': 'backupFiles', 'type': '[str]'}, - 'position': {'key': 'position', 'type': 'int'}, - 'is_damaged': {'key': 'isDamaged', 'type': 'bool'}, - 'is_compressed': {'key': 'isCompressed', 'type': 'bool'}, - 'family_count': {'key': 'familyCount', 'type': 'int'}, - 'backup_finish_date': {'key': 'backupFinishDate', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(DatabaseBackupInfo, self).__init__(**kwargs) - self.database_name = None - self.backup_type = None - self.backup_files = None - self.position = None - self.is_damaged = None - self.is_compressed = None - self.family_count = None - self.backup_finish_date = None - - -class DatabaseFileInfo(msrest.serialization.Model): - """Database file specific information. - - :param database_name: Name of the database. - :type database_name: str - :param id: Unique identifier for database file. - :type id: str - :param logical_name: Logical name of the file. - :type logical_name: str - :param physical_full_name: Operating-system full path of the file. - :type physical_full_name: str - :param restore_full_name: Suggested full path of the file for restoring. - :type restore_full_name: str - :param file_type: Database file type. Possible values include: "Rows", "Log", "Filestream", - "NotSupported", "Fulltext". - :type file_type: str or ~azure.mgmt.datamigration.models.DatabaseFileType - :param size_mb: Size of the file in megabytes. - :type size_mb: float - """ - - _attribute_map = { - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'logical_name': {'key': 'logicalName', 'type': 'str'}, - 'physical_full_name': {'key': 'physicalFullName', 'type': 'str'}, - 'restore_full_name': {'key': 'restoreFullName', 'type': 'str'}, - 'file_type': {'key': 'fileType', 'type': 'str'}, - 'size_mb': {'key': 'sizeMB', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(DatabaseFileInfo, self).__init__(**kwargs) - self.database_name = kwargs.get('database_name', None) - self.id = kwargs.get('id', None) - self.logical_name = kwargs.get('logical_name', None) - self.physical_full_name = kwargs.get('physical_full_name', None) - self.restore_full_name = kwargs.get('restore_full_name', None) - self.file_type = kwargs.get('file_type', None) - self.size_mb = kwargs.get('size_mb', None) - - -class DatabaseFileInput(msrest.serialization.Model): - """Database file specific information for input. - - :param id: Unique identifier for database file. - :type id: str - :param logical_name: Logical name of the file. - :type logical_name: str - :param physical_full_name: Operating-system full path of the file. - :type physical_full_name: str - :param restore_full_name: Suggested full path of the file for restoring. - :type restore_full_name: str - :param file_type: Database file type. Possible values include: "Rows", "Log", "Filestream", - "NotSupported", "Fulltext". - :type file_type: str or ~azure.mgmt.datamigration.models.DatabaseFileType - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'logical_name': {'key': 'logicalName', 'type': 'str'}, - 'physical_full_name': {'key': 'physicalFullName', 'type': 'str'}, - 'restore_full_name': {'key': 'restoreFullName', 'type': 'str'}, - 'file_type': {'key': 'fileType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DatabaseFileInput, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.logical_name = kwargs.get('logical_name', None) - self.physical_full_name = kwargs.get('physical_full_name', None) - self.restore_full_name = kwargs.get('restore_full_name', None) - self.file_type = kwargs.get('file_type', None) - - -class DatabaseInfo(msrest.serialization.Model): - """Project Database Details. - - All required parameters must be populated in order to send to Azure. - - :param source_database_name: Required. Name of the database. - :type source_database_name: str - """ - - _validation = { - 'source_database_name': {'required': True}, - } - - _attribute_map = { - 'source_database_name': {'key': 'sourceDatabaseName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DatabaseInfo, self).__init__(**kwargs) - self.source_database_name = kwargs['source_database_name'] - - -class DatabaseObjectName(msrest.serialization.Model): - """A representation of the name of an object in a database. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar database_name: The unescaped name of the database containing the object. - :vartype database_name: str - :ivar object_name: The unescaped name of the object. - :vartype object_name: str - :ivar schema_name: The unescaped name of the schema containing the object. - :vartype schema_name: str - :param object_type: Type of the object in the database. Possible values include: - "StoredProcedures", "Table", "User", "View", "Function". - :type object_type: str or ~azure.mgmt.datamigration.models.ObjectType - """ - - _validation = { - 'database_name': {'readonly': True}, - 'object_name': {'readonly': True}, - 'schema_name': {'readonly': True}, - } - - _attribute_map = { - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'object_name': {'key': 'objectName', 'type': 'str'}, - 'schema_name': {'key': 'schemaName', 'type': 'str'}, - 'object_type': {'key': 'objectType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DatabaseObjectName, self).__init__(**kwargs) - self.database_name = None - self.object_name = None - self.schema_name = None - self.object_type = kwargs.get('object_type', None) - - -class DataItemMigrationSummaryResult(msrest.serialization.Model): - """Basic summary of a data item migration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the item. - :vartype name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar status_message: Status message. - :vartype status_message: str - :ivar items_count: Number of items. - :vartype items_count: long - :ivar items_completed_count: Number of successfully completed items. - :vartype items_completed_count: long - :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item. - :vartype error_prefix: str - :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the - item. - :vartype result_prefix: str - """ - - _validation = { - 'name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'state': {'readonly': True}, - 'status_message': {'readonly': True}, - 'items_count': {'readonly': True}, - 'items_completed_count': {'readonly': True}, - 'error_prefix': {'readonly': True}, - 'result_prefix': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'state': {'key': 'state', 'type': 'str'}, - 'status_message': {'key': 'statusMessage', 'type': 'str'}, - 'items_count': {'key': 'itemsCount', 'type': 'long'}, - 'items_completed_count': {'key': 'itemsCompletedCount', 'type': 'long'}, - 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, - 'result_prefix': {'key': 'resultPrefix', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataItemMigrationSummaryResult, self).__init__(**kwargs) - self.name = None - self.started_on = None - self.ended_on = None - self.state = None - self.status_message = None - self.items_count = None - self.items_completed_count = None - self.error_prefix = None - self.result_prefix = None - - -class DatabaseSummaryResult(DataItemMigrationSummaryResult): - """Summary of database results in the migration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the item. - :vartype name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar status_message: Status message. - :vartype status_message: str - :ivar items_count: Number of items. - :vartype items_count: long - :ivar items_completed_count: Number of successfully completed items. - :vartype items_completed_count: long - :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item. - :vartype error_prefix: str - :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the - item. - :vartype result_prefix: str - :ivar size_mb: Size of the database in megabytes. - :vartype size_mb: float - """ - - _validation = { - 'name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'state': {'readonly': True}, - 'status_message': {'readonly': True}, - 'items_count': {'readonly': True}, - 'items_completed_count': {'readonly': True}, - 'error_prefix': {'readonly': True}, - 'result_prefix': {'readonly': True}, - 'size_mb': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'state': {'key': 'state', 'type': 'str'}, - 'status_message': {'key': 'statusMessage', 'type': 'str'}, - 'items_count': {'key': 'itemsCount', 'type': 'long'}, - 'items_completed_count': {'key': 'itemsCompletedCount', 'type': 'long'}, - 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, - 'result_prefix': {'key': 'resultPrefix', 'type': 'str'}, - 'size_mb': {'key': 'sizeMB', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(DatabaseSummaryResult, self).__init__(**kwargs) - self.size_mb = None - - -class DatabaseTable(msrest.serialization.Model): - """Table properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar has_rows: Indicates whether table is empty or not. - :vartype has_rows: bool - :ivar name: Schema-qualified name of the table. - :vartype name: str - """ - - _validation = { - 'has_rows': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'has_rows': {'key': 'hasRows', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DatabaseTable, self).__init__(**kwargs) - self.has_rows = None - self.name = None - - -class DataIntegrityValidationResult(msrest.serialization.Model): - """Results for checksum based Data Integrity validation results. - - :param failed_objects: List of failed table names of source and target pair. - :type failed_objects: dict[str, str] - :param validation_errors: List of errors that happened while performing data integrity - validation. - :type validation_errors: ~azure.mgmt.datamigration.models.ValidationError - """ - - _attribute_map = { - 'failed_objects': {'key': 'failedObjects', 'type': '{str}'}, - 'validation_errors': {'key': 'validationErrors', 'type': 'ValidationError'}, - } - - def __init__( - self, - **kwargs - ): - super(DataIntegrityValidationResult, self).__init__(**kwargs) - self.failed_objects = kwargs.get('failed_objects', None) - self.validation_errors = kwargs.get('validation_errors', None) - - -class DataMigrationError(msrest.serialization.Model): - """Migration Task errors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar message: Error description. - :vartype message: str - :param type: Error type. Possible values include: "Default", "Warning", "Error". - :type type: str or ~azure.mgmt.datamigration.models.ErrorType - """ - - _validation = { - 'message': {'readonly': True}, - } - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataMigrationError, self).__init__(**kwargs) - self.message = None - self.type = kwargs.get('type', None) - - -class DataMigrationProjectMetadata(msrest.serialization.Model): - """Common metadata for migration projects. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar source_server_name: Source server name. - :vartype source_server_name: str - :ivar source_server_port: Source server port number. - :vartype source_server_port: str - :ivar source_username: Source username. - :vartype source_username: str - :ivar target_server_name: Target server name. - :vartype target_server_name: str - :ivar target_username: Target username. - :vartype target_username: str - :ivar target_db_name: Target database name. - :vartype target_db_name: str - :ivar target_using_win_auth: Whether target connection is Windows authentication. - :vartype target_using_win_auth: bool - :ivar selected_migration_tables: List of tables selected for migration. - :vartype selected_migration_tables: - list[~azure.mgmt.datamigration.models.MigrationTableMetadata] - """ - - _validation = { - 'source_server_name': {'readonly': True}, - 'source_server_port': {'readonly': True}, - 'source_username': {'readonly': True}, - 'target_server_name': {'readonly': True}, - 'target_username': {'readonly': True}, - 'target_db_name': {'readonly': True}, - 'target_using_win_auth': {'readonly': True}, - 'selected_migration_tables': {'readonly': True}, - } - - _attribute_map = { - 'source_server_name': {'key': 'sourceServerName', 'type': 'str'}, - 'source_server_port': {'key': 'sourceServerPort', 'type': 'str'}, - 'source_username': {'key': 'sourceUsername', 'type': 'str'}, - 'target_server_name': {'key': 'targetServerName', 'type': 'str'}, - 'target_username': {'key': 'targetUsername', 'type': 'str'}, - 'target_db_name': {'key': 'targetDbName', 'type': 'str'}, - 'target_using_win_auth': {'key': 'targetUsingWinAuth', 'type': 'bool'}, - 'selected_migration_tables': {'key': 'selectedMigrationTables', 'type': '[MigrationTableMetadata]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataMigrationProjectMetadata, self).__init__(**kwargs) - self.source_server_name = None - self.source_server_port = None - self.source_username = None - self.target_server_name = None - self.target_username = None - self.target_db_name = None - self.target_using_win_auth = None - self.selected_migration_tables = None - - -class Resource(msrest.serialization.Model): - """ARM resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class TrackedResource(Resource): - """ARM tracked top level resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.datamigration.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - self.system_data = None - - -class DataMigrationService(TrackedResource): - """A Database Migration Service resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.datamigration.models.SystemData - :param etag: HTTP strong entity tag value. Ignored if submitted. - :type etag: str - :param kind: The resource kind. Only 'vm' (the default) is supported. - :type kind: str - :param sku: Service SKU. - :type sku: ~azure.mgmt.datamigration.models.ServiceSku - :ivar provisioning_state: The resource's provisioning state. Possible values include: - "Accepted", "Deleting", "Deploying", "Stopped", "Stopping", "Starting", "FailedToStart", - "FailedToStop", "Succeeded", "Failed". - :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ServiceProvisioningState - :param public_key: The public key of the service, used to encrypt secrets sent to the service. - :type public_key: str - :param virtual_subnet_id: The ID of the Microsoft.Network/virtualNetworks/subnets resource to - which the service should be joined. - :type virtual_subnet_id: str - :param virtual_nic_id: The ID of the Microsoft.Network/networkInterfaces resource which the - service have. - :type virtual_nic_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'ServiceSku'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_key': {'key': 'properties.publicKey', 'type': 'str'}, - 'virtual_subnet_id': {'key': 'properties.virtualSubnetId', 'type': 'str'}, - 'virtual_nic_id': {'key': 'properties.virtualNicId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataMigrationService, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.kind = kwargs.get('kind', None) - self.sku = kwargs.get('sku', None) - self.provisioning_state = None - self.public_key = kwargs.get('public_key', None) - self.virtual_subnet_id = kwargs.get('virtual_subnet_id', None) - self.virtual_nic_id = kwargs.get('virtual_nic_id', None) - - -class DataMigrationServiceList(msrest.serialization.Model): - """OData page of service objects. - - :param value: List of services. - :type value: list[~azure.mgmt.datamigration.models.DataMigrationService] - :param next_link: URL to load the next page of services. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[DataMigrationService]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataMigrationServiceList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class DataMigrationServiceStatusResponse(msrest.serialization.Model): - """Service health status. - - :param agent_version: The DMS instance agent version. - :type agent_version: str - :param status: The machine-readable status, such as 'Initializing', 'Offline', 'Online', - 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or - 'Failed'. - :type status: str - :param vm_size: The services virtual machine size, such as 'Standard_D2_v2'. - :type vm_size: str - :param supported_task_types: The list of supported task types. - :type supported_task_types: list[str] - """ - - _attribute_map = { - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'supported_task_types': {'key': 'supportedTaskTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataMigrationServiceStatusResponse, self).__init__(**kwargs) - self.agent_version = kwargs.get('agent_version', None) - self.status = kwargs.get('status', None) - self.vm_size = kwargs.get('vm_size', None) - self.supported_task_types = kwargs.get('supported_task_types', None) - - -class ExecutionStatistics(msrest.serialization.Model): - """Description about the errors happen while performing migration validation. - - :param execution_count: No. of query executions. - :type execution_count: long - :param cpu_time_ms: CPU Time in millisecond(s) for the query execution. - :type cpu_time_ms: float - :param elapsed_time_ms: Time taken in millisecond(s) for executing the query. - :type elapsed_time_ms: float - :param wait_stats: Dictionary of sql query execution wait types and the respective statistics. - :type wait_stats: dict[str, ~azure.mgmt.datamigration.models.WaitStatistics] - :param has_errors: Indicates whether the query resulted in an error. - :type has_errors: bool - :param sql_errors: List of sql Errors. - :type sql_errors: list[str] - """ - - _attribute_map = { - 'execution_count': {'key': 'executionCount', 'type': 'long'}, - 'cpu_time_ms': {'key': 'cpuTimeMs', 'type': 'float'}, - 'elapsed_time_ms': {'key': 'elapsedTimeMs', 'type': 'float'}, - 'wait_stats': {'key': 'waitStats', 'type': '{WaitStatistics}'}, - 'has_errors': {'key': 'hasErrors', 'type': 'bool'}, - 'sql_errors': {'key': 'sqlErrors', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ExecutionStatistics, self).__init__(**kwargs) - self.execution_count = kwargs.get('execution_count', None) - self.cpu_time_ms = kwargs.get('cpu_time_ms', None) - self.elapsed_time_ms = kwargs.get('elapsed_time_ms', None) - self.wait_stats = kwargs.get('wait_stats', None) - self.has_errors = kwargs.get('has_errors', None) - self.sql_errors = kwargs.get('sql_errors', None) - - -class FileList(msrest.serialization.Model): - """OData page of files. - - :param value: List of files. - :type value: list[~azure.mgmt.datamigration.models.ProjectFile] - :param next_link: URL to load the next page of files. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProjectFile]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FileList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class FileShare(msrest.serialization.Model): - """File share information with Path, Username, and Password. - - All required parameters must be populated in order to send to Azure. - - :param user_name: User name credential to connect to the share location. - :type user_name: str - :param password: Password credential used to connect to the share location. - :type password: str - :param path: Required. The folder path for this share. - :type path: str - """ - - _validation = { - 'path': {'required': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FileShare, self).__init__(**kwargs) - self.user_name = kwargs.get('user_name', None) - self.password = kwargs.get('password', None) - self.path = kwargs['path'] - - -class FileStorageInfo(msrest.serialization.Model): - """File storage information. - - :param uri: A URI that can be used to access the file content. - :type uri: str - :param headers: Dictionary of :code:``. - :type headers: dict[str, str] - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'headers': {'key': 'headers', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(FileStorageInfo, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - self.headers = kwargs.get('headers', None) - - -class GetProjectDetailsNonSqlTaskInput(msrest.serialization.Model): - """Input for the task that reads configuration from project artifacts. - - All required parameters must be populated in order to send to Azure. - - :param project_name: Required. Name of the migration project. - :type project_name: str - :param project_location: Required. A URL that points to the location to access project - artifacts. - :type project_location: str - """ - - _validation = { - 'project_name': {'required': True}, - 'project_location': {'required': True}, - } - - _attribute_map = { - 'project_name': {'key': 'projectName', 'type': 'str'}, - 'project_location': {'key': 'projectLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(GetProjectDetailsNonSqlTaskInput, self).__init__(**kwargs) - self.project_name = kwargs['project_name'] - self.project_location = kwargs['project_location'] - - -class GetTdeCertificatesSqlTaskInput(msrest.serialization.Model): - """Input for the task that gets TDE certificates in Base64 encoded format. - - All required parameters must be populated in order to send to Azure. - - :param connection_info: Required. Connection information for SQL Server. - :type connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param backup_file_share: Required. Backup file share information for file share to be used for - temporarily storing files. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param selected_certificates: Required. List containing certificate names and corresponding - password to use for encrypting the exported certificate. - :type selected_certificates: list[~azure.mgmt.datamigration.models.SelectedCertificateInput] - """ - - _validation = { - 'connection_info': {'required': True}, - 'backup_file_share': {'required': True}, - 'selected_certificates': {'required': True}, - } - - _attribute_map = { - 'connection_info': {'key': 'connectionInfo', 'type': 'SqlConnectionInfo'}, - 'backup_file_share': {'key': 'backupFileShare', 'type': 'FileShare'}, - 'selected_certificates': {'key': 'selectedCertificates', 'type': '[SelectedCertificateInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetTdeCertificatesSqlTaskInput, self).__init__(**kwargs) - self.connection_info = kwargs['connection_info'] - self.backup_file_share = kwargs['backup_file_share'] - self.selected_certificates = kwargs['selected_certificates'] - - -class GetTdeCertificatesSqlTaskOutput(msrest.serialization.Model): - """Output of the task that gets TDE certificates in Base64 encoded format. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base64_encoded_certificates: Mapping from certificate name to base 64 encoded format. - :vartype base64_encoded_certificates: str - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'base64_encoded_certificates': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'base64_encoded_certificates': {'key': 'base64EncodedCertificates', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetTdeCertificatesSqlTaskOutput, self).__init__(**kwargs) - self.base64_encoded_certificates = None - self.validation_errors = None - - -class GetTdeCertificatesSqlTaskProperties(ProjectTaskProperties): - """Properties for the task that gets TDE certificates in Base64 encoded format. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetTdeCertificatesSqlTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.GetTdeCertificatesSqlTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'GetTdeCertificatesSqlTaskInput'}, - 'output': {'key': 'output', 'type': '[GetTdeCertificatesSqlTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetTdeCertificatesSqlTaskProperties, self).__init__(**kwargs) - self.task_type = 'GetTDECertificates.Sql' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class GetUserTablesMySqlTaskInput(msrest.serialization.Model): - """Input for the task that collects user tables for the given list of databases. - - All required parameters must be populated in order to send to Azure. - - :param connection_info: Required. Connection information for SQL Server. - :type connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param selected_databases: Required. List of database names to collect tables for. - :type selected_databases: list[str] - """ - - _validation = { - 'connection_info': {'required': True}, - 'selected_databases': {'required': True}, - } - - _attribute_map = { - 'connection_info': {'key': 'connectionInfo', 'type': 'MySqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesMySqlTaskInput, self).__init__(**kwargs) - self.connection_info = kwargs['connection_info'] - self.selected_databases = kwargs['selected_databases'] - - -class GetUserTablesMySqlTaskOutput(msrest.serialization.Model): - """Output of the task that collects user tables for the given list of databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar databases_to_tables: Mapping from database name to list of tables. - :vartype databases_to_tables: str - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'databases_to_tables': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'databases_to_tables': {'key': 'databasesToTables', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesMySqlTaskOutput, self).__init__(**kwargs) - self.id = None - self.databases_to_tables = None - self.validation_errors = None - - -class GetUserTablesMySqlTaskProperties(ProjectTaskProperties): - """Properties for the task that collects user tables for the given list of databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetUserTablesMySqlTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesMySqlTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'GetUserTablesMySqlTaskInput'}, - 'output': {'key': 'output', 'type': '[GetUserTablesMySqlTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesMySqlTaskProperties, self).__init__(**kwargs) - self.task_type = 'GetUserTablesMySql' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class GetUserTablesOracleTaskInput(msrest.serialization.Model): - """Input for the task that gets the list of tables contained within a provided list of Oracle schemas. - - All required parameters must be populated in order to send to Azure. - - :param connection_info: Required. Information for connecting to Oracle source. - :type connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo - :param selected_schemas: Required. List of Oracle schemas for which to collect tables. - :type selected_schemas: list[str] - """ - - _validation = { - 'connection_info': {'required': True}, - 'selected_schemas': {'required': True}, - } - - _attribute_map = { - 'connection_info': {'key': 'connectionInfo', 'type': 'OracleConnectionInfo'}, - 'selected_schemas': {'key': 'selectedSchemas', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesOracleTaskInput, self).__init__(**kwargs) - self.connection_info = kwargs['connection_info'] - self.selected_schemas = kwargs['selected_schemas'] - - -class GetUserTablesOracleTaskOutput(msrest.serialization.Model): - """Output for the task that gets the list of tables contained within a provided list of Oracle schemas. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar schema_name: The schema this result is for. - :vartype schema_name: str - :ivar tables: List of valid tables found for this schema. - :vartype tables: list[~azure.mgmt.datamigration.models.DatabaseTable] - :ivar validation_errors: Validation errors associated with the task. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'schema_name': {'readonly': True}, - 'tables': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'schema_name': {'key': 'schemaName', 'type': 'str'}, - 'tables': {'key': 'tables', 'type': '[DatabaseTable]'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesOracleTaskOutput, self).__init__(**kwargs) - self.schema_name = None - self.tables = None - self.validation_errors = None - - -class GetUserTablesOracleTaskProperties(ProjectTaskProperties): - """Properties for the task that collects user tables for the given list of Oracle schemas. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetUserTablesOracleTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesOracleTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'GetUserTablesOracleTaskInput'}, - 'output': {'key': 'output', 'type': '[GetUserTablesOracleTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesOracleTaskProperties, self).__init__(**kwargs) - self.task_type = 'GetUserTablesOracle' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class GetUserTablesPostgreSqlTaskInput(msrest.serialization.Model): - """Input for the task that gets the list of tables for a provided list of PostgreSQL databases. - - All required parameters must be populated in order to send to Azure. - - :param connection_info: Required. Information for connecting to PostgreSQL source. - :type connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - :param selected_databases: Required. List of PostgreSQL databases for which to collect tables. - :type selected_databases: list[str] - """ - - _validation = { - 'connection_info': {'required': True}, - 'selected_databases': {'required': True}, - } - - _attribute_map = { - 'connection_info': {'key': 'connectionInfo', 'type': 'PostgreSqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesPostgreSqlTaskInput, self).__init__(**kwargs) - self.connection_info = kwargs['connection_info'] - self.selected_databases = kwargs['selected_databases'] - - -class GetUserTablesPostgreSqlTaskOutput(msrest.serialization.Model): - """Output for the task that gets the list of tables for a provided list of PostgreSQL databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar database_name: The database this result is for. - :vartype database_name: str - :ivar tables: List of valid tables found for this database. - :vartype tables: list[~azure.mgmt.datamigration.models.DatabaseTable] - :ivar validation_errors: Validation errors associated with the task. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'database_name': {'readonly': True}, - 'tables': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'tables': {'key': 'tables', 'type': '[DatabaseTable]'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesPostgreSqlTaskOutput, self).__init__(**kwargs) - self.database_name = None - self.tables = None - self.validation_errors = None - - -class GetUserTablesPostgreSqlTaskProperties(ProjectTaskProperties): - """Properties for the task that collects user tables for the given list of databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetUserTablesPostgreSqlTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesPostgreSqlTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'GetUserTablesPostgreSqlTaskInput'}, - 'output': {'key': 'output', 'type': '[GetUserTablesPostgreSqlTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesPostgreSqlTaskProperties, self).__init__(**kwargs) - self.task_type = 'GetUserTablesPostgreSql' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class GetUserTablesSqlSyncTaskInput(msrest.serialization.Model): - """Input for the task that collects user tables for the given list of databases. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Connection information for SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Connection information for SQL DB. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_source_databases: Required. List of source database names to collect tables - for. - :type selected_source_databases: list[str] - :param selected_target_databases: Required. List of target database names to collect tables - for. - :type selected_target_databases: list[str] - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'selected_source_databases': {'required': True}, - 'selected_target_databases': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'selected_source_databases': {'key': 'selectedSourceDatabases', 'type': '[str]'}, - 'selected_target_databases': {'key': 'selectedTargetDatabases', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesSqlSyncTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.target_connection_info = kwargs['target_connection_info'] - self.selected_source_databases = kwargs['selected_source_databases'] - self.selected_target_databases = kwargs['selected_target_databases'] - - -class GetUserTablesSqlSyncTaskOutput(msrest.serialization.Model): - """Output of the task that collects user tables for the given list of databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar databases_to_source_tables: Mapping from database name to list of source tables. - :vartype databases_to_source_tables: str - :ivar databases_to_target_tables: Mapping from database name to list of target tables. - :vartype databases_to_target_tables: str - :ivar table_validation_errors: Mapping from database name to list of validation errors. - :vartype table_validation_errors: str - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'databases_to_source_tables': {'readonly': True}, - 'databases_to_target_tables': {'readonly': True}, - 'table_validation_errors': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'databases_to_source_tables': {'key': 'databasesToSourceTables', 'type': 'str'}, - 'databases_to_target_tables': {'key': 'databasesToTargetTables', 'type': 'str'}, - 'table_validation_errors': {'key': 'tableValidationErrors', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesSqlSyncTaskOutput, self).__init__(**kwargs) - self.databases_to_source_tables = None - self.databases_to_target_tables = None - self.table_validation_errors = None - self.validation_errors = None - - -class GetUserTablesSqlSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that collects user tables for the given list of databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetUserTablesSqlSyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesSqlSyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'GetUserTablesSqlSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[GetUserTablesSqlSyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesSqlSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'GetUserTables.AzureSqlDb.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class GetUserTablesSqlTaskInput(msrest.serialization.Model): - """Input for the task that collects user tables for the given list of databases. - - All required parameters must be populated in order to send to Azure. - - :param connection_info: Required. Connection information for SQL Server. - :type connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. List of database names to collect tables for. - :type selected_databases: list[str] - """ - - _validation = { - 'connection_info': {'required': True}, - 'selected_databases': {'required': True}, - } - - _attribute_map = { - 'connection_info': {'key': 'connectionInfo', 'type': 'SqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesSqlTaskInput, self).__init__(**kwargs) - self.connection_info = kwargs['connection_info'] - self.selected_databases = kwargs['selected_databases'] - - -class GetUserTablesSqlTaskOutput(msrest.serialization.Model): - """Output of the task that collects user tables for the given list of databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar databases_to_tables: Mapping from database name to list of tables. - :vartype databases_to_tables: str - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'databases_to_tables': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'databases_to_tables': {'key': 'databasesToTables', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesSqlTaskOutput, self).__init__(**kwargs) - self.id = None - self.databases_to_tables = None - self.validation_errors = None - - -class GetUserTablesSqlTaskProperties(ProjectTaskProperties): - """Properties for the task that collects user tables for the given list of databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetUserTablesSqlTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesSqlTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'GetUserTablesSqlTaskInput'}, - 'output': {'key': 'output', 'type': '[GetUserTablesSqlTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(GetUserTablesSqlTaskProperties, self).__init__(**kwargs) - self.task_type = 'GetUserTables.Sql' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class InstallOCIDriverTaskInput(msrest.serialization.Model): - """Input for the service task to install an OCI driver. - - :param driver_package_name: Name of the uploaded driver package to install. - :type driver_package_name: str - """ - - _attribute_map = { - 'driver_package_name': {'key': 'driverPackageName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InstallOCIDriverTaskInput, self).__init__(**kwargs) - self.driver_package_name = kwargs.get('driver_package_name', None) - - -class InstallOCIDriverTaskOutput(msrest.serialization.Model): - """Output for the service task to install an OCI driver. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(InstallOCIDriverTaskOutput, self).__init__(**kwargs) - self.validation_errors = None - - -class InstallOCIDriverTaskProperties(ProjectTaskProperties): - """Properties for the task that installs an OCI driver. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Input for the service task to install an OCI driver. - :type input: ~azure.mgmt.datamigration.models.InstallOCIDriverTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.InstallOCIDriverTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'InstallOCIDriverTaskInput'}, - 'output': {'key': 'output', 'type': '[InstallOCIDriverTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(InstallOCIDriverTaskProperties, self).__init__(**kwargs) - self.task_type = 'Service.Install.OCI' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateMISyncCompleteCommandInput(msrest.serialization.Model): - """Input for command that completes online migration for an Azure SQL Database Managed Instance. - - All required parameters must be populated in order to send to Azure. - - :param source_database_name: Required. Name of managed instance database. - :type source_database_name: str - """ - - _validation = { - 'source_database_name': {'required': True}, - } - - _attribute_map = { - 'source_database_name': {'key': 'sourceDatabaseName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMISyncCompleteCommandInput, self).__init__(**kwargs) - self.source_database_name = kwargs['source_database_name'] - - -class MigrateMISyncCompleteCommandOutput(msrest.serialization.Model): - """Output for command that completes online migration for an Azure SQL Database Managed Instance. - - :param errors: List of errors that happened during the command execution. - :type errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _attribute_map = { - 'errors': {'key': 'errors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMISyncCompleteCommandOutput, self).__init__(**kwargs) - self.errors = kwargs.get('errors', None) - - -class MigrateMISyncCompleteCommandProperties(CommandProperties): - """Properties for the command that completes online migration for an Azure SQL Database Managed Instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the command. This is ignored if submitted. Possible values include: - "Unknown", "Accepted", "Running", "Succeeded", "Failed". - :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - :param input: Command input. - :type input: ~azure.mgmt.datamigration.models.MigrateMISyncCompleteCommandInput - :ivar output: Command output. This is ignored if submitted. - :vartype output: ~azure.mgmt.datamigration.models.MigrateMISyncCompleteCommandOutput - """ - - _validation = { - 'command_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'command_type': {'key': 'commandType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'input': {'key': 'input', 'type': 'MigrateMISyncCompleteCommandInput'}, - 'output': {'key': 'output', 'type': 'MigrateMISyncCompleteCommandOutput'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMISyncCompleteCommandProperties, self).__init__(**kwargs) - self.command_type = 'Migrate.SqlServer.AzureDbSqlMi.Complete' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateMongoDbTaskProperties(ProjectTaskProperties): - """Properties for the task that migrates data between MongoDB data sources. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Describes how a MongoDB data migration should be performed. - :type input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings - :ivar output: - :vartype output: list[~azure.mgmt.datamigration.models.MongoDbProgress] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MongoDbMigrationSettings'}, - 'output': {'key': 'output', 'type': '[MongoDbProgress]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMongoDbTaskProperties, self).__init__(**kwargs) - self.task_type = 'Migrate.MongoDb' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateMySqlAzureDbForMySqlOfflineDatabaseInput(msrest.serialization.Model): - """Database specific information for offline MySQL to Azure Database for MySQL migration task inputs. - - :param name: Name of the database. - :type name: str - :param target_database_name: Name of target database. Note: Target database will be truncated - before starting migration. - :type target_database_name: str - :param table_map: Mapping of source to target tables. - :type table_map: dict[str, str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'table_map': {'key': 'tableMap', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlOfflineDatabaseInput, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.target_database_name = kwargs.get('target_database_name', None) - self.table_map = kwargs.get('table_map', None) - - -class MigrateMySqlAzureDbForMySqlOfflineTaskInput(msrest.serialization.Model): - """Input for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Connection information for source MySQL. - :type source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param target_connection_info: Required. Connection information for target Azure Database for - MySQL. - :type target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineDatabaseInput] - :param make_source_server_read_only: Setting to set the source server read only. - :type make_source_server_read_only: bool - :param started_on: Parameter to specify when the migration started. - :type started_on: ~datetime.datetime - :param optional_agent_settings: Optional parameters for fine tuning the data transfer rate - during migration. - :type optional_agent_settings: dict[str, str] - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'selected_databases': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'MySqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'MySqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateMySqlAzureDbForMySqlOfflineDatabaseInput]'}, - 'make_source_server_read_only': {'key': 'makeSourceServerReadOnly', 'type': 'bool'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'optional_agent_settings': {'key': 'optionalAgentSettings', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlOfflineTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.target_connection_info = kwargs['target_connection_info'] - self.selected_databases = kwargs['selected_databases'] - self.make_source_server_read_only = kwargs.get('make_source_server_read_only', False) - self.started_on = kwargs.get('started_on', None) - self.optional_agent_settings = kwargs.get('optional_agent_settings', None) - - -class MigrateMySqlAzureDbForMySqlOfflineTaskOutput(msrest.serialization.Model): - """Output for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel, MigrateMySqlAzureDbForMySqlOfflineTaskOutputError, MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel, MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'DatabaseLevelOutput': 'MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel', 'ErrorOutput': 'MigrateMySqlAzureDbForMySqlOfflineTaskOutputError', 'MigrationLevelOutput': 'MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel', 'TableLevelOutput': 'MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel'} - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlOfflineTaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(MigrateMySqlAzureDbForMySqlOfflineTaskOutput): - """MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar database_name: Name of the database. - :vartype database_name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar stage: Migration stage that this database is in. Possible values include: "None", - "Initialize", "Backup", "FileCopy", "Restore", "Completed". - :vartype stage: str or ~azure.mgmt.datamigration.models.DatabaseMigrationStage - :ivar status_message: Status message. - :vartype status_message: str - :ivar message: Migration progress message. - :vartype message: str - :ivar number_of_objects: Number of objects. - :vartype number_of_objects: long - :ivar number_of_objects_completed: Number of successfully completed objects. - :vartype number_of_objects_completed: long - :ivar error_count: Number of database/object errors. - :vartype error_count: long - :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item. - :vartype error_prefix: str - :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the - item. - :vartype result_prefix: str - :ivar exceptions_and_warnings: Migration exceptions and warnings. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - :ivar last_storage_update: Last time the storage was updated. - :vartype last_storage_update: ~datetime.datetime - :ivar object_summary: Summary of object results in the migration. - :vartype object_summary: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'database_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'state': {'readonly': True}, - 'stage': {'readonly': True}, - 'status_message': {'readonly': True}, - 'message': {'readonly': True}, - 'number_of_objects': {'readonly': True}, - 'number_of_objects_completed': {'readonly': True}, - 'error_count': {'readonly': True}, - 'error_prefix': {'readonly': True}, - 'result_prefix': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - 'last_storage_update': {'readonly': True}, - 'object_summary': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'state': {'key': 'state', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'status_message': {'key': 'statusMessage', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'number_of_objects': {'key': 'numberOfObjects', 'type': 'long'}, - 'number_of_objects_completed': {'key': 'numberOfObjectsCompleted', 'type': 'long'}, - 'error_count': {'key': 'errorCount', 'type': 'long'}, - 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, - 'result_prefix': {'key': 'resultPrefix', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - 'last_storage_update': {'key': 'lastStorageUpdate', 'type': 'iso-8601'}, - 'object_summary': {'key': 'objectSummary', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelOutput' # type: str - self.database_name = None - self.started_on = None - self.ended_on = None - self.state = None - self.stage = None - self.status_message = None - self.message = None - self.number_of_objects = None - self.number_of_objects_completed = None - self.error_count = None - self.error_prefix = None - self.result_prefix = None - self.exceptions_and_warnings = None - self.last_storage_update = None - self.object_summary = None - - -class MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(MigrateMySqlAzureDbForMySqlOfflineTaskOutput): - """MigrateMySqlAzureDbForMySqlOfflineTaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar error: Migration error. - :vartype error: ~azure.mgmt.datamigration.models.ReportableException - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ReportableException'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlOfflineTaskOutputError, self).__init__(**kwargs) - self.result_type = 'ErrorOutput' # type: str - self.error = None - - -class MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(MigrateMySqlAzureDbForMySqlOfflineTaskOutput): - """MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar duration_in_seconds: Duration of task execution in seconds. - :vartype duration_in_seconds: long - :ivar status: Current status of migration. Possible values include: "Default", "Connecting", - "SourceAndTargetSelected", "SelectLogins", "Configured", "Running", "Error", "Stopped", - "Completed", "CompletedWithWarnings". - :vartype status: str or ~azure.mgmt.datamigration.models.MigrationStatus - :ivar status_message: Migration status message. - :vartype status_message: str - :ivar message: Migration progress message. - :vartype message: str - :param databases: Selected databases as a map from database name to database id. - :type databases: str - :ivar database_summary: Summary of database results in the migration. - :vartype database_summary: str - :param migration_report_result: Migration Report Result, provides unique url for downloading - your migration report. - :type migration_report_result: ~azure.mgmt.datamigration.models.MigrationReportResult - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server_brand_version: Source server brand version. - :vartype source_server_brand_version: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - :ivar exceptions_and_warnings: Migration exceptions and warnings. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - :ivar last_storage_update: Last time the storage was updated. - :vartype last_storage_update: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'duration_in_seconds': {'readonly': True}, - 'status': {'readonly': True}, - 'status_message': {'readonly': True}, - 'message': {'readonly': True}, - 'database_summary': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server_brand_version': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - 'last_storage_update': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'long'}, - 'status': {'key': 'status', 'type': 'str'}, - 'status_message': {'key': 'statusMessage', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'databases': {'key': 'databases', 'type': 'str'}, - 'database_summary': {'key': 'databaseSummary', 'type': 'str'}, - 'migration_report_result': {'key': 'migrationReportResult', 'type': 'MigrationReportResult'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - 'last_storage_update': {'key': 'lastStorageUpdate', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel, self).__init__(**kwargs) - self.result_type = 'MigrationLevelOutput' # type: str - self.started_on = None - self.ended_on = None - self.duration_in_seconds = None - self.status = None - self.status_message = None - self.message = None - self.databases = kwargs.get('databases', None) - self.database_summary = None - self.migration_report_result = kwargs.get('migration_report_result', None) - self.source_server_version = None - self.source_server_brand_version = None - self.target_server_version = None - self.target_server_brand_version = None - self.exceptions_and_warnings = None - self.last_storage_update = None - - -class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(MigrateMySqlAzureDbForMySqlOfflineTaskOutput): - """MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar object_name: Name of the item. - :vartype object_name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar status_message: Status message. - :vartype status_message: str - :ivar items_count: Number of items. - :vartype items_count: long - :ivar items_completed_count: Number of successfully completed items. - :vartype items_completed_count: long - :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item. - :vartype error_prefix: str - :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the - item. - :vartype result_prefix: str - :ivar last_storage_update: Last time the storage was updated. - :vartype last_storage_update: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'object_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'state': {'readonly': True}, - 'status_message': {'readonly': True}, - 'items_count': {'readonly': True}, - 'items_completed_count': {'readonly': True}, - 'error_prefix': {'readonly': True}, - 'result_prefix': {'readonly': True}, - 'last_storage_update': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'object_name': {'key': 'objectName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'state': {'key': 'state', 'type': 'str'}, - 'status_message': {'key': 'statusMessage', 'type': 'str'}, - 'items_count': {'key': 'itemsCount', 'type': 'long'}, - 'items_completed_count': {'key': 'itemsCompletedCount', 'type': 'long'}, - 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, - 'result_prefix': {'key': 'resultPrefix', 'type': 'str'}, - 'last_storage_update': {'key': 'lastStorageUpdate', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel, self).__init__(**kwargs) - self.result_type = 'TableLevelOutput' # type: str - self.object_name = None - self.started_on = None - self.ended_on = None - self.state = None - self.status_message = None - self.items_count = None - self.items_completed_count = None - self.error_prefix = None - self.result_prefix = None - self.last_storage_update = None - - -class MigrateMySqlAzureDbForMySqlOfflineTaskProperties(ProjectTaskProperties): - """Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: - list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigrateMySqlAzureDbForMySqlOfflineTaskInput'}, - 'output': {'key': 'output', 'type': '[MigrateMySqlAzureDbForMySqlOfflineTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlOfflineTaskProperties, self).__init__(**kwargs) - self.task_type = 'Migrate.MySql.AzureDbForMySql' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateMySqlAzureDbForMySqlSyncDatabaseInput(msrest.serialization.Model): - """Database specific information for MySQL to Azure Database for MySQL migration task inputs. - - :param name: Name of the database. - :type name: str - :param target_database_name: Name of target database. Note: Target database will be truncated - before starting migration. - :type target_database_name: str - :param migration_setting: Migration settings which tune the migration behavior. - :type migration_setting: dict[str, str] - :param source_setting: Source settings to tune source endpoint migration behavior. - :type source_setting: dict[str, str] - :param target_setting: Target settings to tune target endpoint migration behavior. - :type target_setting: dict[str, str] - :param table_map: Mapping of source to target tables. - :type table_map: dict[str, str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'migration_setting': {'key': 'migrationSetting', 'type': '{str}'}, - 'source_setting': {'key': 'sourceSetting', 'type': '{str}'}, - 'target_setting': {'key': 'targetSetting', 'type': '{str}'}, - 'table_map': {'key': 'tableMap', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlSyncDatabaseInput, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.target_database_name = kwargs.get('target_database_name', None) - self.migration_setting = kwargs.get('migration_setting', None) - self.source_setting = kwargs.get('source_setting', None) - self.target_setting = kwargs.get('target_setting', None) - self.table_map = kwargs.get('table_map', None) - - -class MigrateMySqlAzureDbForMySqlSyncTaskInput(msrest.serialization.Model): - """Input for the task that migrates MySQL databases to Azure Database for MySQL for online migrations. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Connection information for source MySQL. - :type source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param target_connection_info: Required. Connection information for target Azure Database for - MySQL. - :type target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncDatabaseInput] - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'selected_databases': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'MySqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'MySqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateMySqlAzureDbForMySqlSyncDatabaseInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlSyncTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.target_connection_info = kwargs['target_connection_info'] - self.selected_databases = kwargs['selected_databases'] - - -class MigrateMySqlAzureDbForMySqlSyncTaskOutput(msrest.serialization.Model): - """Output for the task that migrates MySQL databases to Azure Database for MySQL for online migrations. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError, MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel, MigrateMySqlAzureDbForMySqlSyncTaskOutputError, MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel, MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'DatabaseLevelErrorOutput': 'MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError', 'DatabaseLevelOutput': 'MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel', 'ErrorOutput': 'MigrateMySqlAzureDbForMySqlSyncTaskOutputError', 'MigrationLevelOutput': 'MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel', 'TableLevelOutput': 'MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel'} - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlSyncTaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError(MigrateMySqlAzureDbForMySqlSyncTaskOutput): - """MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :param error_message: Error message. - :type error_message: str - :param events: List of error events. - :type events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'events': {'key': 'events', 'type': '[SyncMigrationDatabaseErrorEvent]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelErrorOutput' # type: str - self.error_message = kwargs.get('error_message', None) - self.events = kwargs.get('events', None) - - -class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(MigrateMySqlAzureDbForMySqlSyncTaskOutput): - """MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar database_name: Name of the database. - :vartype database_name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar migration_state: Migration state that this database is in. Possible values include: - "UNDEFINED", "CONFIGURING", "INITIALIAZING", "STARTING", "RUNNING", "READY_TO_COMPLETE", - "COMPLETING", "COMPLETE", "CANCELLING", "CANCELLED", "FAILED", "VALIDATING", - "VALIDATION_COMPLETE", "VALIDATION_FAILED", "RESTORE_IN_PROGRESS", "RESTORE_COMPLETED", - "BACKUP_IN_PROGRESS", "BACKUP_COMPLETED". - :vartype migration_state: str or - ~azure.mgmt.datamigration.models.SyncDatabaseMigrationReportingState - :ivar incoming_changes: Number of incoming changes. - :vartype incoming_changes: long - :ivar applied_changes: Number of applied changes. - :vartype applied_changes: long - :ivar cdc_insert_counter: Number of cdc inserts. - :vartype cdc_insert_counter: long - :ivar cdc_delete_counter: Number of cdc deletes. - :vartype cdc_delete_counter: long - :ivar cdc_update_counter: Number of cdc updates. - :vartype cdc_update_counter: long - :ivar full_load_completed_tables: Number of tables completed in full load. - :vartype full_load_completed_tables: long - :ivar full_load_loading_tables: Number of tables loading in full load. - :vartype full_load_loading_tables: long - :ivar full_load_queued_tables: Number of tables queued in full load. - :vartype full_load_queued_tables: long - :ivar full_load_errored_tables: Number of tables errored in full load. - :vartype full_load_errored_tables: long - :ivar initialization_completed: Indicates if initial load (full load) has been completed. - :vartype initialization_completed: bool - :ivar latency: CDC apply latency. - :vartype latency: long - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'database_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'migration_state': {'readonly': True}, - 'incoming_changes': {'readonly': True}, - 'applied_changes': {'readonly': True}, - 'cdc_insert_counter': {'readonly': True}, - 'cdc_delete_counter': {'readonly': True}, - 'cdc_update_counter': {'readonly': True}, - 'full_load_completed_tables': {'readonly': True}, - 'full_load_loading_tables': {'readonly': True}, - 'full_load_queued_tables': {'readonly': True}, - 'full_load_errored_tables': {'readonly': True}, - 'initialization_completed': {'readonly': True}, - 'latency': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'migration_state': {'key': 'migrationState', 'type': 'str'}, - 'incoming_changes': {'key': 'incomingChanges', 'type': 'long'}, - 'applied_changes': {'key': 'appliedChanges', 'type': 'long'}, - 'cdc_insert_counter': {'key': 'cdcInsertCounter', 'type': 'long'}, - 'cdc_delete_counter': {'key': 'cdcDeleteCounter', 'type': 'long'}, - 'cdc_update_counter': {'key': 'cdcUpdateCounter', 'type': 'long'}, - 'full_load_completed_tables': {'key': 'fullLoadCompletedTables', 'type': 'long'}, - 'full_load_loading_tables': {'key': 'fullLoadLoadingTables', 'type': 'long'}, - 'full_load_queued_tables': {'key': 'fullLoadQueuedTables', 'type': 'long'}, - 'full_load_errored_tables': {'key': 'fullLoadErroredTables', 'type': 'long'}, - 'initialization_completed': {'key': 'initializationCompleted', 'type': 'bool'}, - 'latency': {'key': 'latency', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelOutput' # type: str - self.database_name = None - self.started_on = None - self.ended_on = None - self.migration_state = None - self.incoming_changes = None - self.applied_changes = None - self.cdc_insert_counter = None - self.cdc_delete_counter = None - self.cdc_update_counter = None - self.full_load_completed_tables = None - self.full_load_loading_tables = None - self.full_load_queued_tables = None - self.full_load_errored_tables = None - self.initialization_completed = None - self.latency = None - - -class MigrateMySqlAzureDbForMySqlSyncTaskOutputError(MigrateMySqlAzureDbForMySqlSyncTaskOutput): - """MigrateMySqlAzureDbForMySqlSyncTaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar error: Migration error. - :vartype error: ~azure.mgmt.datamigration.models.ReportableException - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ReportableException'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlSyncTaskOutputError, self).__init__(**kwargs) - self.result_type = 'ErrorOutput' # type: str - self.error = None - - -class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(MigrateMySqlAzureDbForMySqlSyncTaskOutput): - """MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server: Source server name. - :vartype source_server: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server: Target server name. - :vartype target_server: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server': {'key': 'sourceServer', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server': {'key': 'targetServer', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel, self).__init__(**kwargs) - self.result_type = 'MigrationLevelOutput' # type: str - self.started_on = None - self.ended_on = None - self.source_server_version = None - self.source_server = None - self.target_server_version = None - self.target_server = None - - -class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(MigrateMySqlAzureDbForMySqlSyncTaskOutput): - """MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar table_name: Name of the table. - :vartype table_name: str - :ivar database_name: Name of the database. - :vartype database_name: str - :ivar cdc_insert_counter: Number of applied inserts. - :vartype cdc_insert_counter: str - :ivar cdc_update_counter: Number of applied updates. - :vartype cdc_update_counter: str - :ivar cdc_delete_counter: Number of applied deletes. - :vartype cdc_delete_counter: str - :ivar full_load_est_finish_time: Estimate to finish full load. - :vartype full_load_est_finish_time: ~datetime.datetime - :ivar full_load_started_on: Full load start time. - :vartype full_load_started_on: ~datetime.datetime - :ivar full_load_ended_on: Full load end time. - :vartype full_load_ended_on: ~datetime.datetime - :ivar full_load_total_rows: Number of rows applied in full load. - :vartype full_load_total_rows: long - :ivar state: Current state of the table migration. Possible values include: "BEFORE_LOAD", - "FULL_LOAD", "COMPLETED", "CANCELED", "ERROR", "FAILED". - :vartype state: str or ~azure.mgmt.datamigration.models.SyncTableMigrationState - :ivar total_changes_applied: Total number of applied changes. - :vartype total_changes_applied: long - :ivar data_errors_counter: Number of data errors occurred. - :vartype data_errors_counter: long - :ivar last_modified_time: Last modified time on target. - :vartype last_modified_time: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'table_name': {'readonly': True}, - 'database_name': {'readonly': True}, - 'cdc_insert_counter': {'readonly': True}, - 'cdc_update_counter': {'readonly': True}, - 'cdc_delete_counter': {'readonly': True}, - 'full_load_est_finish_time': {'readonly': True}, - 'full_load_started_on': {'readonly': True}, - 'full_load_ended_on': {'readonly': True}, - 'full_load_total_rows': {'readonly': True}, - 'state': {'readonly': True}, - 'total_changes_applied': {'readonly': True}, - 'data_errors_counter': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'cdc_insert_counter': {'key': 'cdcInsertCounter', 'type': 'str'}, - 'cdc_update_counter': {'key': 'cdcUpdateCounter', 'type': 'str'}, - 'cdc_delete_counter': {'key': 'cdcDeleteCounter', 'type': 'str'}, - 'full_load_est_finish_time': {'key': 'fullLoadEstFinishTime', 'type': 'iso-8601'}, - 'full_load_started_on': {'key': 'fullLoadStartedOn', 'type': 'iso-8601'}, - 'full_load_ended_on': {'key': 'fullLoadEndedOn', 'type': 'iso-8601'}, - 'full_load_total_rows': {'key': 'fullLoadTotalRows', 'type': 'long'}, - 'state': {'key': 'state', 'type': 'str'}, - 'total_changes_applied': {'key': 'totalChangesApplied', 'type': 'long'}, - 'data_errors_counter': {'key': 'dataErrorsCounter', 'type': 'long'}, - 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel, self).__init__(**kwargs) - self.result_type = 'TableLevelOutput' # type: str - self.table_name = None - self.database_name = None - self.cdc_insert_counter = None - self.cdc_update_counter = None - self.cdc_delete_counter = None - self.full_load_est_finish_time = None - self.full_load_started_on = None - self.full_load_ended_on = None - self.full_load_total_rows = None - self.state = None - self.total_changes_applied = None - self.data_errors_counter = None - self.last_modified_time = None - - -class MigrateMySqlAzureDbForMySqlSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that migrates MySQL databases to Azure Database for MySQL for online migrations. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: - list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigrateMySqlAzureDbForMySqlSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[MigrateMySqlAzureDbForMySqlSyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateMySqlAzureDbForMySqlSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'Migrate.MySql.AzureDbForMySql.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online migrations. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: - list[~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigrateOracleAzureDbPostgreSqlSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[MigrateOracleAzureDbPostgreSqlSyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateOracleAzureDbForPostgreSqlSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'Migrate.Oracle.AzureDbForPostgreSql.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(msrest.serialization.Model): - """Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs. - - :param case_manipulation: How to handle object name casing: either Preserve or ToLower. - :type case_manipulation: str - :param name: Name of the migration pipeline. - :type name: str - :param schema_name: Name of the source schema. - :type schema_name: str - :param table_map: Mapping of source to target tables. - :type table_map: dict[str, str] - :param target_database_name: Name of target database. Note: Target database will be truncated - before starting migration. - :type target_database_name: str - :param migration_setting: Migration settings which tune the migration behavior. - :type migration_setting: dict[str, str] - :param source_setting: Source settings to tune source endpoint migration behavior. - :type source_setting: dict[str, str] - :param target_setting: Target settings to tune target endpoint migration behavior. - :type target_setting: dict[str, str] - """ - - _attribute_map = { - 'case_manipulation': {'key': 'caseManipulation', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'schema_name': {'key': 'schemaName', 'type': 'str'}, - 'table_map': {'key': 'tableMap', 'type': '{str}'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'migration_setting': {'key': 'migrationSetting', 'type': '{str}'}, - 'source_setting': {'key': 'sourceSetting', 'type': '{str}'}, - 'target_setting': {'key': 'targetSetting', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateOracleAzureDbPostgreSqlSyncDatabaseInput, self).__init__(**kwargs) - self.case_manipulation = kwargs.get('case_manipulation', None) - self.name = kwargs.get('name', None) - self.schema_name = kwargs.get('schema_name', None) - self.table_map = kwargs.get('table_map', None) - self.target_database_name = kwargs.get('target_database_name', None) - self.migration_setting = kwargs.get('migration_setting', None) - self.source_setting = kwargs.get('source_setting', None) - self.target_setting = kwargs.get('target_setting', None) - - -class MigrateOracleAzureDbPostgreSqlSyncTaskInput(msrest.serialization.Model): - """Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations. - - All required parameters must be populated in order to send to Azure. - - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncDatabaseInput] - :param target_connection_info: Required. Connection information for target Azure Database for - PostgreSQL. - :type target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - :param source_connection_info: Required. Connection information for source Oracle. - :type source_connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo - """ - - _validation = { - 'selected_databases': {'required': True}, - 'target_connection_info': {'required': True}, - 'source_connection_info': {'required': True}, - } - - _attribute_map = { - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateOracleAzureDbPostgreSqlSyncDatabaseInput]'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'PostgreSqlConnectionInfo'}, - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'OracleConnectionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateOracleAzureDbPostgreSqlSyncTaskInput, self).__init__(**kwargs) - self.selected_databases = kwargs['selected_databases'] - self.target_connection_info = kwargs['target_connection_info'] - self.source_connection_info = kwargs['source_connection_info'] - - -class MigrateOracleAzureDbPostgreSqlSyncTaskOutput(msrest.serialization.Model): - """Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError, MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel, MigrateOracleAzureDbPostgreSqlSyncTaskOutputError, MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel, MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'DatabaseLevelErrorOutput': 'MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError', 'DatabaseLevelOutput': 'MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel', 'ErrorOutput': 'MigrateOracleAzureDbPostgreSqlSyncTaskOutputError', 'MigrationLevelOutput': 'MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel', 'TableLevelOutput': 'MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel'} - } - - def __init__( - self, - **kwargs - ): - super(MigrateOracleAzureDbPostgreSqlSyncTaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(MigrateOracleAzureDbPostgreSqlSyncTaskOutput): - """MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :param error_message: Error message. - :type error_message: str - :param events: List of error events. - :type events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'events': {'key': 'events', 'type': '[SyncMigrationDatabaseErrorEvent]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelErrorOutput' # type: str - self.error_message = kwargs.get('error_message', None) - self.events = kwargs.get('events', None) - - -class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(MigrateOracleAzureDbPostgreSqlSyncTaskOutput): - """MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar database_name: Name of the database. - :vartype database_name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar migration_state: Migration state that this database is in. Possible values include: - "UNDEFINED", "CONFIGURING", "INITIALIAZING", "STARTING", "RUNNING", "READY_TO_COMPLETE", - "COMPLETING", "COMPLETE", "CANCELLING", "CANCELLED", "FAILED", "VALIDATING", - "VALIDATION_COMPLETE", "VALIDATION_FAILED", "RESTORE_IN_PROGRESS", "RESTORE_COMPLETED", - "BACKUP_IN_PROGRESS", "BACKUP_COMPLETED". - :vartype migration_state: str or - ~azure.mgmt.datamigration.models.SyncDatabaseMigrationReportingState - :ivar incoming_changes: Number of incoming changes. - :vartype incoming_changes: long - :ivar applied_changes: Number of applied changes. - :vartype applied_changes: long - :ivar cdc_insert_counter: Number of cdc inserts. - :vartype cdc_insert_counter: long - :ivar cdc_delete_counter: Number of cdc deletes. - :vartype cdc_delete_counter: long - :ivar cdc_update_counter: Number of cdc updates. - :vartype cdc_update_counter: long - :ivar full_load_completed_tables: Number of tables completed in full load. - :vartype full_load_completed_tables: long - :ivar full_load_loading_tables: Number of tables loading in full load. - :vartype full_load_loading_tables: long - :ivar full_load_queued_tables: Number of tables queued in full load. - :vartype full_load_queued_tables: long - :ivar full_load_errored_tables: Number of tables errored in full load. - :vartype full_load_errored_tables: long - :ivar initialization_completed: Indicates if initial load (full load) has been completed. - :vartype initialization_completed: bool - :ivar latency: CDC apply latency. - :vartype latency: long - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'database_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'migration_state': {'readonly': True}, - 'incoming_changes': {'readonly': True}, - 'applied_changes': {'readonly': True}, - 'cdc_insert_counter': {'readonly': True}, - 'cdc_delete_counter': {'readonly': True}, - 'cdc_update_counter': {'readonly': True}, - 'full_load_completed_tables': {'readonly': True}, - 'full_load_loading_tables': {'readonly': True}, - 'full_load_queued_tables': {'readonly': True}, - 'full_load_errored_tables': {'readonly': True}, - 'initialization_completed': {'readonly': True}, - 'latency': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'migration_state': {'key': 'migrationState', 'type': 'str'}, - 'incoming_changes': {'key': 'incomingChanges', 'type': 'long'}, - 'applied_changes': {'key': 'appliedChanges', 'type': 'long'}, - 'cdc_insert_counter': {'key': 'cdcInsertCounter', 'type': 'long'}, - 'cdc_delete_counter': {'key': 'cdcDeleteCounter', 'type': 'long'}, - 'cdc_update_counter': {'key': 'cdcUpdateCounter', 'type': 'long'}, - 'full_load_completed_tables': {'key': 'fullLoadCompletedTables', 'type': 'long'}, - 'full_load_loading_tables': {'key': 'fullLoadLoadingTables', 'type': 'long'}, - 'full_load_queued_tables': {'key': 'fullLoadQueuedTables', 'type': 'long'}, - 'full_load_errored_tables': {'key': 'fullLoadErroredTables', 'type': 'long'}, - 'initialization_completed': {'key': 'initializationCompleted', 'type': 'bool'}, - 'latency': {'key': 'latency', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelOutput' # type: str - self.database_name = None - self.started_on = None - self.ended_on = None - self.migration_state = None - self.incoming_changes = None - self.applied_changes = None - self.cdc_insert_counter = None - self.cdc_delete_counter = None - self.cdc_update_counter = None - self.full_load_completed_tables = None - self.full_load_loading_tables = None - self.full_load_queued_tables = None - self.full_load_errored_tables = None - self.initialization_completed = None - self.latency = None - - -class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(MigrateOracleAzureDbPostgreSqlSyncTaskOutput): - """MigrateOracleAzureDbPostgreSqlSyncTaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar error: Migration error. - :vartype error: ~azure.mgmt.datamigration.models.ReportableException - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ReportableException'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateOracleAzureDbPostgreSqlSyncTaskOutputError, self).__init__(**kwargs) - self.result_type = 'ErrorOutput' # type: str - self.error = None - - -class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(MigrateOracleAzureDbPostgreSqlSyncTaskOutput): - """MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server: Source server name. - :vartype source_server: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server: Target server name. - :vartype target_server: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server': {'key': 'sourceServer', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server': {'key': 'targetServer', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel, self).__init__(**kwargs) - self.result_type = 'MigrationLevelOutput' # type: str - self.started_on = None - self.ended_on = None - self.source_server_version = None - self.source_server = None - self.target_server_version = None - self.target_server = None - - -class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(MigrateOracleAzureDbPostgreSqlSyncTaskOutput): - """MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar table_name: Name of the table. - :vartype table_name: str - :ivar database_name: Name of the database. - :vartype database_name: str - :ivar cdc_insert_counter: Number of applied inserts. - :vartype cdc_insert_counter: long - :ivar cdc_update_counter: Number of applied updates. - :vartype cdc_update_counter: long - :ivar cdc_delete_counter: Number of applied deletes. - :vartype cdc_delete_counter: long - :ivar full_load_est_finish_time: Estimate to finish full load. - :vartype full_load_est_finish_time: ~datetime.datetime - :ivar full_load_started_on: Full load start time. - :vartype full_load_started_on: ~datetime.datetime - :ivar full_load_ended_on: Full load end time. - :vartype full_load_ended_on: ~datetime.datetime - :ivar full_load_total_rows: Number of rows applied in full load. - :vartype full_load_total_rows: long - :ivar state: Current state of the table migration. Possible values include: "BEFORE_LOAD", - "FULL_LOAD", "COMPLETED", "CANCELED", "ERROR", "FAILED". - :vartype state: str or ~azure.mgmt.datamigration.models.SyncTableMigrationState - :ivar total_changes_applied: Total number of applied changes. - :vartype total_changes_applied: long - :ivar data_errors_counter: Number of data errors occurred. - :vartype data_errors_counter: long - :ivar last_modified_time: Last modified time on target. - :vartype last_modified_time: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'table_name': {'readonly': True}, - 'database_name': {'readonly': True}, - 'cdc_insert_counter': {'readonly': True}, - 'cdc_update_counter': {'readonly': True}, - 'cdc_delete_counter': {'readonly': True}, - 'full_load_est_finish_time': {'readonly': True}, - 'full_load_started_on': {'readonly': True}, - 'full_load_ended_on': {'readonly': True}, - 'full_load_total_rows': {'readonly': True}, - 'state': {'readonly': True}, - 'total_changes_applied': {'readonly': True}, - 'data_errors_counter': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'cdc_insert_counter': {'key': 'cdcInsertCounter', 'type': 'long'}, - 'cdc_update_counter': {'key': 'cdcUpdateCounter', 'type': 'long'}, - 'cdc_delete_counter': {'key': 'cdcDeleteCounter', 'type': 'long'}, - 'full_load_est_finish_time': {'key': 'fullLoadEstFinishTime', 'type': 'iso-8601'}, - 'full_load_started_on': {'key': 'fullLoadStartedOn', 'type': 'iso-8601'}, - 'full_load_ended_on': {'key': 'fullLoadEndedOn', 'type': 'iso-8601'}, - 'full_load_total_rows': {'key': 'fullLoadTotalRows', 'type': 'long'}, - 'state': {'key': 'state', 'type': 'str'}, - 'total_changes_applied': {'key': 'totalChangesApplied', 'type': 'long'}, - 'data_errors_counter': {'key': 'dataErrorsCounter', 'type': 'long'}, - 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel, self).__init__(**kwargs) - self.result_type = 'TableLevelOutput' # type: str - self.table_name = None - self.database_name = None - self.cdc_insert_counter = None - self.cdc_update_counter = None - self.cdc_delete_counter = None - self.full_load_est_finish_time = None - self.full_load_started_on = None - self.full_load_ended_on = None - self.full_load_total_rows = None - self.state = None - self.total_changes_applied = None - self.data_errors_counter = None - self.last_modified_time = None - - -class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput(msrest.serialization.Model): - """Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs. - - :param name: Name of the database. - :type name: str - :param target_database_name: Name of target database. Note: Target database will be truncated - before starting migration. - :type target_database_name: str - :param migration_setting: Migration settings which tune the migration behavior. - :type migration_setting: dict[str, str] - :param source_setting: Source settings to tune source endpoint migration behavior. - :type source_setting: dict[str, str] - :param target_setting: Target settings to tune target endpoint migration behavior. - :type target_setting: dict[str, str] - :param selected_tables: Tables selected for migration. - :type selected_tables: - list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'migration_setting': {'key': 'migrationSetting', 'type': '{str}'}, - 'source_setting': {'key': 'sourceSetting', 'type': '{str}'}, - 'target_setting': {'key': 'targetSetting', 'type': '{str}'}, - 'selected_tables': {'key': 'selectedTables', 'type': '[MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.target_database_name = kwargs.get('target_database_name', None) - self.migration_setting = kwargs.get('migration_setting', None) - self.source_setting = kwargs.get('source_setting', None) - self.target_setting = kwargs.get('target_setting', None) - self.selected_tables = kwargs.get('selected_tables', None) - - -class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput(msrest.serialization.Model): - """Selected tables for the migration. - - :param name: Name of the table to migrate. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput(msrest.serialization.Model): - """Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations. - - All required parameters must be populated in order to send to Azure. - - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput] - :param target_connection_info: Required. Connection information for target Azure Database for - PostgreSQL. - :type target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - :param source_connection_info: Required. Connection information for source PostgreSQL. - :type source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - """ - - _validation = { - 'selected_databases': {'required': True}, - 'target_connection_info': {'required': True}, - 'source_connection_info': {'required': True}, - } - - _attribute_map = { - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput]'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'PostgreSqlConnectionInfo'}, - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'PostgreSqlConnectionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput, self).__init__(**kwargs) - self.selected_databases = kwargs['selected_databases'] - self.target_connection_info = kwargs['target_connection_info'] - self.source_connection_info = kwargs['source_connection_info'] - - -class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(msrest.serialization.Model): - """Output for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError, MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel, MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError, MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel, MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'DatabaseLevelErrorOutput': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError', 'DatabaseLevelOutput': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel', 'ErrorOutput': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError', 'MigrationLevelOutput': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel', 'TableLevelOutput': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel'} - } - - def __init__( - self, - **kwargs - ): - super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput): - """MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :param error_message: Error message. - :type error_message: str - :param events: List of error events. - :type events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'events': {'key': 'events', 'type': '[SyncMigrationDatabaseErrorEvent]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelErrorOutput' # type: str - self.error_message = kwargs.get('error_message', None) - self.events = kwargs.get('events', None) - - -class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput): - """MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar database_name: Name of the database. - :vartype database_name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar migration_state: Migration state that this database is in. Possible values include: - "UNDEFINED", "CONFIGURING", "INITIALIAZING", "STARTING", "RUNNING", "READY_TO_COMPLETE", - "COMPLETING", "COMPLETE", "CANCELLING", "CANCELLED", "FAILED", "VALIDATING", - "VALIDATION_COMPLETE", "VALIDATION_FAILED", "RESTORE_IN_PROGRESS", "RESTORE_COMPLETED", - "BACKUP_IN_PROGRESS", "BACKUP_COMPLETED". - :vartype migration_state: str or - ~azure.mgmt.datamigration.models.SyncDatabaseMigrationReportingState - :ivar incoming_changes: Number of incoming changes. - :vartype incoming_changes: long - :ivar applied_changes: Number of applied changes. - :vartype applied_changes: long - :ivar cdc_insert_counter: Number of cdc inserts. - :vartype cdc_insert_counter: long - :ivar cdc_delete_counter: Number of cdc deletes. - :vartype cdc_delete_counter: long - :ivar cdc_update_counter: Number of cdc updates. - :vartype cdc_update_counter: long - :ivar full_load_completed_tables: Number of tables completed in full load. - :vartype full_load_completed_tables: long - :ivar full_load_loading_tables: Number of tables loading in full load. - :vartype full_load_loading_tables: long - :ivar full_load_queued_tables: Number of tables queued in full load. - :vartype full_load_queued_tables: long - :ivar full_load_errored_tables: Number of tables errored in full load. - :vartype full_load_errored_tables: long - :ivar initialization_completed: Indicates if initial load (full load) has been completed. - :vartype initialization_completed: bool - :ivar latency: CDC apply latency. - :vartype latency: long - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'database_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'migration_state': {'readonly': True}, - 'incoming_changes': {'readonly': True}, - 'applied_changes': {'readonly': True}, - 'cdc_insert_counter': {'readonly': True}, - 'cdc_delete_counter': {'readonly': True}, - 'cdc_update_counter': {'readonly': True}, - 'full_load_completed_tables': {'readonly': True}, - 'full_load_loading_tables': {'readonly': True}, - 'full_load_queued_tables': {'readonly': True}, - 'full_load_errored_tables': {'readonly': True}, - 'initialization_completed': {'readonly': True}, - 'latency': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'migration_state': {'key': 'migrationState', 'type': 'str'}, - 'incoming_changes': {'key': 'incomingChanges', 'type': 'long'}, - 'applied_changes': {'key': 'appliedChanges', 'type': 'long'}, - 'cdc_insert_counter': {'key': 'cdcInsertCounter', 'type': 'long'}, - 'cdc_delete_counter': {'key': 'cdcDeleteCounter', 'type': 'long'}, - 'cdc_update_counter': {'key': 'cdcUpdateCounter', 'type': 'long'}, - 'full_load_completed_tables': {'key': 'fullLoadCompletedTables', 'type': 'long'}, - 'full_load_loading_tables': {'key': 'fullLoadLoadingTables', 'type': 'long'}, - 'full_load_queued_tables': {'key': 'fullLoadQueuedTables', 'type': 'long'}, - 'full_load_errored_tables': {'key': 'fullLoadErroredTables', 'type': 'long'}, - 'initialization_completed': {'key': 'initializationCompleted', 'type': 'bool'}, - 'latency': {'key': 'latency', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelOutput' # type: str - self.database_name = None - self.started_on = None - self.ended_on = None - self.migration_state = None - self.incoming_changes = None - self.applied_changes = None - self.cdc_insert_counter = None - self.cdc_delete_counter = None - self.cdc_update_counter = None - self.full_load_completed_tables = None - self.full_load_loading_tables = None - self.full_load_queued_tables = None - self.full_load_errored_tables = None - self.initialization_completed = None - self.latency = None - - -class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput): - """MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar error: Migration error. - :vartype error: ~azure.mgmt.datamigration.models.ReportableException - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ReportableException'}, - } - - def __init__( - self, - **kwargs - ): - super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError, self).__init__(**kwargs) - self.result_type = 'ErrorOutput' # type: str - self.error = None - - -class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput): - """MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server: Source server name. - :vartype source_server: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server: Target server name. - :vartype target_server: str - :ivar source_server_type: Source server type. Possible values include: "Access", "DB2", - "MySQL", "Oracle", "SQL", "Sybase", "PostgreSQL", "MongoDB", "SQLRDS", "MySQLRDS", - "PostgreSQLRDS". - :vartype source_server_type: str or ~azure.mgmt.datamigration.models.ScenarioSource - :ivar target_server_type: Target server type. Possible values include: "SQLServer", "SQLDB", - "SQLDW", "SQLMI", "AzureDBForMySql", "AzureDBForPostgresSQL", "MongoDB". - :vartype target_server_type: str or ~azure.mgmt.datamigration.models.ScenarioTarget - :ivar state: Migration status. Possible values include: "UNDEFINED", "VALIDATING", "PENDING", - "COMPLETE", "ACTION_REQUIRED", "FAILED". - :vartype state: str or ~azure.mgmt.datamigration.models.ReplicateMigrationState - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server': {'readonly': True}, - 'source_server_type': {'readonly': True}, - 'target_server_type': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server': {'key': 'sourceServer', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server': {'key': 'targetServer', 'type': 'str'}, - 'source_server_type': {'key': 'sourceServerType', 'type': 'str'}, - 'target_server_type': {'key': 'targetServerType', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel, self).__init__(**kwargs) - self.result_type = 'MigrationLevelOutput' # type: str - self.started_on = None - self.ended_on = None - self.source_server_version = None - self.source_server = None - self.target_server_version = None - self.target_server = None - self.source_server_type = None - self.target_server_type = None - self.state = None - - -class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput): - """MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar table_name: Name of the table. - :vartype table_name: str - :ivar database_name: Name of the database. - :vartype database_name: str - :ivar cdc_insert_counter: Number of applied inserts. - :vartype cdc_insert_counter: long - :ivar cdc_update_counter: Number of applied updates. - :vartype cdc_update_counter: long - :ivar cdc_delete_counter: Number of applied deletes. - :vartype cdc_delete_counter: long - :ivar full_load_est_finish_time: Estimate to finish full load. - :vartype full_load_est_finish_time: ~datetime.datetime - :ivar full_load_started_on: Full load start time. - :vartype full_load_started_on: ~datetime.datetime - :ivar full_load_ended_on: Full load end time. - :vartype full_load_ended_on: ~datetime.datetime - :ivar full_load_total_rows: Number of rows applied in full load. - :vartype full_load_total_rows: long - :ivar state: Current state of the table migration. Possible values include: "BEFORE_LOAD", - "FULL_LOAD", "COMPLETED", "CANCELED", "ERROR", "FAILED". - :vartype state: str or ~azure.mgmt.datamigration.models.SyncTableMigrationState - :ivar total_changes_applied: Total number of applied changes. - :vartype total_changes_applied: long - :ivar data_errors_counter: Number of data errors occurred. - :vartype data_errors_counter: long - :ivar last_modified_time: Last modified time on target. - :vartype last_modified_time: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'table_name': {'readonly': True}, - 'database_name': {'readonly': True}, - 'cdc_insert_counter': {'readonly': True}, - 'cdc_update_counter': {'readonly': True}, - 'cdc_delete_counter': {'readonly': True}, - 'full_load_est_finish_time': {'readonly': True}, - 'full_load_started_on': {'readonly': True}, - 'full_load_ended_on': {'readonly': True}, - 'full_load_total_rows': {'readonly': True}, - 'state': {'readonly': True}, - 'total_changes_applied': {'readonly': True}, - 'data_errors_counter': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'cdc_insert_counter': {'key': 'cdcInsertCounter', 'type': 'long'}, - 'cdc_update_counter': {'key': 'cdcUpdateCounter', 'type': 'long'}, - 'cdc_delete_counter': {'key': 'cdcDeleteCounter', 'type': 'long'}, - 'full_load_est_finish_time': {'key': 'fullLoadEstFinishTime', 'type': 'iso-8601'}, - 'full_load_started_on': {'key': 'fullLoadStartedOn', 'type': 'iso-8601'}, - 'full_load_ended_on': {'key': 'fullLoadEndedOn', 'type': 'iso-8601'}, - 'full_load_total_rows': {'key': 'fullLoadTotalRows', 'type': 'long'}, - 'state': {'key': 'state', 'type': 'str'}, - 'total_changes_applied': {'key': 'totalChangesApplied', 'type': 'long'}, - 'data_errors_counter': {'key': 'dataErrorsCounter', 'type': 'long'}, - 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel, self).__init__(**kwargs) - self.result_type = 'TableLevelOutput' # type: str - self.table_name = None - self.database_name = None - self.cdc_insert_counter = None - self.cdc_update_counter = None - self.cdc_delete_counter = None - self.full_load_est_finish_time = None - self.full_load_started_on = None - self.full_load_ended_on = None - self.full_load_total_rows = None - self.state = None - self.total_changes_applied = None - self.data_errors_counter = None - self.last_modified_time = None - - -class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: - ~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: - list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateSchemaSqlServerSqlDbDatabaseInput(msrest.serialization.Model): - """Database input for migrate schema Sql Server to Azure SQL Server scenario. - - :param name: Name of source database. - :type name: str - :param target_database_name: Name of target database. - :type target_database_name: str - :param schema_setting: Database schema migration settings. - :type schema_setting: ~azure.mgmt.datamigration.models.SchemaMigrationSetting - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'schema_setting': {'key': 'schemaSetting', 'type': 'SchemaMigrationSetting'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSchemaSqlServerSqlDbDatabaseInput, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.target_database_name = kwargs.get('target_database_name', None) - self.schema_setting = kwargs.get('schema_setting', None) - - -class SqlMigrationTaskInput(msrest.serialization.Model): - """Base class for migration task input. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(SqlMigrationTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.target_connection_info = kwargs['target_connection_info'] - - -class MigrateSchemaSqlServerSqlDbTaskInput(SqlMigrationTaskInput): - """Input for task that migrates Schema for SQL Server databases to Azure SQL databases. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbDatabaseInput] - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'selected_databases': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSchemaSqlServerSqlDbDatabaseInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSchemaSqlServerSqlDbTaskInput, self).__init__(**kwargs) - self.selected_databases = kwargs['selected_databases'] - - -class MigrateSchemaSqlServerSqlDbTaskOutput(msrest.serialization.Model): - """Output for the task that migrates Schema for SQL Server databases to Azure SQL databases. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel, MigrateSchemaSqlTaskOutputError, MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel, MigrateSchemaSqlServerSqlDbTaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'DatabaseLevelOutput': 'MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel', 'ErrorOutput': 'MigrateSchemaSqlTaskOutputError', 'MigrationLevelOutput': 'MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel', 'SchemaErrorOutput': 'MigrateSchemaSqlServerSqlDbTaskOutputError'} - } - - def __init__( - self, - **kwargs - ): - super(MigrateSchemaSqlServerSqlDbTaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(MigrateSchemaSqlServerSqlDbTaskOutput): - """MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar database_name: The name of the database. - :vartype database_name: str - :ivar state: State of the schema migration for this database. Possible values include: "None", - "InProgress", "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar stage: Schema migration stage for this database. Possible values include: "NotStarted", - "ValidatingInputs", "CollectingObjects", "DownloadingScript", "GeneratingScript", - "UploadingScript", "DeployingSchema", "Completed", "CompletedWithWarnings", "Failed". - :vartype stage: str or ~azure.mgmt.datamigration.models.SchemaMigrationStage - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar database_error_result_prefix: Prefix string to use for querying errors for this database. - :vartype database_error_result_prefix: str - :ivar schema_error_result_prefix: Prefix string to use for querying schema errors for this - database. - :vartype schema_error_result_prefix: str - :ivar number_of_successful_operations: Number of successful operations for this database. - :vartype number_of_successful_operations: long - :ivar number_of_failed_operations: Number of failed operations for this database. - :vartype number_of_failed_operations: long - :ivar file_id: Identifier for the file resource containing the schema of this database. - :vartype file_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'database_name': {'readonly': True}, - 'state': {'readonly': True}, - 'stage': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'database_error_result_prefix': {'readonly': True}, - 'schema_error_result_prefix': {'readonly': True}, - 'number_of_successful_operations': {'readonly': True}, - 'number_of_failed_operations': {'readonly': True}, - 'file_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'database_error_result_prefix': {'key': 'databaseErrorResultPrefix', 'type': 'str'}, - 'schema_error_result_prefix': {'key': 'schemaErrorResultPrefix', 'type': 'str'}, - 'number_of_successful_operations': {'key': 'numberOfSuccessfulOperations', 'type': 'long'}, - 'number_of_failed_operations': {'key': 'numberOfFailedOperations', 'type': 'long'}, - 'file_id': {'key': 'fileId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelOutput' # type: str - self.database_name = None - self.state = None - self.stage = None - self.started_on = None - self.ended_on = None - self.database_error_result_prefix = None - self.schema_error_result_prefix = None - self.number_of_successful_operations = None - self.number_of_failed_operations = None - self.file_id = None - - -class MigrateSchemaSqlServerSqlDbTaskOutputError(MigrateSchemaSqlServerSqlDbTaskOutput): - """MigrateSchemaSqlServerSqlDbTaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar command_text: Schema command which failed. - :vartype command_text: str - :ivar error_text: Reason of failure. - :vartype error_text: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'command_text': {'readonly': True}, - 'error_text': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'command_text': {'key': 'commandText', 'type': 'str'}, - 'error_text': {'key': 'errorText', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSchemaSqlServerSqlDbTaskOutputError, self).__init__(**kwargs) - self.result_type = 'SchemaErrorOutput' # type: str - self.command_text = None - self.error_text = None - - -class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(MigrateSchemaSqlServerSqlDbTaskOutput): - """MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar state: Overall state of the schema migration. Possible values include: "None", - "InProgress", "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server_brand_version: Source server brand version. - :vartype source_server_brand_version: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'state': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server_brand_version': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel, self).__init__(**kwargs) - self.result_type = 'MigrationLevelOutput' # type: str - self.state = None - self.started_on = None - self.ended_on = None - self.source_server_version = None - self.source_server_brand_version = None - self.target_server_version = None - self.target_server_brand_version = None - - -class MigrateSchemaSqlServerSqlDbTaskProperties(ProjectTaskProperties): - """Properties for task that migrates Schema for SQL Server databases to Azure SQL databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigrateSchemaSqlServerSqlDbTaskInput'}, - 'output': {'key': 'output', 'type': '[MigrateSchemaSqlServerSqlDbTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSchemaSqlServerSqlDbTaskProperties, self).__init__(**kwargs) - self.task_type = 'MigrateSchemaSqlServerSqlDb' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateSchemaSqlTaskOutputError(MigrateSchemaSqlServerSqlDbTaskOutput): - """MigrateSchemaSqlTaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar error: Migration error. - :vartype error: ~azure.mgmt.datamigration.models.ReportableException - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ReportableException'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSchemaSqlTaskOutputError, self).__init__(**kwargs) - self.result_type = 'ErrorOutput' # type: str - self.error = None - - -class MigrateSqlServerDatabaseInput(msrest.serialization.Model): - """Database specific information for SQL to SQL migration task inputs. - - :param name: Name of the database. - :type name: str - :param restore_database_name: Name of the database at destination. - :type restore_database_name: str - :param backup_and_restore_folder: The backup and restore folder. - :type backup_and_restore_folder: str - :param database_files: The list of database files. - :type database_files: list[~azure.mgmt.datamigration.models.DatabaseFileInput] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'restore_database_name': {'key': 'restoreDatabaseName', 'type': 'str'}, - 'backup_and_restore_folder': {'key': 'backupAndRestoreFolder', 'type': 'str'}, - 'database_files': {'key': 'databaseFiles', 'type': '[DatabaseFileInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerDatabaseInput, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.restore_database_name = kwargs.get('restore_database_name', None) - self.backup_and_restore_folder = kwargs.get('backup_and_restore_folder', None) - self.database_files = kwargs.get('database_files', None) - - -class MigrateSqlServerSqlDbDatabaseInput(msrest.serialization.Model): - """Database specific information for SQL to Azure SQL DB migration task inputs. - - :param name: Name of the database. - :type name: str - :param target_database_name: Name of target database. Note: Target database will be truncated - before starting migration. - :type target_database_name: str - :param make_source_db_read_only: Whether to set database read only before migration. - :type make_source_db_read_only: bool - :param table_map: Mapping of source to target tables. - :type table_map: dict[str, str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'make_source_db_read_only': {'key': 'makeSourceDbReadOnly', 'type': 'bool'}, - 'table_map': {'key': 'tableMap', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbDatabaseInput, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.target_database_name = kwargs.get('target_database_name', None) - self.make_source_db_read_only = kwargs.get('make_source_db_read_only', None) - self.table_map = kwargs.get('table_map', None) - - -class MigrateSqlServerSqlDbSyncDatabaseInput(msrest.serialization.Model): - """Database specific information for SQL to Azure SQL DB sync migration task inputs. - - :param id: Unique identifier for database. - :type id: str - :param name: Name of database. - :type name: str - :param target_database_name: Target database name. - :type target_database_name: str - :param schema_name: Schema name to be migrated. - :type schema_name: str - :param table_map: Mapping of source to target tables. - :type table_map: dict[str, str] - :param migration_setting: Migration settings which tune the migration behavior. - :type migration_setting: dict[str, str] - :param source_setting: Source settings to tune source endpoint migration behavior. - :type source_setting: dict[str, str] - :param target_setting: Target settings to tune target endpoint migration behavior. - :type target_setting: dict[str, str] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'schema_name': {'key': 'schemaName', 'type': 'str'}, - 'table_map': {'key': 'tableMap', 'type': '{str}'}, - 'migration_setting': {'key': 'migrationSetting', 'type': '{str}'}, - 'source_setting': {'key': 'sourceSetting', 'type': '{str}'}, - 'target_setting': {'key': 'targetSetting', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbSyncDatabaseInput, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.target_database_name = kwargs.get('target_database_name', None) - self.schema_name = kwargs.get('schema_name', None) - self.table_map = kwargs.get('table_map', None) - self.migration_setting = kwargs.get('migration_setting', None) - self.source_setting = kwargs.get('source_setting', None) - self.target_setting = kwargs.get('target_setting', None) - - -class MigrateSqlServerSqlDbSyncTaskInput(SqlMigrationTaskInput): - """Input for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncDatabaseInput] - :param validation_options: Validation options. - :type validation_options: ~azure.mgmt.datamigration.models.MigrationValidationOptions - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'selected_databases': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSqlServerSqlDbSyncDatabaseInput]'}, - 'validation_options': {'key': 'validationOptions', 'type': 'MigrationValidationOptions'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbSyncTaskInput, self).__init__(**kwargs) - self.selected_databases = kwargs['selected_databases'] - self.validation_options = kwargs.get('validation_options', None) - - -class MigrateSqlServerSqlDbSyncTaskOutput(msrest.serialization.Model): - """Output for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigrateSqlServerSqlDbSyncTaskOutputDatabaseError, MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel, MigrateSqlServerSqlDbSyncTaskOutputError, MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel, MigrateSqlServerSqlDbSyncTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'DatabaseLevelErrorOutput': 'MigrateSqlServerSqlDbSyncTaskOutputDatabaseError', 'DatabaseLevelOutput': 'MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel', 'ErrorOutput': 'MigrateSqlServerSqlDbSyncTaskOutputError', 'MigrationLevelOutput': 'MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel', 'TableLevelOutput': 'MigrateSqlServerSqlDbSyncTaskOutputTableLevel'} - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbSyncTaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class MigrateSqlServerSqlDbSyncTaskOutputDatabaseError(MigrateSqlServerSqlDbSyncTaskOutput): - """MigrateSqlServerSqlDbSyncTaskOutputDatabaseError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :param error_message: Error message. - :type error_message: str - :param events: List of error events. - :type events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'events': {'key': 'events', 'type': '[SyncMigrationDatabaseErrorEvent]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelErrorOutput' # type: str - self.error_message = kwargs.get('error_message', None) - self.events = kwargs.get('events', None) - - -class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(MigrateSqlServerSqlDbSyncTaskOutput): - """MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar database_name: Name of the database. - :vartype database_name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar migration_state: Migration state that this database is in. Possible values include: - "UNDEFINED", "CONFIGURING", "INITIALIAZING", "STARTING", "RUNNING", "READY_TO_COMPLETE", - "COMPLETING", "COMPLETE", "CANCELLING", "CANCELLED", "FAILED", "VALIDATING", - "VALIDATION_COMPLETE", "VALIDATION_FAILED", "RESTORE_IN_PROGRESS", "RESTORE_COMPLETED", - "BACKUP_IN_PROGRESS", "BACKUP_COMPLETED". - :vartype migration_state: str or - ~azure.mgmt.datamigration.models.SyncDatabaseMigrationReportingState - :ivar incoming_changes: Number of incoming changes. - :vartype incoming_changes: long - :ivar applied_changes: Number of applied changes. - :vartype applied_changes: long - :ivar cdc_insert_counter: Number of cdc inserts. - :vartype cdc_insert_counter: long - :ivar cdc_delete_counter: Number of cdc deletes. - :vartype cdc_delete_counter: long - :ivar cdc_update_counter: Number of cdc updates. - :vartype cdc_update_counter: long - :ivar full_load_completed_tables: Number of tables completed in full load. - :vartype full_load_completed_tables: long - :ivar full_load_loading_tables: Number of tables loading in full load. - :vartype full_load_loading_tables: long - :ivar full_load_queued_tables: Number of tables queued in full load. - :vartype full_load_queued_tables: long - :ivar full_load_errored_tables: Number of tables errored in full load. - :vartype full_load_errored_tables: long - :ivar initialization_completed: Indicates if initial load (full load) has been completed. - :vartype initialization_completed: bool - :ivar latency: CDC apply latency. - :vartype latency: long - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'database_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'migration_state': {'readonly': True}, - 'incoming_changes': {'readonly': True}, - 'applied_changes': {'readonly': True}, - 'cdc_insert_counter': {'readonly': True}, - 'cdc_delete_counter': {'readonly': True}, - 'cdc_update_counter': {'readonly': True}, - 'full_load_completed_tables': {'readonly': True}, - 'full_load_loading_tables': {'readonly': True}, - 'full_load_queued_tables': {'readonly': True}, - 'full_load_errored_tables': {'readonly': True}, - 'initialization_completed': {'readonly': True}, - 'latency': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'migration_state': {'key': 'migrationState', 'type': 'str'}, - 'incoming_changes': {'key': 'incomingChanges', 'type': 'long'}, - 'applied_changes': {'key': 'appliedChanges', 'type': 'long'}, - 'cdc_insert_counter': {'key': 'cdcInsertCounter', 'type': 'long'}, - 'cdc_delete_counter': {'key': 'cdcDeleteCounter', 'type': 'long'}, - 'cdc_update_counter': {'key': 'cdcUpdateCounter', 'type': 'long'}, - 'full_load_completed_tables': {'key': 'fullLoadCompletedTables', 'type': 'long'}, - 'full_load_loading_tables': {'key': 'fullLoadLoadingTables', 'type': 'long'}, - 'full_load_queued_tables': {'key': 'fullLoadQueuedTables', 'type': 'long'}, - 'full_load_errored_tables': {'key': 'fullLoadErroredTables', 'type': 'long'}, - 'initialization_completed': {'key': 'initializationCompleted', 'type': 'bool'}, - 'latency': {'key': 'latency', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelOutput' # type: str - self.database_name = None - self.started_on = None - self.ended_on = None - self.migration_state = None - self.incoming_changes = None - self.applied_changes = None - self.cdc_insert_counter = None - self.cdc_delete_counter = None - self.cdc_update_counter = None - self.full_load_completed_tables = None - self.full_load_loading_tables = None - self.full_load_queued_tables = None - self.full_load_errored_tables = None - self.initialization_completed = None - self.latency = None - - -class MigrateSqlServerSqlDbSyncTaskOutputError(MigrateSqlServerSqlDbSyncTaskOutput): - """MigrateSqlServerSqlDbSyncTaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar error: Migration error. - :vartype error: ~azure.mgmt.datamigration.models.ReportableException - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ReportableException'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbSyncTaskOutputError, self).__init__(**kwargs) - self.result_type = 'ErrorOutput' # type: str - self.error = None - - -class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(MigrateSqlServerSqlDbSyncTaskOutput): - """MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server: Source server name. - :vartype source_server: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server: Target server name. - :vartype target_server: str - :ivar database_count: Count of databases. - :vartype database_count: int - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server': {'readonly': True}, - 'database_count': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server': {'key': 'sourceServer', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server': {'key': 'targetServer', 'type': 'str'}, - 'database_count': {'key': 'databaseCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel, self).__init__(**kwargs) - self.result_type = 'MigrationLevelOutput' # type: str - self.started_on = None - self.ended_on = None - self.source_server_version = None - self.source_server = None - self.target_server_version = None - self.target_server = None - self.database_count = None - - -class MigrateSqlServerSqlDbSyncTaskOutputTableLevel(MigrateSqlServerSqlDbSyncTaskOutput): - """MigrateSqlServerSqlDbSyncTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar table_name: Name of the table. - :vartype table_name: str - :ivar database_name: Name of the database. - :vartype database_name: str - :ivar cdc_insert_counter: Number of applied inserts. - :vartype cdc_insert_counter: long - :ivar cdc_update_counter: Number of applied updates. - :vartype cdc_update_counter: long - :ivar cdc_delete_counter: Number of applied deletes. - :vartype cdc_delete_counter: long - :ivar full_load_est_finish_time: Estimate to finish full load. - :vartype full_load_est_finish_time: ~datetime.datetime - :ivar full_load_started_on: Full load start time. - :vartype full_load_started_on: ~datetime.datetime - :ivar full_load_ended_on: Full load end time. - :vartype full_load_ended_on: ~datetime.datetime - :ivar full_load_total_rows: Number of rows applied in full load. - :vartype full_load_total_rows: long - :ivar state: Current state of the table migration. Possible values include: "BEFORE_LOAD", - "FULL_LOAD", "COMPLETED", "CANCELED", "ERROR", "FAILED". - :vartype state: str or ~azure.mgmt.datamigration.models.SyncTableMigrationState - :ivar total_changes_applied: Total number of applied changes. - :vartype total_changes_applied: long - :ivar data_errors_counter: Number of data errors occurred. - :vartype data_errors_counter: long - :ivar last_modified_time: Last modified time on target. - :vartype last_modified_time: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'table_name': {'readonly': True}, - 'database_name': {'readonly': True}, - 'cdc_insert_counter': {'readonly': True}, - 'cdc_update_counter': {'readonly': True}, - 'cdc_delete_counter': {'readonly': True}, - 'full_load_est_finish_time': {'readonly': True}, - 'full_load_started_on': {'readonly': True}, - 'full_load_ended_on': {'readonly': True}, - 'full_load_total_rows': {'readonly': True}, - 'state': {'readonly': True}, - 'total_changes_applied': {'readonly': True}, - 'data_errors_counter': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'cdc_insert_counter': {'key': 'cdcInsertCounter', 'type': 'long'}, - 'cdc_update_counter': {'key': 'cdcUpdateCounter', 'type': 'long'}, - 'cdc_delete_counter': {'key': 'cdcDeleteCounter', 'type': 'long'}, - 'full_load_est_finish_time': {'key': 'fullLoadEstFinishTime', 'type': 'iso-8601'}, - 'full_load_started_on': {'key': 'fullLoadStartedOn', 'type': 'iso-8601'}, - 'full_load_ended_on': {'key': 'fullLoadEndedOn', 'type': 'iso-8601'}, - 'full_load_total_rows': {'key': 'fullLoadTotalRows', 'type': 'long'}, - 'state': {'key': 'state', 'type': 'str'}, - 'total_changes_applied': {'key': 'totalChangesApplied', 'type': 'long'}, - 'data_errors_counter': {'key': 'dataErrorsCounter', 'type': 'long'}, - 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbSyncTaskOutputTableLevel, self).__init__(**kwargs) - self.result_type = 'TableLevelOutput' # type: str - self.table_name = None - self.database_name = None - self.cdc_insert_counter = None - self.cdc_update_counter = None - self.cdc_delete_counter = None - self.full_load_est_finish_time = None - self.full_load_started_on = None - self.full_load_ended_on = None - self.full_load_total_rows = None - self.state = None - self.total_changes_applied = None - self.data_errors_counter = None - self.last_modified_time = None - - -class MigrateSqlServerSqlDbSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigrateSqlServerSqlDbSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[MigrateSqlServerSqlDbSyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'Migrate.SqlServer.AzureSqlDb.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateSqlServerSqlDbTaskInput(SqlMigrationTaskInput): - """Input for the task that migrates on-prem SQL Server databases to Azure SQL Database. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbDatabaseInput] - :param validation_options: Options for enabling various post migration validations. Available - options, - 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables - after the migration to ensure the correctness of the data. - 2.) Schema Validation: Performs a thorough schema comparison between the source and target - tables and provides a list of differences between the source and target database, 3.) Query - Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or - Query Store and execute them and compares the execution time between the source and target - database. - :type validation_options: ~azure.mgmt.datamigration.models.MigrationValidationOptions - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'selected_databases': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSqlServerSqlDbDatabaseInput]'}, - 'validation_options': {'key': 'validationOptions', 'type': 'MigrationValidationOptions'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbTaskInput, self).__init__(**kwargs) - self.selected_databases = kwargs['selected_databases'] - self.validation_options = kwargs.get('validation_options', None) - - -class MigrateSqlServerSqlDbTaskOutput(msrest.serialization.Model): - """Output for the task that migrates on-prem SQL Server databases to Azure SQL Database. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigrateSqlServerSqlDbTaskOutputDatabaseLevel, MigrateSqlServerSqlDbTaskOutputError, MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult, MigrateSqlServerSqlDbTaskOutputMigrationLevel, MigrateSqlServerSqlDbTaskOutputValidationResult, MigrateSqlServerSqlDbTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'DatabaseLevelOutput': 'MigrateSqlServerSqlDbTaskOutputDatabaseLevel', 'ErrorOutput': 'MigrateSqlServerSqlDbTaskOutputError', 'MigrationDatabaseLevelValidationOutput': 'MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult', 'MigrationLevelOutput': 'MigrateSqlServerSqlDbTaskOutputMigrationLevel', 'MigrationValidationOutput': 'MigrateSqlServerSqlDbTaskOutputValidationResult', 'TableLevelOutput': 'MigrateSqlServerSqlDbTaskOutputTableLevel'} - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbTaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class MigrateSqlServerSqlDbTaskOutputDatabaseLevel(MigrateSqlServerSqlDbTaskOutput): - """MigrateSqlServerSqlDbTaskOutputDatabaseLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar database_name: Name of the item. - :vartype database_name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar stage: Migration stage that this database is in. Possible values include: "None", - "Initialize", "Backup", "FileCopy", "Restore", "Completed". - :vartype stage: str or ~azure.mgmt.datamigration.models.DatabaseMigrationStage - :ivar status_message: Status message. - :vartype status_message: str - :ivar message: Migration progress message. - :vartype message: str - :ivar number_of_objects: Number of objects. - :vartype number_of_objects: long - :ivar number_of_objects_completed: Number of successfully completed objects. - :vartype number_of_objects_completed: long - :ivar error_count: Number of database/object errors. - :vartype error_count: long - :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item. - :vartype error_prefix: str - :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the - item. - :vartype result_prefix: str - :ivar exceptions_and_warnings: Migration exceptions and warnings. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - :ivar object_summary: Summary of object results in the migration. - :vartype object_summary: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'database_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'state': {'readonly': True}, - 'stage': {'readonly': True}, - 'status_message': {'readonly': True}, - 'message': {'readonly': True}, - 'number_of_objects': {'readonly': True}, - 'number_of_objects_completed': {'readonly': True}, - 'error_count': {'readonly': True}, - 'error_prefix': {'readonly': True}, - 'result_prefix': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - 'object_summary': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'state': {'key': 'state', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'status_message': {'key': 'statusMessage', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'number_of_objects': {'key': 'numberOfObjects', 'type': 'long'}, - 'number_of_objects_completed': {'key': 'numberOfObjectsCompleted', 'type': 'long'}, - 'error_count': {'key': 'errorCount', 'type': 'long'}, - 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, - 'result_prefix': {'key': 'resultPrefix', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - 'object_summary': {'key': 'objectSummary', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbTaskOutputDatabaseLevel, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelOutput' # type: str - self.database_name = None - self.started_on = None - self.ended_on = None - self.state = None - self.stage = None - self.status_message = None - self.message = None - self.number_of_objects = None - self.number_of_objects_completed = None - self.error_count = None - self.error_prefix = None - self.result_prefix = None - self.exceptions_and_warnings = None - self.object_summary = None - - -class MigrationValidationDatabaseLevelResult(msrest.serialization.Model): - """Database level validation results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar migration_id: Migration Identifier. - :vartype migration_id: str - :ivar source_database_name: Name of the source database. - :vartype source_database_name: str - :ivar target_database_name: Name of the target database. - :vartype target_database_name: str - :ivar started_on: Validation start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Validation end time. - :vartype ended_on: ~datetime.datetime - :ivar data_integrity_validation_result: Provides data integrity validation result between the - source and target tables that are migrated. - :vartype data_integrity_validation_result: - ~azure.mgmt.datamigration.models.DataIntegrityValidationResult - :ivar schema_validation_result: Provides schema comparison result between source and target - database. - :vartype schema_validation_result: - ~azure.mgmt.datamigration.models.SchemaComparisonValidationResult - :ivar query_analysis_validation_result: Results of some of the query execution result between - source and target database. - :vartype query_analysis_validation_result: - ~azure.mgmt.datamigration.models.QueryAnalysisValidationResult - :ivar status: Current status of validation at the database level. Possible values include: - "Default", "NotStarted", "Initialized", "InProgress", "Completed", "CompletedWithIssues", - "Stopped", "Failed". - :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'migration_id': {'readonly': True}, - 'source_database_name': {'readonly': True}, - 'target_database_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'data_integrity_validation_result': {'readonly': True}, - 'schema_validation_result': {'readonly': True}, - 'query_analysis_validation_result': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'migration_id': {'key': 'migrationId', 'type': 'str'}, - 'source_database_name': {'key': 'sourceDatabaseName', 'type': 'str'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'data_integrity_validation_result': {'key': 'dataIntegrityValidationResult', 'type': 'DataIntegrityValidationResult'}, - 'schema_validation_result': {'key': 'schemaValidationResult', 'type': 'SchemaComparisonValidationResult'}, - 'query_analysis_validation_result': {'key': 'queryAnalysisValidationResult', 'type': 'QueryAnalysisValidationResult'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationValidationDatabaseLevelResult, self).__init__(**kwargs) - self.id = None - self.migration_id = None - self.source_database_name = None - self.target_database_name = None - self.started_on = None - self.ended_on = None - self.data_integrity_validation_result = None - self.schema_validation_result = None - self.query_analysis_validation_result = None - self.status = None - - -class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(MigrateSqlServerSqlDbTaskOutput, MigrationValidationDatabaseLevelResult): - """MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar migration_id: Migration Identifier. - :vartype migration_id: str - :ivar source_database_name: Name of the source database. - :vartype source_database_name: str - :ivar target_database_name: Name of the target database. - :vartype target_database_name: str - :ivar started_on: Validation start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Validation end time. - :vartype ended_on: ~datetime.datetime - :ivar data_integrity_validation_result: Provides data integrity validation result between the - source and target tables that are migrated. - :vartype data_integrity_validation_result: - ~azure.mgmt.datamigration.models.DataIntegrityValidationResult - :ivar schema_validation_result: Provides schema comparison result between source and target - database. - :vartype schema_validation_result: - ~azure.mgmt.datamigration.models.SchemaComparisonValidationResult - :ivar query_analysis_validation_result: Results of some of the query execution result between - source and target database. - :vartype query_analysis_validation_result: - ~azure.mgmt.datamigration.models.QueryAnalysisValidationResult - :ivar status: Current status of validation at the database level. Possible values include: - "Default", "NotStarted", "Initialized", "InProgress", "Completed", "CompletedWithIssues", - "Stopped", "Failed". - :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'migration_id': {'readonly': True}, - 'source_database_name': {'readonly': True}, - 'target_database_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'data_integrity_validation_result': {'readonly': True}, - 'schema_validation_result': {'readonly': True}, - 'query_analysis_validation_result': {'readonly': True}, - 'status': {'readonly': True}, - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'migration_id': {'key': 'migrationId', 'type': 'str'}, - 'source_database_name': {'key': 'sourceDatabaseName', 'type': 'str'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'data_integrity_validation_result': {'key': 'dataIntegrityValidationResult', 'type': 'DataIntegrityValidationResult'}, - 'schema_validation_result': {'key': 'schemaValidationResult', 'type': 'SchemaComparisonValidationResult'}, - 'query_analysis_validation_result': {'key': 'queryAnalysisValidationResult', 'type': 'QueryAnalysisValidationResult'}, - 'status': {'key': 'status', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult, self).__init__(**kwargs) - self.migration_id = None - self.source_database_name = None - self.target_database_name = None - self.started_on = None - self.ended_on = None - self.data_integrity_validation_result = None - self.schema_validation_result = None - self.query_analysis_validation_result = None - self.status = None - self.result_type = 'MigrationDatabaseLevelValidationOutput' # type: str - self.id = None - self.result_type = 'MigrationDatabaseLevelValidationOutput' # type: str - - -class MigrateSqlServerSqlDbTaskOutputError(MigrateSqlServerSqlDbTaskOutput): - """MigrateSqlServerSqlDbTaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar error: Migration error. - :vartype error: ~azure.mgmt.datamigration.models.ReportableException - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ReportableException'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbTaskOutputError, self).__init__(**kwargs) - self.result_type = 'ErrorOutput' # type: str - self.error = None - - -class MigrateSqlServerSqlDbTaskOutputMigrationLevel(MigrateSqlServerSqlDbTaskOutput): - """MigrateSqlServerSqlDbTaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar duration_in_seconds: Duration of task execution in seconds. - :vartype duration_in_seconds: long - :ivar status: Current status of migration. Possible values include: "Default", "Connecting", - "SourceAndTargetSelected", "SelectLogins", "Configured", "Running", "Error", "Stopped", - "Completed", "CompletedWithWarnings". - :vartype status: str or ~azure.mgmt.datamigration.models.MigrationStatus - :ivar status_message: Migration status message. - :vartype status_message: str - :ivar message: Migration progress message. - :vartype message: str - :ivar databases: Selected databases as a map from database name to database id. - :vartype databases: str - :ivar database_summary: Summary of database results in the migration. - :vartype database_summary: str - :param migration_validation_result: Migration Validation Results. - :type migration_validation_result: ~azure.mgmt.datamigration.models.MigrationValidationResult - :param migration_report_result: Migration Report Result, provides unique url for downloading - your migration report. - :type migration_report_result: ~azure.mgmt.datamigration.models.MigrationReportResult - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server_brand_version: Source server brand version. - :vartype source_server_brand_version: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - :ivar exceptions_and_warnings: Migration exceptions and warnings. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'duration_in_seconds': {'readonly': True}, - 'status': {'readonly': True}, - 'status_message': {'readonly': True}, - 'message': {'readonly': True}, - 'databases': {'readonly': True}, - 'database_summary': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server_brand_version': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'long'}, - 'status': {'key': 'status', 'type': 'str'}, - 'status_message': {'key': 'statusMessage', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'databases': {'key': 'databases', 'type': 'str'}, - 'database_summary': {'key': 'databaseSummary', 'type': 'str'}, - 'migration_validation_result': {'key': 'migrationValidationResult', 'type': 'MigrationValidationResult'}, - 'migration_report_result': {'key': 'migrationReportResult', 'type': 'MigrationReportResult'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbTaskOutputMigrationLevel, self).__init__(**kwargs) - self.result_type = 'MigrationLevelOutput' # type: str - self.started_on = None - self.ended_on = None - self.duration_in_seconds = None - self.status = None - self.status_message = None - self.message = None - self.databases = None - self.database_summary = None - self.migration_validation_result = kwargs.get('migration_validation_result', None) - self.migration_report_result = kwargs.get('migration_report_result', None) - self.source_server_version = None - self.source_server_brand_version = None - self.target_server_version = None - self.target_server_brand_version = None - self.exceptions_and_warnings = None - - -class MigrateSqlServerSqlDbTaskOutputTableLevel(MigrateSqlServerSqlDbTaskOutput): - """MigrateSqlServerSqlDbTaskOutputTableLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar object_name: Name of the item. - :vartype object_name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar status_message: Status message. - :vartype status_message: str - :ivar items_count: Number of items. - :vartype items_count: long - :ivar items_completed_count: Number of successfully completed items. - :vartype items_completed_count: long - :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item. - :vartype error_prefix: str - :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the - item. - :vartype result_prefix: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'object_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'state': {'readonly': True}, - 'status_message': {'readonly': True}, - 'items_count': {'readonly': True}, - 'items_completed_count': {'readonly': True}, - 'error_prefix': {'readonly': True}, - 'result_prefix': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'object_name': {'key': 'objectName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'state': {'key': 'state', 'type': 'str'}, - 'status_message': {'key': 'statusMessage', 'type': 'str'}, - 'items_count': {'key': 'itemsCount', 'type': 'long'}, - 'items_completed_count': {'key': 'itemsCompletedCount', 'type': 'long'}, - 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, - 'result_prefix': {'key': 'resultPrefix', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbTaskOutputTableLevel, self).__init__(**kwargs) - self.result_type = 'TableLevelOutput' # type: str - self.object_name = None - self.started_on = None - self.ended_on = None - self.state = None - self.status_message = None - self.items_count = None - self.items_completed_count = None - self.error_prefix = None - self.result_prefix = None - - -class MigrationValidationResult(msrest.serialization.Model): - """Migration Validation Result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Migration validation result identifier. - :vartype id: str - :ivar migration_id: Migration Identifier. - :vartype migration_id: str - :param summary_results: Validation summary results for each database. - :type summary_results: dict[str, - ~azure.mgmt.datamigration.models.MigrationValidationDatabaseSummaryResult] - :ivar status: Current status of validation at the migration level. Status from the database - validation result status will be aggregated here. Possible values include: "Default", - "NotStarted", "Initialized", "InProgress", "Completed", "CompletedWithIssues", "Stopped", - "Failed". - :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'migration_id': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'migration_id': {'key': 'migrationId', 'type': 'str'}, - 'summary_results': {'key': 'summaryResults', 'type': '{MigrationValidationDatabaseSummaryResult}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationValidationResult, self).__init__(**kwargs) - self.id = None - self.migration_id = None - self.summary_results = kwargs.get('summary_results', None) - self.status = None - - -class MigrateSqlServerSqlDbTaskOutputValidationResult(MigrateSqlServerSqlDbTaskOutput, MigrationValidationResult): - """MigrateSqlServerSqlDbTaskOutputValidationResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar migration_id: Migration Identifier. - :vartype migration_id: str - :param summary_results: Validation summary results for each database. - :type summary_results: dict[str, - ~azure.mgmt.datamigration.models.MigrationValidationDatabaseSummaryResult] - :ivar status: Current status of validation at the migration level. Status from the database - validation result status will be aggregated here. Possible values include: "Default", - "NotStarted", "Initialized", "InProgress", "Completed", "CompletedWithIssues", "Stopped", - "Failed". - :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'migration_id': {'readonly': True}, - 'status': {'readonly': True}, - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'migration_id': {'key': 'migrationId', 'type': 'str'}, - 'summary_results': {'key': 'summaryResults', 'type': '{MigrationValidationDatabaseSummaryResult}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbTaskOutputValidationResult, self).__init__(**kwargs) - self.migration_id = None - self.summary_results = kwargs.get('summary_results', None) - self.status = None - self.result_type = 'MigrationValidationOutput' # type: str - self.id = None - self.result_type = 'MigrationValidationOutput' # type: str - - -class MigrateSqlServerSqlDbTaskProperties(ProjectTaskProperties): - """Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigrateSqlServerSqlDbTaskInput'}, - 'output': {'key': 'output', 'type': '[MigrateSqlServerSqlDbTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlDbTaskProperties, self).__init__(**kwargs) - self.task_type = 'Migrate.SqlServer.SqlDb' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateSqlServerSqlMIDatabaseInput(msrest.serialization.Model): - """Database specific information for SQL to Azure SQL DB Managed Instance migration task inputs. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Name of the database. - :type name: str - :param restore_database_name: Required. Name of the database at destination. - :type restore_database_name: str - :param backup_file_share: Backup file share information for backing up this database. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param backup_file_paths: The list of backup files to be used in case of existing backups. - :type backup_file_paths: list[str] - """ - - _validation = { - 'name': {'required': True}, - 'restore_database_name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'restore_database_name': {'key': 'restoreDatabaseName', 'type': 'str'}, - 'backup_file_share': {'key': 'backupFileShare', 'type': 'FileShare'}, - 'backup_file_paths': {'key': 'backupFilePaths', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMIDatabaseInput, self).__init__(**kwargs) - self.name = kwargs['name'] - self.restore_database_name = kwargs['restore_database_name'] - self.backup_file_share = kwargs.get('backup_file_share', None) - self.backup_file_paths = kwargs.get('backup_file_paths', None) - - -class SqlServerSqlMISyncTaskInput(msrest.serialization.Model): - """Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. - - All required parameters must be populated in order to send to Azure. - - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] - :param backup_file_share: Backup file share information for all selected databases. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param storage_resource_id: Required. Fully qualified resourceId of storage. - :type storage_resource_id: str - :param source_connection_info: Required. Connection information for source SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Connection information for Azure SQL Database Managed - Instance. - :type target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo - :param azure_app: Required. Azure Active Directory Application the DMS instance will use to - connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage - Account. - :type azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp - """ - - _validation = { - 'selected_databases': {'required': True}, - 'storage_resource_id': {'required': True}, - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'azure_app': {'required': True}, - } - - _attribute_map = { - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSqlServerSqlMIDatabaseInput]'}, - 'backup_file_share': {'key': 'backupFileShare', 'type': 'FileShare'}, - 'storage_resource_id': {'key': 'storageResourceId', 'type': 'str'}, - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'MiSqlConnectionInfo'}, - 'azure_app': {'key': 'azureApp', 'type': 'AzureActiveDirectoryApp'}, - } - - def __init__( - self, - **kwargs - ): - super(SqlServerSqlMISyncTaskInput, self).__init__(**kwargs) - self.selected_databases = kwargs['selected_databases'] - self.backup_file_share = kwargs.get('backup_file_share', None) - self.storage_resource_id = kwargs['storage_resource_id'] - self.source_connection_info = kwargs['source_connection_info'] - self.target_connection_info = kwargs['target_connection_info'] - self.azure_app = kwargs['azure_app'] - - -class MigrateSqlServerSqlMISyncTaskInput(SqlServerSqlMISyncTaskInput): - """Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. - - All required parameters must be populated in order to send to Azure. - - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] - :param backup_file_share: Backup file share information for all selected databases. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param storage_resource_id: Required. Fully qualified resourceId of storage. - :type storage_resource_id: str - :param source_connection_info: Required. Connection information for source SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Connection information for Azure SQL Database Managed - Instance. - :type target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo - :param azure_app: Required. Azure Active Directory Application the DMS instance will use to - connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage - Account. - :type azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp - """ - - _validation = { - 'selected_databases': {'required': True}, - 'storage_resource_id': {'required': True}, - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'azure_app': {'required': True}, - } - - _attribute_map = { - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSqlServerSqlMIDatabaseInput]'}, - 'backup_file_share': {'key': 'backupFileShare', 'type': 'FileShare'}, - 'storage_resource_id': {'key': 'storageResourceId', 'type': 'str'}, - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'MiSqlConnectionInfo'}, - 'azure_app': {'key': 'azureApp', 'type': 'AzureActiveDirectoryApp'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMISyncTaskInput, self).__init__(**kwargs) - - -class MigrateSqlServerSqlMISyncTaskOutput(msrest.serialization.Model): - """Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance using Log Replay Service. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel, MigrateSqlServerSqlMISyncTaskOutputError, MigrateSqlServerSqlMISyncTaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'DatabaseLevelOutput': 'MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel', 'ErrorOutput': 'MigrateSqlServerSqlMISyncTaskOutputError', 'MigrationLevelOutput': 'MigrateSqlServerSqlMISyncTaskOutputMigrationLevel'} - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMISyncTaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel(MigrateSqlServerSqlMISyncTaskOutput): - """MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar source_database_name: Name of the database. - :vartype source_database_name: str - :ivar migration_state: Current state of database. Possible values include: "UNDEFINED", - "INITIAL", "FULL_BACKUP_UPLOAD_START", "LOG_SHIPPING_START", "UPLOAD_LOG_FILES_START", - "CUTOVER_START", "POST_CUTOVER_COMPLETE", "COMPLETED", "CANCELLED", "FAILED". - :vartype migration_state: str or ~azure.mgmt.datamigration.models.DatabaseMigrationState - :ivar started_on: Database migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Database migration end time. - :vartype ended_on: ~datetime.datetime - :ivar full_backup_set_info: Details of full backup set. - :vartype full_backup_set_info: ~azure.mgmt.datamigration.models.BackupSetInfo - :ivar last_restored_backup_set_info: Last applied backup set information. - :vartype last_restored_backup_set_info: ~azure.mgmt.datamigration.models.BackupSetInfo - :ivar active_backup_sets: Backup sets that are currently active (Either being uploaded or - getting restored). - :vartype active_backup_sets: list[~azure.mgmt.datamigration.models.BackupSetInfo] - :ivar container_name: Name of container created in the Azure Storage account where backups are - copied to. - :vartype container_name: str - :ivar error_prefix: prefix string to use for querying errors for this database. - :vartype error_prefix: str - :ivar is_full_backup_restored: Whether full backup has been applied to the target database or - not. - :vartype is_full_backup_restored: bool - :ivar exceptions_and_warnings: Migration exceptions and warnings. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'source_database_name': {'readonly': True}, - 'migration_state': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'full_backup_set_info': {'readonly': True}, - 'last_restored_backup_set_info': {'readonly': True}, - 'active_backup_sets': {'readonly': True}, - 'container_name': {'readonly': True}, - 'error_prefix': {'readonly': True}, - 'is_full_backup_restored': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'source_database_name': {'key': 'sourceDatabaseName', 'type': 'str'}, - 'migration_state': {'key': 'migrationState', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'full_backup_set_info': {'key': 'fullBackupSetInfo', 'type': 'BackupSetInfo'}, - 'last_restored_backup_set_info': {'key': 'lastRestoredBackupSetInfo', 'type': 'BackupSetInfo'}, - 'active_backup_sets': {'key': 'activeBackupSets', 'type': '[BackupSetInfo]'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, - 'is_full_backup_restored': {'key': 'isFullBackupRestored', 'type': 'bool'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelOutput' # type: str - self.source_database_name = None - self.migration_state = None - self.started_on = None - self.ended_on = None - self.full_backup_set_info = None - self.last_restored_backup_set_info = None - self.active_backup_sets = None - self.container_name = None - self.error_prefix = None - self.is_full_backup_restored = None - self.exceptions_and_warnings = None - - -class MigrateSqlServerSqlMISyncTaskOutputError(MigrateSqlServerSqlMISyncTaskOutput): - """MigrateSqlServerSqlMISyncTaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar error: Migration error. - :vartype error: ~azure.mgmt.datamigration.models.ReportableException - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ReportableException'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMISyncTaskOutputError, self).__init__(**kwargs) - self.result_type = 'ErrorOutput' # type: str - self.error = None - - -class MigrateSqlServerSqlMISyncTaskOutputMigrationLevel(MigrateSqlServerSqlMISyncTaskOutput): - """MigrateSqlServerSqlMISyncTaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar database_count: Count of databases. - :vartype database_count: int - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar source_server_name: Source server name. - :vartype source_server_name: str - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server_brand_version: Source server brand version. - :vartype source_server_brand_version: str - :ivar target_server_name: Target server name. - :vartype target_server_name: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - :ivar database_error_count: Number of database level errors. - :vartype database_error_count: int - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'database_count': {'readonly': True}, - 'state': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'source_server_name': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server_brand_version': {'readonly': True}, - 'target_server_name': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - 'database_error_count': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'database_count': {'key': 'databaseCount', 'type': 'int'}, - 'state': {'key': 'state', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'source_server_name': {'key': 'sourceServerName', 'type': 'str'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, - 'target_server_name': {'key': 'targetServerName', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - 'database_error_count': {'key': 'databaseErrorCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMISyncTaskOutputMigrationLevel, self).__init__(**kwargs) - self.result_type = 'MigrationLevelOutput' # type: str - self.database_count = None - self.state = None - self.started_on = None - self.ended_on = None - self.source_server_name = None - self.source_server_version = None - self.source_server_brand_version = None - self.target_server_name = None - self.target_server_version = None - self.target_server_brand_version = None - self.database_error_count = None - - -class MigrateSqlServerSqlMISyncTaskProperties(ProjectTaskProperties): - """Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance sync scenario. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlMISyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMISyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigrateSqlServerSqlMISyncTaskInput'}, - 'output': {'key': 'output', 'type': '[MigrateSqlServerSqlMISyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMISyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'Migrate.SqlServer.AzureSqlDbMI.Sync.LRS' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateSqlServerSqlMITaskInput(SqlMigrationTaskInput): - """Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] - :param selected_logins: Logins to migrate. - :type selected_logins: list[str] - :param selected_agent_jobs: Agent Jobs to migrate. - :type selected_agent_jobs: list[str] - :param backup_file_share: Backup file share information for all selected databases. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param backup_blob_share: Required. SAS URI of Azure Storage Account Container to be used for - storing backup files. - :type backup_blob_share: ~azure.mgmt.datamigration.models.BlobShare - :param backup_mode: Backup Mode to specify whether to use existing backup or create new backup. - If using existing backups, backup file paths are required to be provided in selectedDatabases. - Possible values include: "CreateBackup", "ExistingBackup". - :type backup_mode: str or ~azure.mgmt.datamigration.models.BackupMode - :param aad_domain_name: Azure Active Directory domain name in the format of 'contoso.com' for - federated Azure AD or 'contoso.onmicrosoft.com' for managed domain, required if and only if - Windows logins are selected. - :type aad_domain_name: str - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'selected_databases': {'required': True}, - 'backup_blob_share': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSqlServerSqlMIDatabaseInput]'}, - 'selected_logins': {'key': 'selectedLogins', 'type': '[str]'}, - 'selected_agent_jobs': {'key': 'selectedAgentJobs', 'type': '[str]'}, - 'backup_file_share': {'key': 'backupFileShare', 'type': 'FileShare'}, - 'backup_blob_share': {'key': 'backupBlobShare', 'type': 'BlobShare'}, - 'backup_mode': {'key': 'backupMode', 'type': 'str'}, - 'aad_domain_name': {'key': 'aadDomainName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMITaskInput, self).__init__(**kwargs) - self.selected_databases = kwargs['selected_databases'] - self.selected_logins = kwargs.get('selected_logins', None) - self.selected_agent_jobs = kwargs.get('selected_agent_jobs', None) - self.backup_file_share = kwargs.get('backup_file_share', None) - self.backup_blob_share = kwargs['backup_blob_share'] - self.backup_mode = kwargs.get('backup_mode', None) - self.aad_domain_name = kwargs.get('aad_domain_name', None) - - -class MigrateSqlServerSqlMITaskOutput(msrest.serialization.Model): - """Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigrateSqlServerSqlMITaskOutputAgentJobLevel, MigrateSqlServerSqlMITaskOutputDatabaseLevel, MigrateSqlServerSqlMITaskOutputError, MigrateSqlServerSqlMITaskOutputLoginLevel, MigrateSqlServerSqlMITaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'AgentJobLevelOutput': 'MigrateSqlServerSqlMITaskOutputAgentJobLevel', 'DatabaseLevelOutput': 'MigrateSqlServerSqlMITaskOutputDatabaseLevel', 'ErrorOutput': 'MigrateSqlServerSqlMITaskOutputError', 'LoginLevelOutput': 'MigrateSqlServerSqlMITaskOutputLoginLevel', 'MigrationLevelOutput': 'MigrateSqlServerSqlMITaskOutputMigrationLevel'} - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMITaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class MigrateSqlServerSqlMITaskOutputAgentJobLevel(MigrateSqlServerSqlMITaskOutput): - """MigrateSqlServerSqlMITaskOutputAgentJobLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar name: Agent Job name. - :vartype name: str - :ivar is_enabled: The state of the original Agent Job. - :vartype is_enabled: bool - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar message: Migration progress message. - :vartype message: str - :ivar exceptions_and_warnings: Migration errors and warnings per job. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'name': {'readonly': True}, - 'is_enabled': {'readonly': True}, - 'state': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'message': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'state': {'key': 'state', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMITaskOutputAgentJobLevel, self).__init__(**kwargs) - self.result_type = 'AgentJobLevelOutput' # type: str - self.name = None - self.is_enabled = None - self.state = None - self.started_on = None - self.ended_on = None - self.message = None - self.exceptions_and_warnings = None - - -class MigrateSqlServerSqlMITaskOutputDatabaseLevel(MigrateSqlServerSqlMITaskOutput): - """MigrateSqlServerSqlMITaskOutputDatabaseLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar database_name: Name of the database. - :vartype database_name: str - :ivar size_mb: Size of the database in megabytes. - :vartype size_mb: float - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar stage: Current stage of migration. Possible values include: "None", "Initialize", - "Backup", "FileCopy", "Restore", "Completed". - :vartype stage: str or ~azure.mgmt.datamigration.models.DatabaseMigrationStage - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar message: Migration progress message. - :vartype message: str - :ivar exceptions_and_warnings: Migration exceptions and warnings. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'database_name': {'readonly': True}, - 'size_mb': {'readonly': True}, - 'state': {'readonly': True}, - 'stage': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'message': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'size_mb': {'key': 'sizeMB', 'type': 'float'}, - 'state': {'key': 'state', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMITaskOutputDatabaseLevel, self).__init__(**kwargs) - self.result_type = 'DatabaseLevelOutput' # type: str - self.database_name = None - self.size_mb = None - self.state = None - self.stage = None - self.started_on = None - self.ended_on = None - self.message = None - self.exceptions_and_warnings = None - - -class MigrateSqlServerSqlMITaskOutputError(MigrateSqlServerSqlMITaskOutput): - """MigrateSqlServerSqlMITaskOutputError. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar error: Migration error. - :vartype error: ~azure.mgmt.datamigration.models.ReportableException - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ReportableException'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMITaskOutputError, self).__init__(**kwargs) - self.result_type = 'ErrorOutput' # type: str - self.error = None - - -class MigrateSqlServerSqlMITaskOutputLoginLevel(MigrateSqlServerSqlMITaskOutput): - """MigrateSqlServerSqlMITaskOutputLoginLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar login_name: Login name. - :vartype login_name: str - :ivar state: Current state of login. Possible values include: "None", "InProgress", "Failed", - "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar stage: Current stage of login. Possible values include: "None", "Initialize", - "LoginMigration", "EstablishUserMapping", "AssignRoleMembership", "AssignRoleOwnership", - "EstablishServerPermissions", "EstablishObjectPermissions", "Completed". - :vartype stage: str or ~azure.mgmt.datamigration.models.LoginMigrationStage - :ivar started_on: Login migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Login migration end time. - :vartype ended_on: ~datetime.datetime - :ivar message: Login migration progress message. - :vartype message: str - :ivar exceptions_and_warnings: Login migration errors and warnings per login. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'login_name': {'readonly': True}, - 'state': {'readonly': True}, - 'stage': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'message': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'login_name': {'key': 'loginName', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMITaskOutputLoginLevel, self).__init__(**kwargs) - self.result_type = 'LoginLevelOutput' # type: str - self.login_name = None - self.state = None - self.stage = None - self.started_on = None - self.ended_on = None - self.message = None - self.exceptions_and_warnings = None - - -class MigrateSqlServerSqlMITaskOutputMigrationLevel(MigrateSqlServerSqlMITaskOutput): - """MigrateSqlServerSqlMITaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar status: Current status of migration. Possible values include: "Default", "Connecting", - "SourceAndTargetSelected", "SelectLogins", "Configured", "Running", "Error", "Stopped", - "Completed", "CompletedWithWarnings". - :vartype status: str or ~azure.mgmt.datamigration.models.MigrationStatus - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar agent_jobs: Selected agent jobs as a map from name to id. - :vartype agent_jobs: str - :ivar logins: Selected logins as a map from name to id. - :vartype logins: str - :ivar message: Migration progress message. - :vartype message: str - :ivar server_role_results: Map of server role migration results. - :vartype server_role_results: str - :ivar orphaned_users_info: List of orphaned users. - :vartype orphaned_users_info: list[~azure.mgmt.datamigration.models.OrphanedUserInfo] - :ivar databases: Selected databases as a map from database name to database id. - :vartype databases: str - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server_brand_version: Source server brand version. - :vartype source_server_brand_version: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - :ivar exceptions_and_warnings: Migration exceptions and warnings. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'status': {'readonly': True}, - 'state': {'readonly': True}, - 'agent_jobs': {'readonly': True}, - 'logins': {'readonly': True}, - 'message': {'readonly': True}, - 'server_role_results': {'readonly': True}, - 'orphaned_users_info': {'readonly': True}, - 'databases': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server_brand_version': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'agent_jobs': {'key': 'agentJobs', 'type': 'str'}, - 'logins': {'key': 'logins', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'server_role_results': {'key': 'serverRoleResults', 'type': 'str'}, - 'orphaned_users_info': {'key': 'orphanedUsersInfo', 'type': '[OrphanedUserInfo]'}, - 'databases': {'key': 'databases', 'type': 'str'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMITaskOutputMigrationLevel, self).__init__(**kwargs) - self.result_type = 'MigrationLevelOutput' # type: str - self.started_on = None - self.ended_on = None - self.status = None - self.state = None - self.agent_jobs = None - self.logins = None - self.message = None - self.server_role_results = None - self.orphaned_users_info = None - self.databases = None - self.source_server_version = None - self.source_server_brand_version = None - self.target_server_version = None - self.target_server_brand_version = None - self.exceptions_and_warnings = None - - -class MigrateSqlServerSqlMITaskProperties(ProjectTaskProperties): - """Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlMITaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMITaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigrateSqlServerSqlMITaskInput'}, - 'output': {'key': 'output', 'type': '[MigrateSqlServerSqlMITaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSqlServerSqlMITaskProperties, self).__init__(**kwargs) - self.task_type = 'Migrate.SqlServer.AzureSqlDbMI' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateSsisTaskInput(SqlMigrationTaskInput): - """Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param ssis_migration_info: Required. SSIS package migration information. - :type ssis_migration_info: ~azure.mgmt.datamigration.models.SsisMigrationInfo - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'ssis_migration_info': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'ssis_migration_info': {'key': 'ssisMigrationInfo', 'type': 'SsisMigrationInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSsisTaskInput, self).__init__(**kwargs) - self.ssis_migration_info = kwargs['ssis_migration_info'] - - -class MigrateSsisTaskOutput(msrest.serialization.Model): - """Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MigrateSsisTaskOutputMigrationLevel, MigrateSsisTaskOutputProjectLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - } - - _subtype_map = { - 'result_type': {'MigrationLevelOutput': 'MigrateSsisTaskOutputMigrationLevel', 'SsisProjectLevelOutput': 'MigrateSsisTaskOutputProjectLevel'} - } - - def __init__( - self, - **kwargs - ): - super(MigrateSsisTaskOutput, self).__init__(**kwargs) - self.id = None - self.result_type = None # type: Optional[str] - - -class MigrateSsisTaskOutputMigrationLevel(MigrateSsisTaskOutput): - """MigrateSsisTaskOutputMigrationLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar status: Current status of migration. Possible values include: "Default", "Connecting", - "SourceAndTargetSelected", "SelectLogins", "Configured", "Running", "Error", "Stopped", - "Completed", "CompletedWithWarnings". - :vartype status: str or ~azure.mgmt.datamigration.models.MigrationStatus - :ivar message: Migration progress message. - :vartype message: str - :ivar source_server_version: Source server version. - :vartype source_server_version: str - :ivar source_server_brand_version: Source server brand version. - :vartype source_server_brand_version: str - :ivar target_server_version: Target server version. - :vartype target_server_version: str - :ivar target_server_brand_version: Target server brand version. - :vartype target_server_brand_version: str - :ivar exceptions_and_warnings: Migration exceptions and warnings. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - :ivar stage: Stage of SSIS migration. Possible values include: "None", "Initialize", - "InProgress", "Completed". - :vartype stage: str or ~azure.mgmt.datamigration.models.SsisMigrationStage - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'status': {'readonly': True}, - 'message': {'readonly': True}, - 'source_server_version': {'readonly': True}, - 'source_server_brand_version': {'readonly': True}, - 'target_server_version': {'readonly': True}, - 'target_server_brand_version': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - 'stage': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, - 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, - 'target_server_version': {'key': 'targetServerVersion', 'type': 'str'}, - 'target_server_brand_version': {'key': 'targetServerBrandVersion', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSsisTaskOutputMigrationLevel, self).__init__(**kwargs) - self.result_type = 'MigrationLevelOutput' # type: str - self.started_on = None - self.ended_on = None - self.status = None - self.message = None - self.source_server_version = None - self.source_server_brand_version = None - self.target_server_version = None - self.target_server_brand_version = None - self.exceptions_and_warnings = None - self.stage = None - - -class MigrateSsisTaskOutputProjectLevel(MigrateSsisTaskOutput): - """MigrateSsisTaskOutputProjectLevel. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Result identifier. - :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :ivar folder_name: Name of the folder. - :vartype folder_name: str - :ivar project_name: Name of the project. - :vartype project_name: str - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar stage: Stage of SSIS migration. Possible values include: "None", "Initialize", - "InProgress", "Completed". - :vartype stage: str or ~azure.mgmt.datamigration.models.SsisMigrationStage - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar message: Migration progress message. - :vartype message: str - :ivar exceptions_and_warnings: Migration exceptions and warnings. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'result_type': {'required': True}, - 'folder_name': {'readonly': True}, - 'project_name': {'readonly': True}, - 'state': {'readonly': True}, - 'stage': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'message': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'folder_name': {'key': 'folderName', 'type': 'str'}, - 'project_name': {'key': 'projectName', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSsisTaskOutputProjectLevel, self).__init__(**kwargs) - self.result_type = 'SsisProjectLevelOutput' # type: str - self.folder_name = None - self.project_name = None - self.state = None - self.stage = None - self.started_on = None - self.ended_on = None - self.message = None - self.exceptions_and_warnings = None - - -class MigrateSsisTaskProperties(ProjectTaskProperties): - """Properties for task that migrates SSIS packages from SQL Server databases to Azure SQL Database Managed Instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSsisTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.MigrateSsisTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigrateSsisTaskInput'}, - 'output': {'key': 'output', 'type': '[MigrateSsisTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSsisTaskProperties, self).__init__(**kwargs) - self.task_type = 'Migrate.Ssis' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrateSyncCompleteCommandInput(msrest.serialization.Model): - """Input for command that completes sync migration for a database. - - All required parameters must be populated in order to send to Azure. - - :param database_name: Required. Name of database. - :type database_name: str - :param commit_time_stamp: Time stamp to complete. - :type commit_time_stamp: ~datetime.datetime - """ - - _validation = { - 'database_name': {'required': True}, - } - - _attribute_map = { - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'commit_time_stamp': {'key': 'commitTimeStamp', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSyncCompleteCommandInput, self).__init__(**kwargs) - self.database_name = kwargs['database_name'] - self.commit_time_stamp = kwargs.get('commit_time_stamp', None) - - -class MigrateSyncCompleteCommandOutput(msrest.serialization.Model): - """Output for command that completes sync migration for a database. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar errors: List of errors that happened during the command execution. - :vartype errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSyncCompleteCommandOutput, self).__init__(**kwargs) - self.id = None - self.errors = None - - -class MigrateSyncCompleteCommandProperties(CommandProperties): - """Properties for the command that completes sync migration for a database. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the command. This is ignored if submitted. Possible values include: - "Unknown", "Accepted", "Running", "Succeeded", "Failed". - :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - :param input: Command input. - :type input: ~azure.mgmt.datamigration.models.MigrateSyncCompleteCommandInput - :ivar output: Command output. This is ignored if submitted. - :vartype output: ~azure.mgmt.datamigration.models.MigrateSyncCompleteCommandOutput - """ - - _validation = { - 'command_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'command_type': {'key': 'commandType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'input': {'key': 'input', 'type': 'MigrateSyncCompleteCommandInput'}, - 'output': {'key': 'output', 'type': 'MigrateSyncCompleteCommandOutput'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateSyncCompleteCommandProperties, self).__init__(**kwargs) - self.command_type = 'Migrate.Sync.Complete.Database' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class MigrationEligibilityInfo(msrest.serialization.Model): - """Information about migration eligibility of a server object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar is_eligible_for_migration: Whether object is eligible for migration or not. - :vartype is_eligible_for_migration: bool - :ivar validation_messages: Information about eligibility failure for the server object. - :vartype validation_messages: list[str] - """ - - _validation = { - 'is_eligible_for_migration': {'readonly': True}, - 'validation_messages': {'readonly': True}, - } - - _attribute_map = { - 'is_eligible_for_migration': {'key': 'isEligibleForMigration', 'type': 'bool'}, - 'validation_messages': {'key': 'validationMessages', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationEligibilityInfo, self).__init__(**kwargs) - self.is_eligible_for_migration = None - self.validation_messages = None - - -class MigrationReportResult(msrest.serialization.Model): - """Migration validation report result, contains the url for downloading the generated report. - - :param id: Migration validation result identifier. - :type id: str - :param report_url: The url of the report. - :type report_url: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'report_url': {'key': 'reportUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationReportResult, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.report_url = kwargs.get('report_url', None) - - -class MigrationTableMetadata(msrest.serialization.Model): - """Metadata for tables selected in migration project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar source_table_name: Source table name. - :vartype source_table_name: str - :ivar target_table_name: Target table name. - :vartype target_table_name: str - """ - - _validation = { - 'source_table_name': {'readonly': True}, - 'target_table_name': {'readonly': True}, - } - - _attribute_map = { - 'source_table_name': {'key': 'sourceTableName', 'type': 'str'}, - 'target_table_name': {'key': 'targetTableName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationTableMetadata, self).__init__(**kwargs) - self.source_table_name = None - self.target_table_name = None - - -class MigrationValidationDatabaseSummaryResult(msrest.serialization.Model): - """Migration Validation Database level summary result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar migration_id: Migration Identifier. - :vartype migration_id: str - :ivar source_database_name: Name of the source database. - :vartype source_database_name: str - :ivar target_database_name: Name of the target database. - :vartype target_database_name: str - :ivar started_on: Validation start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Validation end time. - :vartype ended_on: ~datetime.datetime - :ivar status: Current status of validation at the database level. Possible values include: - "Default", "NotStarted", "Initialized", "InProgress", "Completed", "CompletedWithIssues", - "Stopped", "Failed". - :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'migration_id': {'readonly': True}, - 'source_database_name': {'readonly': True}, - 'target_database_name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'migration_id': {'key': 'migrationId', 'type': 'str'}, - 'source_database_name': {'key': 'sourceDatabaseName', 'type': 'str'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationValidationDatabaseSummaryResult, self).__init__(**kwargs) - self.id = None - self.migration_id = None - self.source_database_name = None - self.target_database_name = None - self.started_on = None - self.ended_on = None - self.status = None - - -class MigrationValidationOptions(msrest.serialization.Model): - """Types of validations to run after the migration. - - :param enable_schema_validation: Allows to compare the schema information between source and - target. - :type enable_schema_validation: bool - :param enable_data_integrity_validation: Allows to perform a checksum based data integrity - validation between source and target for the selected database / tables . - :type enable_data_integrity_validation: bool - :param enable_query_analysis_validation: Allows to perform a quick and intelligent query - analysis by retrieving queries from the source database and executes them in the target. The - result will have execution statistics for executions in source and target databases for the - extracted queries. - :type enable_query_analysis_validation: bool - """ - - _attribute_map = { - 'enable_schema_validation': {'key': 'enableSchemaValidation', 'type': 'bool'}, - 'enable_data_integrity_validation': {'key': 'enableDataIntegrityValidation', 'type': 'bool'}, - 'enable_query_analysis_validation': {'key': 'enableQueryAnalysisValidation', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationValidationOptions, self).__init__(**kwargs) - self.enable_schema_validation = kwargs.get('enable_schema_validation', None) - self.enable_data_integrity_validation = kwargs.get('enable_data_integrity_validation', None) - self.enable_query_analysis_validation = kwargs.get('enable_query_analysis_validation', None) - - -class MiSqlConnectionInfo(ConnectionInfo): - """Properties required to create a connection to Azure SQL database Managed instance. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param managed_instance_resource_id: Required. Resource id for Azure SQL database Managed - instance. - :type managed_instance_resource_id: str - """ - - _validation = { - 'type': {'required': True}, - 'managed_instance_resource_id': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'managed_instance_resource_id': {'key': 'managedInstanceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MiSqlConnectionInfo, self).__init__(**kwargs) - self.type = 'MiSqlConnectionInfo' # type: str - self.managed_instance_resource_id = kwargs['managed_instance_resource_id'] - - -class MongoDbCancelCommand(CommandProperties): - """Properties for the command that cancels a migration in whole or in part. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the command. This is ignored if submitted. Possible values include: - "Unknown", "Accepted", "Running", "Succeeded", "Failed". - :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - :param input: Command input. - :type input: ~azure.mgmt.datamigration.models.MongoDbCommandInput - """ - - _validation = { - 'command_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'command_type': {'key': 'commandType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'input': {'key': 'input', 'type': 'MongoDbCommandInput'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbCancelCommand, self).__init__(**kwargs) - self.command_type = 'cancel' # type: str - self.input = kwargs.get('input', None) - - -class MongoDbClusterInfo(msrest.serialization.Model): - """Describes a MongoDB data source. - - All required parameters must be populated in order to send to Azure. - - :param databases: Required. A list of non-system databases in the cluster. - :type databases: list[~azure.mgmt.datamigration.models.MongoDbDatabaseInfo] - :param supports_sharding: Required. Whether the cluster supports sharded collections. - :type supports_sharding: bool - :param type: Required. The type of data source. Possible values include: "BlobContainer", - "CosmosDb", "MongoDb". - :type type: str or ~azure.mgmt.datamigration.models.MongoDbClusterType - :param version: Required. The version of the data source in the form x.y.z (e.g. 3.6.7). Not - used if Type is BlobContainer. - :type version: str - """ - - _validation = { - 'databases': {'required': True}, - 'supports_sharding': {'required': True}, - 'type': {'required': True}, - 'version': {'required': True}, - } - - _attribute_map = { - 'databases': {'key': 'databases', 'type': '[MongoDbDatabaseInfo]'}, - 'supports_sharding': {'key': 'supportsSharding', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbClusterInfo, self).__init__(**kwargs) - self.databases = kwargs['databases'] - self.supports_sharding = kwargs['supports_sharding'] - self.type = kwargs['type'] - self.version = kwargs['version'] - - -class MongoDbObjectInfo(msrest.serialization.Model): - """Describes a database or collection within a MongoDB data source. - - All required parameters must be populated in order to send to Azure. - - :param average_document_size: Required. The average document size, or -1 if the average size is - unknown. - :type average_document_size: long - :param data_size: Required. The estimated total data size, in bytes, or -1 if the size is - unknown. - :type data_size: long - :param document_count: Required. The estimated total number of documents, or -1 if the document - count is unknown. - :type document_count: long - :param name: Required. The unqualified name of the database or collection. - :type name: str - :param qualified_name: Required. The qualified name of the database or collection. For a - collection, this is the database-qualified name. - :type qualified_name: str - """ - - _validation = { - 'average_document_size': {'required': True}, - 'data_size': {'required': True}, - 'document_count': {'required': True}, - 'name': {'required': True}, - 'qualified_name': {'required': True}, - } - - _attribute_map = { - 'average_document_size': {'key': 'averageDocumentSize', 'type': 'long'}, - 'data_size': {'key': 'dataSize', 'type': 'long'}, - 'document_count': {'key': 'documentCount', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'str'}, - 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbObjectInfo, self).__init__(**kwargs) - self.average_document_size = kwargs['average_document_size'] - self.data_size = kwargs['data_size'] - self.document_count = kwargs['document_count'] - self.name = kwargs['name'] - self.qualified_name = kwargs['qualified_name'] - - -class MongoDbCollectionInfo(MongoDbObjectInfo): - """Describes a supported collection within a MongoDB database. - - All required parameters must be populated in order to send to Azure. - - :param average_document_size: Required. The average document size, or -1 if the average size is - unknown. - :type average_document_size: long - :param data_size: Required. The estimated total data size, in bytes, or -1 if the size is - unknown. - :type data_size: long - :param document_count: Required. The estimated total number of documents, or -1 if the document - count is unknown. - :type document_count: long - :param name: Required. The unqualified name of the database or collection. - :type name: str - :param qualified_name: Required. The qualified name of the database or collection. For a - collection, this is the database-qualified name. - :type qualified_name: str - :param database_name: Required. The name of the database containing the collection. - :type database_name: str - :param is_capped: Required. Whether the collection is a capped collection (i.e. whether it has - a fixed size and acts like a circular buffer). - :type is_capped: bool - :param is_system_collection: Required. Whether the collection is system collection. - :type is_system_collection: bool - :param is_view: Required. Whether the collection is a view of another collection. - :type is_view: bool - :param shard_key: The shard key on the collection, or null if the collection is not sharded. - :type shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeyInfo - :param supports_sharding: Required. Whether the database has sharding enabled. Note that the - migration task will enable sharding on the target if necessary. - :type supports_sharding: bool - :param view_of: The name of the collection that this is a view of, if IsView is true. - :type view_of: str - """ - - _validation = { - 'average_document_size': {'required': True}, - 'data_size': {'required': True}, - 'document_count': {'required': True}, - 'name': {'required': True}, - 'qualified_name': {'required': True}, - 'database_name': {'required': True}, - 'is_capped': {'required': True}, - 'is_system_collection': {'required': True}, - 'is_view': {'required': True}, - 'supports_sharding': {'required': True}, - } - - _attribute_map = { - 'average_document_size': {'key': 'averageDocumentSize', 'type': 'long'}, - 'data_size': {'key': 'dataSize', 'type': 'long'}, - 'document_count': {'key': 'documentCount', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'str'}, - 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'is_capped': {'key': 'isCapped', 'type': 'bool'}, - 'is_system_collection': {'key': 'isSystemCollection', 'type': 'bool'}, - 'is_view': {'key': 'isView', 'type': 'bool'}, - 'shard_key': {'key': 'shardKey', 'type': 'MongoDbShardKeyInfo'}, - 'supports_sharding': {'key': 'supportsSharding', 'type': 'bool'}, - 'view_of': {'key': 'viewOf', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbCollectionInfo, self).__init__(**kwargs) - self.database_name = kwargs['database_name'] - self.is_capped = kwargs['is_capped'] - self.is_system_collection = kwargs['is_system_collection'] - self.is_view = kwargs['is_view'] - self.shard_key = kwargs.get('shard_key', None) - self.supports_sharding = kwargs['supports_sharding'] - self.view_of = kwargs.get('view_of', None) - - -class MongoDbProgress(msrest.serialization.Model): - """Base class for MongoDB migration outputs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MongoDbCollectionProgress, MongoDbDatabaseProgress, MongoDbMigrationProgress. - - All required parameters must be populated in order to send to Azure. - - :param bytes_copied: Required. The number of document bytes copied during the Copying stage. - :type bytes_copied: long - :param documents_copied: Required. The number of documents copied during the Copying stage. - :type documents_copied: long - :param elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. - TimeSpan format). - :type elapsed_time: str - :param errors: Required. The errors and warnings that have occurred for the current object. The - keys are the error codes. - :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] - :param events_pending: Required. The number of oplog events awaiting replay. - :type events_pending: long - :param events_replayed: Required. The number of oplog events replayed so far. - :type events_replayed: long - :param last_event_time: The timestamp of the last oplog event received, or null if no oplog - event has been received yet. - :type last_event_time: ~datetime.datetime - :param last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog - event has been replayed yet. - :type last_replay_time: ~datetime.datetime - :param name: The name of the progress object. For a collection, this is the unqualified - collection name. For a database, this is the database name. For the overall migration, this is - null. - :type name: str - :param qualified_name: The qualified name of the progress object. For a collection, this is the - database-qualified name. For a database, this is the database name. For the overall migration, - this is null. - :type qualified_name: str - :param result_type: Required. The type of progress object.Constant filled by server. Possible - values include: "Migration", "Database", "Collection". - :type result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType - :param state: Required. Possible values include: "NotStarted", "ValidatingInput", - "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", - "Complete", "Canceled", "Failed". - :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState - :param total_bytes: Required. The total number of document bytes on the source at the beginning - of the Copying stage, or -1 if the total size was unknown. - :type total_bytes: long - :param total_documents: Required. The total number of documents on the source at the beginning - of the Copying stage, or -1 if the total count was unknown. - :type total_documents: long - """ - - _validation = { - 'bytes_copied': {'required': True}, - 'documents_copied': {'required': True}, - 'elapsed_time': {'required': True}, - 'errors': {'required': True}, - 'events_pending': {'required': True}, - 'events_replayed': {'required': True}, - 'result_type': {'required': True}, - 'state': {'required': True}, - 'total_bytes': {'required': True}, - 'total_documents': {'required': True}, - } - - _attribute_map = { - 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, - 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, - 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, - 'events_pending': {'key': 'eventsPending', 'type': 'long'}, - 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, - 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, - 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, - 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, - } - - _subtype_map = { - 'result_type': {'Collection': 'MongoDbCollectionProgress', 'Database': 'MongoDbDatabaseProgress', 'Migration': 'MongoDbMigrationProgress'} - } - - def __init__( - self, - **kwargs - ): - super(MongoDbProgress, self).__init__(**kwargs) - self.bytes_copied = kwargs['bytes_copied'] - self.documents_copied = kwargs['documents_copied'] - self.elapsed_time = kwargs['elapsed_time'] - self.errors = kwargs['errors'] - self.events_pending = kwargs['events_pending'] - self.events_replayed = kwargs['events_replayed'] - self.last_event_time = kwargs.get('last_event_time', None) - self.last_replay_time = kwargs.get('last_replay_time', None) - self.name = kwargs.get('name', None) - self.qualified_name = kwargs.get('qualified_name', None) - self.result_type = None # type: Optional[str] - self.state = kwargs['state'] - self.total_bytes = kwargs['total_bytes'] - self.total_documents = kwargs['total_documents'] - - -class MongoDbCollectionProgress(MongoDbProgress): - """Describes the progress of a collection. - - All required parameters must be populated in order to send to Azure. - - :param bytes_copied: Required. The number of document bytes copied during the Copying stage. - :type bytes_copied: long - :param documents_copied: Required. The number of documents copied during the Copying stage. - :type documents_copied: long - :param elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. - TimeSpan format). - :type elapsed_time: str - :param errors: Required. The errors and warnings that have occurred for the current object. The - keys are the error codes. - :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] - :param events_pending: Required. The number of oplog events awaiting replay. - :type events_pending: long - :param events_replayed: Required. The number of oplog events replayed so far. - :type events_replayed: long - :param last_event_time: The timestamp of the last oplog event received, or null if no oplog - event has been received yet. - :type last_event_time: ~datetime.datetime - :param last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog - event has been replayed yet. - :type last_replay_time: ~datetime.datetime - :param name: The name of the progress object. For a collection, this is the unqualified - collection name. For a database, this is the database name. For the overall migration, this is - null. - :type name: str - :param qualified_name: The qualified name of the progress object. For a collection, this is the - database-qualified name. For a database, this is the database name. For the overall migration, - this is null. - :type qualified_name: str - :param result_type: Required. The type of progress object.Constant filled by server. Possible - values include: "Migration", "Database", "Collection". - :type result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType - :param state: Required. Possible values include: "NotStarted", "ValidatingInput", - "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", - "Complete", "Canceled", "Failed". - :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState - :param total_bytes: Required. The total number of document bytes on the source at the beginning - of the Copying stage, or -1 if the total size was unknown. - :type total_bytes: long - :param total_documents: Required. The total number of documents on the source at the beginning - of the Copying stage, or -1 if the total count was unknown. - :type total_documents: long - """ - - _validation = { - 'bytes_copied': {'required': True}, - 'documents_copied': {'required': True}, - 'elapsed_time': {'required': True}, - 'errors': {'required': True}, - 'events_pending': {'required': True}, - 'events_replayed': {'required': True}, - 'result_type': {'required': True}, - 'state': {'required': True}, - 'total_bytes': {'required': True}, - 'total_documents': {'required': True}, - } - - _attribute_map = { - 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, - 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, - 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, - 'events_pending': {'key': 'eventsPending', 'type': 'long'}, - 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, - 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, - 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, - 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbCollectionProgress, self).__init__(**kwargs) - self.result_type = 'Collection' # type: str - - -class MongoDbCollectionSettings(msrest.serialization.Model): - """Describes how an individual MongoDB collection should be migrated. - - :param can_delete: Whether the migrator is allowed to drop the target collection in the course - of performing a migration. The default is true. - :type can_delete: bool - :param shard_key: Describes a MongoDB shard key. - :type shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeySetting - :param target_r_us: The RUs that should be configured on a CosmosDB target, or null to use the - default. This has no effect on non-CosmosDB targets. - :type target_r_us: int - """ - - _attribute_map = { - 'can_delete': {'key': 'canDelete', 'type': 'bool'}, - 'shard_key': {'key': 'shardKey', 'type': 'MongoDbShardKeySetting'}, - 'target_r_us': {'key': 'targetRUs', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbCollectionSettings, self).__init__(**kwargs) - self.can_delete = kwargs.get('can_delete', None) - self.shard_key = kwargs.get('shard_key', None) - self.target_r_us = kwargs.get('target_r_us', None) - - -class MongoDbCommandInput(msrest.serialization.Model): - """Describes the input to the 'cancel' and 'restart' MongoDB migration commands. - - :param object_name: The qualified name of a database or collection to act upon, or null to act - upon the entire migration. - :type object_name: str - """ - - _attribute_map = { - 'object_name': {'key': 'objectName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbCommandInput, self).__init__(**kwargs) - self.object_name = kwargs.get('object_name', None) - - -class MongoDbConnectionInfo(ConnectionInfo): - """Describes a connection to a MongoDB data source. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param connection_string: Required. A MongoDB connection string or blob container URL. The user - name and password can be specified here or in the userName and password properties. - :type connection_string: str - """ - - _validation = { - 'type': {'required': True}, - 'connection_string': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'connection_string': {'key': 'connectionString', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbConnectionInfo, self).__init__(**kwargs) - self.type = 'MongoDbConnectionInfo' # type: str - self.connection_string = kwargs['connection_string'] - - -class MongoDbDatabaseInfo(MongoDbObjectInfo): - """Describes a database within a MongoDB data source. - - All required parameters must be populated in order to send to Azure. - - :param average_document_size: Required. The average document size, or -1 if the average size is - unknown. - :type average_document_size: long - :param data_size: Required. The estimated total data size, in bytes, or -1 if the size is - unknown. - :type data_size: long - :param document_count: Required. The estimated total number of documents, or -1 if the document - count is unknown. - :type document_count: long - :param name: Required. The unqualified name of the database or collection. - :type name: str - :param qualified_name: Required. The qualified name of the database or collection. For a - collection, this is the database-qualified name. - :type qualified_name: str - :param collections: Required. A list of supported collections in a MongoDB database. - :type collections: list[~azure.mgmt.datamigration.models.MongoDbCollectionInfo] - :param supports_sharding: Required. Whether the database has sharding enabled. Note that the - migration task will enable sharding on the target if necessary. - :type supports_sharding: bool - """ - - _validation = { - 'average_document_size': {'required': True}, - 'data_size': {'required': True}, - 'document_count': {'required': True}, - 'name': {'required': True}, - 'qualified_name': {'required': True}, - 'collections': {'required': True}, - 'supports_sharding': {'required': True}, - } - - _attribute_map = { - 'average_document_size': {'key': 'averageDocumentSize', 'type': 'long'}, - 'data_size': {'key': 'dataSize', 'type': 'long'}, - 'document_count': {'key': 'documentCount', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'str'}, - 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, - 'collections': {'key': 'collections', 'type': '[MongoDbCollectionInfo]'}, - 'supports_sharding': {'key': 'supportsSharding', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbDatabaseInfo, self).__init__(**kwargs) - self.collections = kwargs['collections'] - self.supports_sharding = kwargs['supports_sharding'] - - -class MongoDbDatabaseProgress(MongoDbProgress): - """Describes the progress of a database. - - All required parameters must be populated in order to send to Azure. - - :param bytes_copied: Required. The number of document bytes copied during the Copying stage. - :type bytes_copied: long - :param documents_copied: Required. The number of documents copied during the Copying stage. - :type documents_copied: long - :param elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. - TimeSpan format). - :type elapsed_time: str - :param errors: Required. The errors and warnings that have occurred for the current object. The - keys are the error codes. - :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] - :param events_pending: Required. The number of oplog events awaiting replay. - :type events_pending: long - :param events_replayed: Required. The number of oplog events replayed so far. - :type events_replayed: long - :param last_event_time: The timestamp of the last oplog event received, or null if no oplog - event has been received yet. - :type last_event_time: ~datetime.datetime - :param last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog - event has been replayed yet. - :type last_replay_time: ~datetime.datetime - :param name: The name of the progress object. For a collection, this is the unqualified - collection name. For a database, this is the database name. For the overall migration, this is - null. - :type name: str - :param qualified_name: The qualified name of the progress object. For a collection, this is the - database-qualified name. For a database, this is the database name. For the overall migration, - this is null. - :type qualified_name: str - :param result_type: Required. The type of progress object.Constant filled by server. Possible - values include: "Migration", "Database", "Collection". - :type result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType - :param state: Required. Possible values include: "NotStarted", "ValidatingInput", - "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", - "Complete", "Canceled", "Failed". - :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState - :param total_bytes: Required. The total number of document bytes on the source at the beginning - of the Copying stage, or -1 if the total size was unknown. - :type total_bytes: long - :param total_documents: Required. The total number of documents on the source at the beginning - of the Copying stage, or -1 if the total count was unknown. - :type total_documents: long - :param collections: The progress of the collections in the database. The keys are the - unqualified names of the collections. - :type collections: dict[str, ~azure.mgmt.datamigration.models.MongoDbCollectionProgress] - """ - - _validation = { - 'bytes_copied': {'required': True}, - 'documents_copied': {'required': True}, - 'elapsed_time': {'required': True}, - 'errors': {'required': True}, - 'events_pending': {'required': True}, - 'events_replayed': {'required': True}, - 'result_type': {'required': True}, - 'state': {'required': True}, - 'total_bytes': {'required': True}, - 'total_documents': {'required': True}, - } - - _attribute_map = { - 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, - 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, - 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, - 'events_pending': {'key': 'eventsPending', 'type': 'long'}, - 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, - 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, - 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, - 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, - 'collections': {'key': 'collections', 'type': '{MongoDbCollectionProgress}'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbDatabaseProgress, self).__init__(**kwargs) - self.result_type = 'Database' # type: str - self.collections = kwargs.get('collections', None) - - -class MongoDbDatabaseSettings(msrest.serialization.Model): - """Describes how an individual MongoDB database should be migrated. - - All required parameters must be populated in order to send to Azure. - - :param collections: Required. The collections on the source database to migrate to the target. - The keys are the unqualified names of the collections. - :type collections: dict[str, ~azure.mgmt.datamigration.models.MongoDbCollectionSettings] - :param target_r_us: The RUs that should be configured on a CosmosDB target, or null to use the - default, or 0 if throughput should not be provisioned for the database. This has no effect on - non-CosmosDB targets. - :type target_r_us: int - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{MongoDbCollectionSettings}'}, - 'target_r_us': {'key': 'targetRUs', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbDatabaseSettings, self).__init__(**kwargs) - self.collections = kwargs['collections'] - self.target_r_us = kwargs.get('target_r_us', None) - - -class MongoDbError(msrest.serialization.Model): - """Describes an error or warning that occurred during a MongoDB migration. - - :param code: The non-localized, machine-readable code that describes the error or warning. - :type code: str - :param count: The number of times the error or warning has occurred. - :type count: int - :param message: The localized, human-readable message that describes the error or warning. - :type message: str - :param type: The type of error or warning. Possible values include: "Error", "ValidationError", - "Warning". - :type type: str or ~azure.mgmt.datamigration.models.MongoDbErrorType - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'message': {'key': 'message', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.count = kwargs.get('count', None) - self.message = kwargs.get('message', None) - self.type = kwargs.get('type', None) - - -class MongoDbFinishCommand(CommandProperties): - """Properties for the command that finishes a migration in whole or in part. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the command. This is ignored if submitted. Possible values include: - "Unknown", "Accepted", "Running", "Succeeded", "Failed". - :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - :param input: Command input. - :type input: ~azure.mgmt.datamigration.models.MongoDbFinishCommandInput - """ - - _validation = { - 'command_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'command_type': {'key': 'commandType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'input': {'key': 'input', 'type': 'MongoDbFinishCommandInput'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbFinishCommand, self).__init__(**kwargs) - self.command_type = 'finish' # type: str - self.input = kwargs.get('input', None) - - -class MongoDbFinishCommandInput(MongoDbCommandInput): - """Describes the input to the 'finish' MongoDB migration command. - - All required parameters must be populated in order to send to Azure. - - :param object_name: The qualified name of a database or collection to act upon, or null to act - upon the entire migration. - :type object_name: str - :param immediate: Required. If true, replication for the affected objects will be stopped - immediately. If false, the migrator will finish replaying queued events before finishing the - replication. - :type immediate: bool - """ - - _validation = { - 'immediate': {'required': True}, - } - - _attribute_map = { - 'object_name': {'key': 'objectName', 'type': 'str'}, - 'immediate': {'key': 'immediate', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbFinishCommandInput, self).__init__(**kwargs) - self.immediate = kwargs['immediate'] - - -class MongoDbMigrationProgress(MongoDbProgress): - """Describes the progress of the overall migration. - - All required parameters must be populated in order to send to Azure. - - :param bytes_copied: Required. The number of document bytes copied during the Copying stage. - :type bytes_copied: long - :param documents_copied: Required. The number of documents copied during the Copying stage. - :type documents_copied: long - :param elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. - TimeSpan format). - :type elapsed_time: str - :param errors: Required. The errors and warnings that have occurred for the current object. The - keys are the error codes. - :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] - :param events_pending: Required. The number of oplog events awaiting replay. - :type events_pending: long - :param events_replayed: Required. The number of oplog events replayed so far. - :type events_replayed: long - :param last_event_time: The timestamp of the last oplog event received, or null if no oplog - event has been received yet. - :type last_event_time: ~datetime.datetime - :param last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog - event has been replayed yet. - :type last_replay_time: ~datetime.datetime - :param name: The name of the progress object. For a collection, this is the unqualified - collection name. For a database, this is the database name. For the overall migration, this is - null. - :type name: str - :param qualified_name: The qualified name of the progress object. For a collection, this is the - database-qualified name. For a database, this is the database name. For the overall migration, - this is null. - :type qualified_name: str - :param result_type: Required. The type of progress object.Constant filled by server. Possible - values include: "Migration", "Database", "Collection". - :type result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType - :param state: Required. Possible values include: "NotStarted", "ValidatingInput", - "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", - "Complete", "Canceled", "Failed". - :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState - :param total_bytes: Required. The total number of document bytes on the source at the beginning - of the Copying stage, or -1 if the total size was unknown. - :type total_bytes: long - :param total_documents: Required. The total number of documents on the source at the beginning - of the Copying stage, or -1 if the total count was unknown. - :type total_documents: long - :param databases: The progress of the databases in the migration. The keys are the names of the - databases. - :type databases: dict[str, ~azure.mgmt.datamigration.models.MongoDbDatabaseProgress] - """ - - _validation = { - 'bytes_copied': {'required': True}, - 'documents_copied': {'required': True}, - 'elapsed_time': {'required': True}, - 'errors': {'required': True}, - 'events_pending': {'required': True}, - 'events_replayed': {'required': True}, - 'result_type': {'required': True}, - 'state': {'required': True}, - 'total_bytes': {'required': True}, - 'total_documents': {'required': True}, - } - - _attribute_map = { - 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, - 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, - 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, - 'events_pending': {'key': 'eventsPending', 'type': 'long'}, - 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, - 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, - 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, - 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, - 'databases': {'key': 'databases', 'type': '{MongoDbDatabaseProgress}'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbMigrationProgress, self).__init__(**kwargs) - self.result_type = 'Migration' # type: str - self.databases = kwargs.get('databases', None) - - -class MongoDbMigrationSettings(msrest.serialization.Model): - """Describes how a MongoDB data migration should be performed. - - All required parameters must be populated in order to send to Azure. - - :param boost_r_us: The RU limit on a CosmosDB target that collections will be temporarily - increased to (if lower) during the initial copy of a migration, from 10,000 to 1,000,000, or 0 - to use the default boost (which is generally the maximum), or null to not boost the RUs. This - setting has no effect on non-CosmosDB targets. - :type boost_r_us: int - :param databases: Required. The databases on the source cluster to migrate to the target. The - keys are the names of the databases. - :type databases: dict[str, ~azure.mgmt.datamigration.models.MongoDbDatabaseSettings] - :param replication: Describes how changes will be replicated from the source to the target. The - default is OneTime. Possible values include: "Disabled", "OneTime", "Continuous". - :type replication: str or ~azure.mgmt.datamigration.models.MongoDbReplication - :param source: Required. Settings used to connect to the source cluster. - :type source: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo - :param target: Required. Settings used to connect to the target cluster. - :type target: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo - :param throttling: Settings used to limit the resource usage of the migration. - :type throttling: ~azure.mgmt.datamigration.models.MongoDbThrottlingSettings - """ - - _validation = { - 'databases': {'required': True}, - 'source': {'required': True}, - 'target': {'required': True}, - } - - _attribute_map = { - 'boost_r_us': {'key': 'boostRUs', 'type': 'int'}, - 'databases': {'key': 'databases', 'type': '{MongoDbDatabaseSettings}'}, - 'replication': {'key': 'replication', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'MongoDbConnectionInfo'}, - 'target': {'key': 'target', 'type': 'MongoDbConnectionInfo'}, - 'throttling': {'key': 'throttling', 'type': 'MongoDbThrottlingSettings'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbMigrationSettings, self).__init__(**kwargs) - self.boost_r_us = kwargs.get('boost_r_us', None) - self.databases = kwargs['databases'] - self.replication = kwargs.get('replication', None) - self.source = kwargs['source'] - self.target = kwargs['target'] - self.throttling = kwargs.get('throttling', None) - - -class MongoDbRestartCommand(CommandProperties): - """Properties for the command that restarts a migration in whole or in part. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the command. This is ignored if submitted. Possible values include: - "Unknown", "Accepted", "Running", "Succeeded", "Failed". - :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - :param input: Command input. - :type input: ~azure.mgmt.datamigration.models.MongoDbCommandInput - """ - - _validation = { - 'command_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'command_type': {'key': 'commandType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'input': {'key': 'input', 'type': 'MongoDbCommandInput'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbRestartCommand, self).__init__(**kwargs) - self.command_type = 'restart' # type: str - self.input = kwargs.get('input', None) - - -class MongoDbShardKeyField(msrest.serialization.Model): - """Describes a field reference within a MongoDB shard key. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the field. - :type name: str - :param order: Required. The field ordering. Possible values include: "Forward", "Reverse", - "Hashed". - :type order: str or ~azure.mgmt.datamigration.models.MongoDbShardKeyOrder - """ - - _validation = { - 'name': {'required': True}, - 'order': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbShardKeyField, self).__init__(**kwargs) - self.name = kwargs['name'] - self.order = kwargs['order'] - - -class MongoDbShardKeyInfo(msrest.serialization.Model): - """Describes a MongoDB shard key. - - All required parameters must be populated in order to send to Azure. - - :param fields: Required. The fields within the shard key. - :type fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] - :param is_unique: Required. Whether the shard key is unique. - :type is_unique: bool - """ - - _validation = { - 'fields': {'required': True}, - 'is_unique': {'required': True}, - } - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[MongoDbShardKeyField]'}, - 'is_unique': {'key': 'isUnique', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbShardKeyInfo, self).__init__(**kwargs) - self.fields = kwargs['fields'] - self.is_unique = kwargs['is_unique'] - - -class MongoDbShardKeySetting(msrest.serialization.Model): - """Describes a MongoDB shard key. - - All required parameters must be populated in order to send to Azure. - - :param fields: Required. The fields within the shard key. - :type fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] - :param is_unique: Required. Whether the shard key is unique. - :type is_unique: bool - """ - - _validation = { - 'fields': {'required': True}, - 'is_unique': {'required': True}, - } - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[MongoDbShardKeyField]'}, - 'is_unique': {'key': 'isUnique', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbShardKeySetting, self).__init__(**kwargs) - self.fields = kwargs['fields'] - self.is_unique = kwargs['is_unique'] - - -class MongoDbThrottlingSettings(msrest.serialization.Model): - """Specifies resource limits for the migration. - - :param min_free_cpu: The percentage of CPU time that the migrator will try to avoid using, from - 0 to 100. - :type min_free_cpu: int - :param min_free_memory_mb: The number of megabytes of RAM that the migrator will try to avoid - using. - :type min_free_memory_mb: int - :param max_parallelism: The maximum number of work items (e.g. collection copies) that will be - processed in parallel. - :type max_parallelism: int - """ - - _attribute_map = { - 'min_free_cpu': {'key': 'minFreeCpu', 'type': 'int'}, - 'min_free_memory_mb': {'key': 'minFreeMemoryMb', 'type': 'int'}, - 'max_parallelism': {'key': 'maxParallelism', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(MongoDbThrottlingSettings, self).__init__(**kwargs) - self.min_free_cpu = kwargs.get('min_free_cpu', None) - self.min_free_memory_mb = kwargs.get('min_free_memory_mb', None) - self.max_parallelism = kwargs.get('max_parallelism', None) - - -class MySqlConnectionInfo(ConnectionInfo): - """Information for connecting to MySQL server. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param server_name: Required. Name of the server. - :type server_name: str - :param port: Required. Port for Server. - :type port: int - :param encrypt_connection: Whether to encrypt the connection. - :type encrypt_connection: bool - """ - - _validation = { - 'type': {'required': True}, - 'server_name': {'required': True}, - 'port': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'encrypt_connection': {'key': 'encryptConnection', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(MySqlConnectionInfo, self).__init__(**kwargs) - self.type = 'MySqlConnectionInfo' # type: str - self.server_name = kwargs['server_name'] - self.port = kwargs['port'] - self.encrypt_connection = kwargs.get('encrypt_connection', True) - - -class NameAvailabilityRequest(msrest.serialization.Model): - """A resource type and proposed name. - - :param name: The proposed resource name. - :type name: str - :param type: The resource type chain (e.g. virtualMachines/extensions). - :type type: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NameAvailabilityRequest, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class NameAvailabilityResponse(msrest.serialization.Model): - """Indicates whether a proposed resource name is available. - - :param name_available: If true, the name is valid and available. If false, 'reason' describes - why not. - :type name_available: bool - :param reason: The reason why the name is not available, if nameAvailable is false. Possible - values include: "AlreadyExists", "Invalid". - :type reason: str or ~azure.mgmt.datamigration.models.NameCheckFailureReason - :param message: The localized reason why the name is not available, if nameAvailable is false. - :type message: str - """ - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NameAvailabilityResponse, self).__init__(**kwargs) - self.name_available = kwargs.get('name_available', None) - self.reason = kwargs.get('reason', None) - self.message = kwargs.get('message', None) - - -class NonSqlDataMigrationTable(msrest.serialization.Model): - """Defines metadata for table to be migrated. - - :param source_name: Source table name. - :type source_name: str - """ - - _attribute_map = { - 'source_name': {'key': 'sourceName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NonSqlDataMigrationTable, self).__init__(**kwargs) - self.source_name = kwargs.get('source_name', None) - - -class NonSqlDataMigrationTableResult(msrest.serialization.Model): - """Object used to report the data migration results of a table. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar result_code: Result code of the data migration. Possible values include: "Initial", - "Completed", "ObjectNotExistsInSource", "ObjectNotExistsInTarget", - "TargetObjectIsInaccessible", "FatalError". - :vartype result_code: str or ~azure.mgmt.datamigration.models.DataMigrationResultCode - :ivar source_name: Name of the source table. - :vartype source_name: str - :ivar target_name: Name of the target table. - :vartype target_name: str - :ivar source_row_count: Number of rows in the source table. - :vartype source_row_count: long - :ivar target_row_count: Number of rows in the target table. - :vartype target_row_count: long - :ivar elapsed_time_in_miliseconds: Time taken to migrate the data. - :vartype elapsed_time_in_miliseconds: float - :ivar errors: List of errors, if any, during migration. - :vartype errors: list[~azure.mgmt.datamigration.models.DataMigrationError] - """ - - _validation = { - 'result_code': {'readonly': True}, - 'source_name': {'readonly': True}, - 'target_name': {'readonly': True}, - 'source_row_count': {'readonly': True}, - 'target_row_count': {'readonly': True}, - 'elapsed_time_in_miliseconds': {'readonly': True}, - 'errors': {'readonly': True}, - } - - _attribute_map = { - 'result_code': {'key': 'resultCode', 'type': 'str'}, - 'source_name': {'key': 'sourceName', 'type': 'str'}, - 'target_name': {'key': 'targetName', 'type': 'str'}, - 'source_row_count': {'key': 'sourceRowCount', 'type': 'long'}, - 'target_row_count': {'key': 'targetRowCount', 'type': 'long'}, - 'elapsed_time_in_miliseconds': {'key': 'elapsedTimeInMiliseconds', 'type': 'float'}, - 'errors': {'key': 'errors', 'type': '[DataMigrationError]'}, - } - - def __init__( - self, - **kwargs - ): - super(NonSqlDataMigrationTableResult, self).__init__(**kwargs) - self.result_code = None - self.source_name = None - self.target_name = None - self.source_row_count = None - self.target_row_count = None - self.elapsed_time_in_miliseconds = None - self.errors = None - - -class NonSqlMigrationTaskInput(msrest.serialization.Model): - """Base class for non sql migration task input. - - All required parameters must be populated in order to send to Azure. - - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_database_name: Required. Target database name. - :type target_database_name: str - :param project_name: Required. Name of the migration project. - :type project_name: str - :param project_location: Required. A URL that points to the drop location to access project - artifacts. - :type project_location: str - :param selected_tables: Required. Metadata of the tables selected for migration. - :type selected_tables: list[~azure.mgmt.datamigration.models.NonSqlDataMigrationTable] - """ - - _validation = { - 'target_connection_info': {'required': True}, - 'target_database_name': {'required': True}, - 'project_name': {'required': True}, - 'project_location': {'required': True}, - 'selected_tables': {'required': True}, - } - - _attribute_map = { - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'project_name': {'key': 'projectName', 'type': 'str'}, - 'project_location': {'key': 'projectLocation', 'type': 'str'}, - 'selected_tables': {'key': 'selectedTables', 'type': '[NonSqlDataMigrationTable]'}, - } - - def __init__( - self, - **kwargs - ): - super(NonSqlMigrationTaskInput, self).__init__(**kwargs) - self.target_connection_info = kwargs['target_connection_info'] - self.target_database_name = kwargs['target_database_name'] - self.project_name = kwargs['project_name'] - self.project_location = kwargs['project_location'] - self.selected_tables = kwargs['selected_tables'] - - -class NonSqlMigrationTaskOutput(msrest.serialization.Model): - """Base class for non sql migration task output. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar status: Current state of migration. Possible values include: "Default", "Connecting", - "SourceAndTargetSelected", "SelectLogins", "Configured", "Running", "Error", "Stopped", - "Completed", "CompletedWithWarnings". - :vartype status: str or ~azure.mgmt.datamigration.models.MigrationStatus - :ivar data_migration_table_results: Results of the migration. The key contains the table name - and the value the table result object. - :vartype data_migration_table_results: str - :ivar progress_message: Message about the progress of the migration. - :vartype progress_message: str - :ivar source_server_name: Name of source server. - :vartype source_server_name: str - :ivar target_server_name: Name of target server. - :vartype target_server_name: str - """ - - _validation = { - 'id': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'status': {'readonly': True}, - 'data_migration_table_results': {'readonly': True}, - 'progress_message': {'readonly': True}, - 'source_server_name': {'readonly': True}, - 'target_server_name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'data_migration_table_results': {'key': 'dataMigrationTableResults', 'type': 'str'}, - 'progress_message': {'key': 'progressMessage', 'type': 'str'}, - 'source_server_name': {'key': 'sourceServerName', 'type': 'str'}, - 'target_server_name': {'key': 'targetServerName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NonSqlMigrationTaskOutput, self).__init__(**kwargs) - self.id = None - self.started_on = None - self.ended_on = None - self.status = None - self.data_migration_table_results = None - self.progress_message = None - self.source_server_name = None - self.target_server_name = None - - -class ODataError(msrest.serialization.Model): - """Error information in OData format. - - :param code: The machine-readable description of the error, such as 'InvalidRequest' or - 'InternalServerError'. - :type code: str - :param message: The human-readable description of the error. - :type message: str - :param details: Inner errors that caused this error. - :type details: list[~azure.mgmt.datamigration.models.ODataError] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ODataError]'}, - } - - def __init__( - self, - **kwargs - ): - super(ODataError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', None) - - -class OracleConnectionInfo(ConnectionInfo): - """Information for connecting to Oracle server. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param data_source: Required. EZConnect or TNSName connection string. - :type data_source: str - """ - - _validation = { - 'type': {'required': True}, - 'data_source': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'data_source': {'key': 'dataSource', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OracleConnectionInfo, self).__init__(**kwargs) - self.type = 'OracleConnectionInfo' # type: str - self.data_source = kwargs['data_source'] - - -class OracleOCIDriverInfo(msrest.serialization.Model): - """Information about an Oracle OCI driver. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar driver_name: The name of the driver package. - :vartype driver_name: str - :ivar driver_size: The size in bytes of the driver package. - :vartype driver_size: str - :ivar archive_checksum: The MD5 Base64 encoded checksum for the driver package. - :vartype archive_checksum: str - :ivar oracle_checksum: The checksum for the driver package provided by Oracle. - :vartype oracle_checksum: str - :ivar assembly_version: Version listed in the OCI assembly 'oci.dll'. - :vartype assembly_version: str - :ivar supported_oracle_versions: List of Oracle database versions supported by this driver. - Only major minor of the version is listed. - :vartype supported_oracle_versions: list[str] - """ - - _validation = { - 'driver_name': {'readonly': True}, - 'driver_size': {'readonly': True}, - 'archive_checksum': {'readonly': True}, - 'oracle_checksum': {'readonly': True}, - 'assembly_version': {'readonly': True}, - 'supported_oracle_versions': {'readonly': True}, - } - - _attribute_map = { - 'driver_name': {'key': 'driverName', 'type': 'str'}, - 'driver_size': {'key': 'driverSize', 'type': 'str'}, - 'archive_checksum': {'key': 'archiveChecksum', 'type': 'str'}, - 'oracle_checksum': {'key': 'oracleChecksum', 'type': 'str'}, - 'assembly_version': {'key': 'assemblyVersion', 'type': 'str'}, - 'supported_oracle_versions': {'key': 'supportedOracleVersions', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(OracleOCIDriverInfo, self).__init__(**kwargs) - self.driver_name = None - self.driver_size = None - self.archive_checksum = None - self.oracle_checksum = None - self.assembly_version = None - self.supported_oracle_versions = None - - -class OrphanedUserInfo(msrest.serialization.Model): - """Information of orphaned users on the SQL server database. - - :param name: Name of the orphaned user. - :type name: str - :param database_name: Parent database of the user. - :type database_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrphanedUserInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.database_name = kwargs.get('database_name', None) - - -class PostgreSqlConnectionInfo(ConnectionInfo): - """Information for connecting to PostgreSQL server. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param server_name: Required. Name of the server. - :type server_name: str - :param database_name: Name of the database. - :type database_name: str - :param port: Required. Port for Server. - :type port: int - :param encrypt_connection: Whether to encrypt the connection. - :type encrypt_connection: bool - :param trust_server_certificate: Whether to trust the server certificate. - :type trust_server_certificate: bool - """ - - _validation = { - 'type': {'required': True}, - 'server_name': {'required': True}, - 'port': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'encrypt_connection': {'key': 'encryptConnection', 'type': 'bool'}, - 'trust_server_certificate': {'key': 'trustServerCertificate', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(PostgreSqlConnectionInfo, self).__init__(**kwargs) - self.type = 'PostgreSqlConnectionInfo' # type: str - self.server_name = kwargs['server_name'] - self.database_name = kwargs.get('database_name', None) - self.port = kwargs['port'] - self.encrypt_connection = kwargs.get('encrypt_connection', True) - self.trust_server_certificate = kwargs.get('trust_server_certificate', False) - - -class Project(TrackedResource): - """A project resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.datamigration.models.SystemData - :param source_platform: Source platform for the project. Possible values include: "SQL", - "MySQL", "PostgreSql", "MongoDb", "Unknown". - :type source_platform: str or ~azure.mgmt.datamigration.models.ProjectSourcePlatform - :param target_platform: Target platform for the project. Possible values include: "SQLDB", - "SQLMI", "AzureDbForMySql", "AzureDbForPostgreSql", "MongoDb", "Unknown". - :type target_platform: str or ~azure.mgmt.datamigration.models.ProjectTargetPlatform - :ivar creation_time: UTC Date and time when project was created. - :vartype creation_time: ~datetime.datetime - :param source_connection_info: Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.ConnectionInfo - :param target_connection_info: Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.ConnectionInfo - :param databases_info: List of DatabaseInfo. - :type databases_info: list[~azure.mgmt.datamigration.models.DatabaseInfo] - :ivar provisioning_state: The project's provisioning state. Possible values include: - "Deleting", "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ProjectProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'source_platform': {'key': 'properties.sourcePlatform', 'type': 'str'}, - 'target_platform': {'key': 'properties.targetPlatform', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'source_connection_info': {'key': 'properties.sourceConnectionInfo', 'type': 'ConnectionInfo'}, - 'target_connection_info': {'key': 'properties.targetConnectionInfo', 'type': 'ConnectionInfo'}, - 'databases_info': {'key': 'properties.databasesInfo', 'type': '[DatabaseInfo]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Project, self).__init__(**kwargs) - self.source_platform = kwargs.get('source_platform', None) - self.target_platform = kwargs.get('target_platform', None) - self.creation_time = None - self.source_connection_info = kwargs.get('source_connection_info', None) - self.target_connection_info = kwargs.get('target_connection_info', None) - self.databases_info = kwargs.get('databases_info', None) - self.provisioning_state = None - - -class ProjectFile(Resource): - """A file resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param etag: HTTP strong entity tag value. This is ignored if submitted. - :type etag: str - :param properties: Custom file properties. - :type properties: ~azure.mgmt.datamigration.models.ProjectFileProperties - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.datamigration.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ProjectFileProperties'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(ProjectFile, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.properties = kwargs.get('properties', None) - self.system_data = None - - -class ProjectFileProperties(msrest.serialization.Model): - """Base class for file properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param extension: Optional File extension. If submitted it should not have a leading period and - must match the extension from filePath. - :type extension: str - :param file_path: Relative path of this file resource. This property can be set when creating - or updating the file resource. - :type file_path: str - :ivar last_modified: Modification DateTime. - :vartype last_modified: ~datetime.datetime - :param media_type: File content type. This property can be modified to reflect the file content - type. - :type media_type: str - :ivar size: File size. - :vartype size: long - """ - - _validation = { - 'last_modified': {'readonly': True}, - 'size': {'readonly': True}, - } - - _attribute_map = { - 'extension': {'key': 'extension', 'type': 'str'}, - 'file_path': {'key': 'filePath', 'type': 'str'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(ProjectFileProperties, self).__init__(**kwargs) - self.extension = kwargs.get('extension', None) - self.file_path = kwargs.get('file_path', None) - self.last_modified = None - self.media_type = kwargs.get('media_type', None) - self.size = None - - -class ProjectList(msrest.serialization.Model): - """OData page of project resources. - - :param value: List of projects. - :type value: list[~azure.mgmt.datamigration.models.Project] - :param next_link: URL to load the next page of projects. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Project]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProjectList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ProjectTask(Resource): - """A task resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param etag: HTTP strong entity tag value. This is ignored if submitted. - :type etag: str - :param properties: Custom task properties. - :type properties: ~azure.mgmt.datamigration.models.ProjectTaskProperties - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.datamigration.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ProjectTaskProperties'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(ProjectTask, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.properties = kwargs.get('properties', None) - self.system_data = None - - -class QueryAnalysisValidationResult(msrest.serialization.Model): - """Results for query analysis comparison between the source and target. - - :param query_results: List of queries executed and it's execution results in source and target. - :type query_results: ~azure.mgmt.datamigration.models.QueryExecutionResult - :param validation_errors: Errors that are part of the execution. - :type validation_errors: ~azure.mgmt.datamigration.models.ValidationError - """ - - _attribute_map = { - 'query_results': {'key': 'queryResults', 'type': 'QueryExecutionResult'}, - 'validation_errors': {'key': 'validationErrors', 'type': 'ValidationError'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryAnalysisValidationResult, self).__init__(**kwargs) - self.query_results = kwargs.get('query_results', None) - self.validation_errors = kwargs.get('validation_errors', None) - - -class QueryExecutionResult(msrest.serialization.Model): - """Describes query analysis results for execution in source and target. - - :param query_text: Query text retrieved from the source server. - :type query_text: str - :param statements_in_batch: Total no. of statements in the batch. - :type statements_in_batch: long - :param source_result: Query analysis result from the source. - :type source_result: ~azure.mgmt.datamigration.models.ExecutionStatistics - :param target_result: Query analysis result from the target. - :type target_result: ~azure.mgmt.datamigration.models.ExecutionStatistics - """ - - _attribute_map = { - 'query_text': {'key': 'queryText', 'type': 'str'}, - 'statements_in_batch': {'key': 'statementsInBatch', 'type': 'long'}, - 'source_result': {'key': 'sourceResult', 'type': 'ExecutionStatistics'}, - 'target_result': {'key': 'targetResult', 'type': 'ExecutionStatistics'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryExecutionResult, self).__init__(**kwargs) - self.query_text = kwargs.get('query_text', None) - self.statements_in_batch = kwargs.get('statements_in_batch', None) - self.source_result = kwargs.get('source_result', None) - self.target_result = kwargs.get('target_result', None) - - -class Quota(msrest.serialization.Model): - """Describes a quota for or usage details about a resource. - - :param current_value: The current value of the quota. If null or missing, the current value - cannot be determined in the context of the request. - :type current_value: float - :param id: The resource ID of the quota object. - :type id: str - :param limit: The maximum value of the quota. If null or missing, the quota has no maximum, in - which case it merely tracks usage. - :type limit: float - :param name: The name of the quota. - :type name: ~azure.mgmt.datamigration.models.QuotaName - :param unit: The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. - :type unit: str - """ - - _attribute_map = { - 'current_value': {'key': 'currentValue', 'type': 'float'}, - 'id': {'key': 'id', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'float'}, - 'name': {'key': 'name', 'type': 'QuotaName'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Quota, self).__init__(**kwargs) - self.current_value = kwargs.get('current_value', None) - self.id = kwargs.get('id', None) - self.limit = kwargs.get('limit', None) - self.name = kwargs.get('name', None) - self.unit = kwargs.get('unit', None) - - -class QuotaList(msrest.serialization.Model): - """OData page of quota objects. - - :param value: List of quotas. - :type value: list[~azure.mgmt.datamigration.models.Quota] - :param next_link: URL to load the next page of quotas, or null or missing if this is the last - page. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Quota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(QuotaList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class QuotaName(msrest.serialization.Model): - """The name of the quota. - - :param localized_value: The localized name of the quota. - :type localized_value: str - :param value: The unlocalized name (or ID) of the quota. - :type value: str - """ - - _attribute_map = { - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(QuotaName, self).__init__(**kwargs) - self.localized_value = kwargs.get('localized_value', None) - self.value = kwargs.get('value', None) - - -class ReportableException(msrest.serialization.Model): - """Exception object for all custom exceptions. - - :param message: Error message. - :type message: str - :param actionable_message: Actionable steps for this exception. - :type actionable_message: str - :param file_path: The path to the file where exception occurred. - :type file_path: str - :param line_number: The line number where exception occurred. - :type line_number: str - :param h_result: Coded numerical value that is assigned to a specific exception. - :type h_result: int - :param stack_trace: Stack trace. - :type stack_trace: str - """ - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'actionable_message': {'key': 'actionableMessage', 'type': 'str'}, - 'file_path': {'key': 'filePath', 'type': 'str'}, - 'line_number': {'key': 'lineNumber', 'type': 'str'}, - 'h_result': {'key': 'hResult', 'type': 'int'}, - 'stack_trace': {'key': 'stackTrace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReportableException, self).__init__(**kwargs) - self.message = kwargs.get('message', None) - self.actionable_message = kwargs.get('actionable_message', None) - self.file_path = kwargs.get('file_path', None) - self.line_number = kwargs.get('line_number', None) - self.h_result = kwargs.get('h_result', None) - self.stack_trace = kwargs.get('stack_trace', None) - - -class ResourceSku(msrest.serialization.Model): - """Describes an available DMS SKU. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar resource_type: The type of resource the SKU applies to. - :vartype resource_type: str - :ivar name: The name of SKU. - :vartype name: str - :ivar tier: Specifies the tier of DMS in a scale set. - :vartype tier: str - :ivar size: The Size of the SKU. - :vartype size: str - :ivar family: The Family of this particular SKU. - :vartype family: str - :ivar kind: The Kind of resources that are supported in this SKU. - :vartype kind: str - :ivar capacity: Not used. - :vartype capacity: ~azure.mgmt.datamigration.models.ResourceSkuCapacity - :ivar locations: The set of locations that the SKU is available. - :vartype locations: list[str] - :ivar api_versions: The api versions that support this SKU. - :vartype api_versions: list[str] - :ivar costs: Metadata for retrieving price info. - :vartype costs: list[~azure.mgmt.datamigration.models.ResourceSkuCosts] - :ivar capabilities: A name value pair to describe the capability. - :vartype capabilities: list[~azure.mgmt.datamigration.models.ResourceSkuCapabilities] - :ivar restrictions: The restrictions because of which SKU cannot be used. This is empty if - there are no restrictions. - :vartype restrictions: list[~azure.mgmt.datamigration.models.ResourceSkuRestrictions] - """ - - _validation = { - 'resource_type': {'readonly': True}, - 'name': {'readonly': True}, - 'tier': {'readonly': True}, - 'size': {'readonly': True}, - 'family': {'readonly': True}, - 'kind': {'readonly': True}, - 'capacity': {'readonly': True}, - 'locations': {'readonly': True}, - 'api_versions': {'readonly': True}, - 'costs': {'readonly': True}, - 'capabilities': {'readonly': True}, - 'restrictions': {'readonly': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'ResourceSkuCapacity'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, - 'costs': {'key': 'costs', 'type': '[ResourceSkuCosts]'}, - 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, - 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceSku, self).__init__(**kwargs) - self.resource_type = None - self.name = None - self.tier = None - self.size = None - self.family = None - self.kind = None - self.capacity = None - self.locations = None - self.api_versions = None - self.costs = None - self.capabilities = None - self.restrictions = None - - -class ResourceSkuCapabilities(msrest.serialization.Model): - """Describes The SKU capabilities object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: An invariant to describe the feature. - :vartype name: str - :ivar value: An invariant if the feature is measured by quantity. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceSkuCapabilities, self).__init__(**kwargs) - self.name = None - self.value = None - - -class ResourceSkuCapacity(msrest.serialization.Model): - """Describes scaling information of a SKU. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar minimum: The minimum capacity. - :vartype minimum: long - :ivar maximum: The maximum capacity. - :vartype maximum: long - :ivar default: The default capacity. - :vartype default: long - :ivar scale_type: The scale type applicable to the SKU. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.datamigration.models.ResourceSkuCapacityScaleType - """ - - _validation = { - 'minimum': {'readonly': True}, - 'maximum': {'readonly': True}, - 'default': {'readonly': True}, - 'scale_type': {'readonly': True}, - } - - _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'long'}, - 'maximum': {'key': 'maximum', 'type': 'long'}, - 'default': {'key': 'default', 'type': 'long'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceSkuCapacity, self).__init__(**kwargs) - self.minimum = None - self.maximum = None - self.default = None - self.scale_type = None - - -class ResourceSkuCosts(msrest.serialization.Model): - """Describes metadata for retrieving price info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar meter_id: Used for querying price from commerce. - :vartype meter_id: str - :ivar quantity: The multiplier is needed to extend the base metered cost. - :vartype quantity: long - :ivar extended_unit: An invariant to show the extended unit. - :vartype extended_unit: str - """ - - _validation = { - 'meter_id': {'readonly': True}, - 'quantity': {'readonly': True}, - 'extended_unit': {'readonly': True}, - } - - _attribute_map = { - 'meter_id': {'key': 'meterID', 'type': 'str'}, - 'quantity': {'key': 'quantity', 'type': 'long'}, - 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceSkuCosts, self).__init__(**kwargs) - self.meter_id = None - self.quantity = None - self.extended_unit = None - - -class ResourceSkuRestrictions(msrest.serialization.Model): - """Describes scaling information of a SKU. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The type of restrictions. Possible values include: "location". - :vartype type: str or ~azure.mgmt.datamigration.models.ResourceSkuRestrictionsType - :ivar values: The value of restrictions. If the restriction type is set to location. This would - be different locations where the SKU is restricted. - :vartype values: list[str] - :ivar reason_code: The reason code for restriction. Possible values include: "QuotaId", - "NotAvailableForSubscription". - :vartype reason_code: str or ~azure.mgmt.datamigration.models.ResourceSkuRestrictionsReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - 'reason_code': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceSkuRestrictions, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = None - - -class ResourceSkusResult(msrest.serialization.Model): - """The DMS List SKUs operation response. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. The list of SKUs available for the subscription. - :type value: list[~azure.mgmt.datamigration.models.ResourceSku] - :param next_link: The uri to fetch the next page of DMS SKUs. Call ListNext() with this to - fetch the next page of DMS SKUs. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceSku]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceSkusResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class SchemaComparisonValidationResult(msrest.serialization.Model): - """Results for schema comparison between the source and target. - - :param schema_differences: List of schema differences between the source and target databases. - :type schema_differences: ~azure.mgmt.datamigration.models.SchemaComparisonValidationResultType - :param validation_errors: List of errors that happened while performing schema compare - validation. - :type validation_errors: ~azure.mgmt.datamigration.models.ValidationError - :param source_database_object_count: Count of source database objects. - :type source_database_object_count: dict[str, long] - :param target_database_object_count: Count of target database objects. - :type target_database_object_count: dict[str, long] - """ - - _attribute_map = { - 'schema_differences': {'key': 'schemaDifferences', 'type': 'SchemaComparisonValidationResultType'}, - 'validation_errors': {'key': 'validationErrors', 'type': 'ValidationError'}, - 'source_database_object_count': {'key': 'sourceDatabaseObjectCount', 'type': '{long}'}, - 'target_database_object_count': {'key': 'targetDatabaseObjectCount', 'type': '{long}'}, - } - - def __init__( - self, - **kwargs - ): - super(SchemaComparisonValidationResult, self).__init__(**kwargs) - self.schema_differences = kwargs.get('schema_differences', None) - self.validation_errors = kwargs.get('validation_errors', None) - self.source_database_object_count = kwargs.get('source_database_object_count', None) - self.target_database_object_count = kwargs.get('target_database_object_count', None) - - -class SchemaComparisonValidationResultType(msrest.serialization.Model): - """Description about the errors happen while performing migration validation. - - :param object_name: Name of the object that has the difference. - :type object_name: str - :param object_type: Type of the object that has the difference. e.g - (Table/View/StoredProcedure). Possible values include: "StoredProcedures", "Table", "User", - "View", "Function". - :type object_type: str or ~azure.mgmt.datamigration.models.ObjectType - :param update_action: Update action type with respect to target. Possible values include: - "DeletedOnTarget", "ChangedOnTarget", "AddedOnTarget". - :type update_action: str or ~azure.mgmt.datamigration.models.UpdateActionType - """ - - _attribute_map = { - 'object_name': {'key': 'objectName', 'type': 'str'}, - 'object_type': {'key': 'objectType', 'type': 'str'}, - 'update_action': {'key': 'updateAction', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SchemaComparisonValidationResultType, self).__init__(**kwargs) - self.object_name = kwargs.get('object_name', None) - self.object_type = kwargs.get('object_type', None) - self.update_action = kwargs.get('update_action', None) - - -class SchemaMigrationSetting(msrest.serialization.Model): - """Settings for migrating schema from source to target. - - :param schema_option: Option on how to migrate the schema. Possible values include: "None", - "ExtractFromSource", "UseStorageFile". - :type schema_option: str or ~azure.mgmt.datamigration.models.SchemaMigrationOption - :param file_id: Resource Identifier of a file resource containing the uploaded schema file. - :type file_id: str - """ - - _attribute_map = { - 'schema_option': {'key': 'schemaOption', 'type': 'str'}, - 'file_id': {'key': 'fileId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SchemaMigrationSetting, self).__init__(**kwargs) - self.schema_option = kwargs.get('schema_option', None) - self.file_id = kwargs.get('file_id', None) - - -class SelectedCertificateInput(msrest.serialization.Model): - """Info for certificate to be exported for TDE enabled databases. - - All required parameters must be populated in order to send to Azure. - - :param certificate_name: Required. Name of certificate to be exported. - :type certificate_name: str - :param password: Required. Password to use for encrypting the exported certificate. - :type password: str - """ - - _validation = { - 'certificate_name': {'required': True}, - 'password': {'required': True}, - } - - _attribute_map = { - 'certificate_name': {'key': 'certificateName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SelectedCertificateInput, self).__init__(**kwargs) - self.certificate_name = kwargs['certificate_name'] - self.password = kwargs['password'] - - -class ServerProperties(msrest.serialization.Model): - """Server properties for MySQL type source. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar server_platform: Name of the server platform. - :vartype server_platform: str - :ivar server_name: Name of the server. - :vartype server_name: str - :ivar server_version: Version of the database server. - :vartype server_version: str - :ivar server_edition: Edition of the database server. - :vartype server_edition: str - :ivar server_operating_system_version: Version of the operating system. - :vartype server_operating_system_version: str - :ivar server_database_count: Number of databases in the server. - :vartype server_database_count: int - """ - - _validation = { - 'server_platform': {'readonly': True}, - 'server_name': {'readonly': True}, - 'server_version': {'readonly': True}, - 'server_edition': {'readonly': True}, - 'server_operating_system_version': {'readonly': True}, - 'server_database_count': {'readonly': True}, - } - - _attribute_map = { - 'server_platform': {'key': 'serverPlatform', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'server_version': {'key': 'serverVersion', 'type': 'str'}, - 'server_edition': {'key': 'serverEdition', 'type': 'str'}, - 'server_operating_system_version': {'key': 'serverOperatingSystemVersion', 'type': 'str'}, - 'server_database_count': {'key': 'serverDatabaseCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ServerProperties, self).__init__(**kwargs) - self.server_platform = None - self.server_name = None - self.server_version = None - self.server_edition = None - self.server_operating_system_version = None - self.server_database_count = None - - -class ServiceOperation(msrest.serialization.Model): - """Description of an action supported by the Database Migration Service. - - :param name: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. - :type name: str - :param display: Localized display text. - :type display: ~azure.mgmt.datamigration.models.ServiceOperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ServiceOperationDisplay'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - - -class ServiceOperationDisplay(msrest.serialization.Model): - """Localized display text. - - :param provider: The localized resource provider name. - :type provider: str - :param resource: The localized resource type name. - :type resource: str - :param operation: The localized operation name. - :type operation: str - :param description: The localized operation description. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class ServiceOperationList(msrest.serialization.Model): - """OData page of action (operation) objects. - - :param value: List of actions. - :type value: list[~azure.mgmt.datamigration.models.ServiceOperation] - :param next_link: URL to load the next page of actions. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ServiceOperation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceOperationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ServiceSku(msrest.serialization.Model): - """An Azure SKU instance. - - :param name: The unique name of the SKU, such as 'P3'. - :type name: str - :param tier: The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'. - :type tier: str - :param family: The SKU family, used when the service has multiple performance classes within a - tier, such as 'A', 'D', etc. for virtual machines. - :type family: str - :param size: The size of the SKU, used when the name alone does not denote a service size or - when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines. - :type size: str - :param capacity: The capacity of the SKU, if it supports scaling. - :type capacity: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceSku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - self.family = kwargs.get('family', None) - self.size = kwargs.get('size', None) - self.capacity = kwargs.get('capacity', None) - - -class ServiceSkuList(msrest.serialization.Model): - """OData page of available SKUs. - - :param value: List of service SKUs. - :type value: list[~azure.mgmt.datamigration.models.AvailableServiceSku] - :param next_link: URL to load the next page of service SKUs. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AvailableServiceSku]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceSkuList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class SqlConnectionInfo(ConnectionInfo): - """Information for connecting to SQL database server. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param data_source: Required. Data source in the format - Protocol:MachineName\SQLServerInstanceName,PortNumber. - :type data_source: str - :param authentication: Authentication type to use for connection. Possible values include: - "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", - "ActiveDirectoryPassword". - :type authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType - :param encrypt_connection: Whether to encrypt the connection. - :type encrypt_connection: bool - :param additional_settings: Additional connection settings. - :type additional_settings: str - :param trust_server_certificate: Whether to trust the server certificate. - :type trust_server_certificate: bool - :param platform: Server platform type for connection. Possible values include: "SqlOnPrem". - :type platform: str or ~azure.mgmt.datamigration.models.SqlSourcePlatform - """ - - _validation = { - 'type': {'required': True}, - 'data_source': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'data_source': {'key': 'dataSource', 'type': 'str'}, - 'authentication': {'key': 'authentication', 'type': 'str'}, - 'encrypt_connection': {'key': 'encryptConnection', 'type': 'bool'}, - 'additional_settings': {'key': 'additionalSettings', 'type': 'str'}, - 'trust_server_certificate': {'key': 'trustServerCertificate', 'type': 'bool'}, - 'platform': {'key': 'platform', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SqlConnectionInfo, self).__init__(**kwargs) - self.type = 'SqlConnectionInfo' # type: str - self.data_source = kwargs['data_source'] - self.authentication = kwargs.get('authentication', None) - self.encrypt_connection = kwargs.get('encrypt_connection', True) - self.additional_settings = kwargs.get('additional_settings', None) - self.trust_server_certificate = kwargs.get('trust_server_certificate', False) - self.platform = kwargs.get('platform', None) - - -class SsisMigrationInfo(msrest.serialization.Model): - """SSIS migration info with SSIS store type, overwrite policy. - - :param ssis_store_type: The SSIS store type of source, only SSIS catalog is supported now in - DMS. Possible values include: "SsisCatalog". - :type ssis_store_type: str or ~azure.mgmt.datamigration.models.SsisStoreType - :param project_overwrite_option: The overwrite option for the SSIS project migration. Possible - values include: "Ignore", "Overwrite". - :type project_overwrite_option: str or - ~azure.mgmt.datamigration.models.SsisMigrationOverwriteOption - :param environment_overwrite_option: The overwrite option for the SSIS environment migration. - Possible values include: "Ignore", "Overwrite". - :type environment_overwrite_option: str or - ~azure.mgmt.datamigration.models.SsisMigrationOverwriteOption - """ - - _attribute_map = { - 'ssis_store_type': {'key': 'ssisStoreType', 'type': 'str'}, - 'project_overwrite_option': {'key': 'projectOverwriteOption', 'type': 'str'}, - 'environment_overwrite_option': {'key': 'environmentOverwriteOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SsisMigrationInfo, self).__init__(**kwargs) - self.ssis_store_type = kwargs.get('ssis_store_type', None) - self.project_overwrite_option = kwargs.get('project_overwrite_option', None) - self.environment_overwrite_option = kwargs.get('environment_overwrite_option', None) - - -class StartMigrationScenarioServerRoleResult(msrest.serialization.Model): - """Server role migration result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of server role. - :vartype name: str - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar exceptions_and_warnings: Migration exceptions and warnings. - :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'name': {'readonly': True}, - 'state': {'readonly': True}, - 'exceptions_and_warnings': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'exceptions_and_warnings': {'key': 'exceptionsAndWarnings', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(StartMigrationScenarioServerRoleResult, self).__init__(**kwargs) - self.name = None - self.state = None - self.exceptions_and_warnings = None - - -class SyncMigrationDatabaseErrorEvent(msrest.serialization.Model): - """Database migration errors for online migration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar timestamp_string: String value of timestamp. - :vartype timestamp_string: str - :ivar event_type_string: Event type. - :vartype event_type_string: str - :ivar event_text: Event text. - :vartype event_text: str - """ - - _validation = { - 'timestamp_string': {'readonly': True}, - 'event_type_string': {'readonly': True}, - 'event_text': {'readonly': True}, - } - - _attribute_map = { - 'timestamp_string': {'key': 'timestampString', 'type': 'str'}, - 'event_type_string': {'key': 'eventTypeString', 'type': 'str'}, - 'event_text': {'key': 'eventText', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SyncMigrationDatabaseErrorEvent, self).__init__(**kwargs) - self.timestamp_string = None - self.event_type_string = None - self.event_text = None - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.datamigration.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.datamigration.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class TaskList(msrest.serialization.Model): - """OData page of tasks. - - :param value: List of tasks. - :type value: list[~azure.mgmt.datamigration.models.ProjectTask] - :param next_link: URL to load the next page of tasks. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProjectTask]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TaskList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class UploadOCIDriverTaskInput(msrest.serialization.Model): - """Input for the service task to upload an OCI driver. - - :param driver_share: File share information for the OCI driver archive. - :type driver_share: ~azure.mgmt.datamigration.models.FileShare - """ - - _attribute_map = { - 'driver_share': {'key': 'driverShare', 'type': 'FileShare'}, - } - - def __init__( - self, - **kwargs - ): - super(UploadOCIDriverTaskInput, self).__init__(**kwargs) - self.driver_share = kwargs.get('driver_share', None) - - -class UploadOCIDriverTaskOutput(msrest.serialization.Model): - """Output for the service task to upload an OCI driver. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar driver_package_name: The name of the driver package that was validated and uploaded. - :vartype driver_package_name: str - :ivar validation_errors: Validation errors. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'driver_package_name': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'driver_package_name': {'key': 'driverPackageName', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(UploadOCIDriverTaskOutput, self).__init__(**kwargs) - self.driver_package_name = None - self.validation_errors = None - - -class UploadOCIDriverTaskProperties(ProjectTaskProperties): - """Properties for the task that uploads an OCI driver. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Input for the service task to upload an OCI driver. - :type input: ~azure.mgmt.datamigration.models.UploadOCIDriverTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: list[~azure.mgmt.datamigration.models.UploadOCIDriverTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'UploadOCIDriverTaskInput'}, - 'output': {'key': 'output', 'type': '[UploadOCIDriverTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(UploadOCIDriverTaskProperties, self).__init__(**kwargs) - self.task_type = 'Service.Upload.OCI' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(ProjectTaskProperties): - """Properties for task that validates migration input for SQL to Azure SQL DB sync migrations. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ValidateSyncMigrationInputSqlServerTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: - list[~azure.mgmt.datamigration.models.ValidateSyncMigrationInputSqlServerTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ValidateSyncMigrationInputSqlServerTaskInput'}, - 'output': {'key': 'output', 'type': '[ValidateSyncMigrationInputSqlServerTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateMigrationInputSqlServerSqlDbSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'ValidateMigrationInput.SqlServer.SqlDb.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ValidateMigrationInputSqlServerSqlMISyncTaskInput(SqlServerSqlMISyncTaskInput): - """Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. - - All required parameters must be populated in order to send to Azure. - - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] - :param backup_file_share: Backup file share information for all selected databases. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param storage_resource_id: Required. Fully qualified resourceId of storage. - :type storage_resource_id: str - :param source_connection_info: Required. Connection information for source SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Connection information for Azure SQL Database Managed - Instance. - :type target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo - :param azure_app: Required. Azure Active Directory Application the DMS instance will use to - connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage - Account. - :type azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp - """ - - _validation = { - 'selected_databases': {'required': True}, - 'storage_resource_id': {'required': True}, - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'azure_app': {'required': True}, - } - - _attribute_map = { - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSqlServerSqlMIDatabaseInput]'}, - 'backup_file_share': {'key': 'backupFileShare', 'type': 'FileShare'}, - 'storage_resource_id': {'key': 'storageResourceId', 'type': 'str'}, - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'MiSqlConnectionInfo'}, - 'azure_app': {'key': 'azureApp', 'type': 'AzureActiveDirectoryApp'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateMigrationInputSqlServerSqlMISyncTaskInput, self).__init__(**kwargs) - - -class ValidateMigrationInputSqlServerSqlMISyncTaskOutput(msrest.serialization.Model): - """Output for task that validates migration input for Azure SQL Database Managed Instance online migration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Database identifier. - :vartype id: str - :ivar name: Name of database. - :vartype name: str - :ivar validation_errors: Errors associated with a selected database object. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateMigrationInputSqlServerSqlMISyncTaskOutput, self).__init__(**kwargs) - self.id = None - self.name = None - self.validation_errors = None - - -class ValidateMigrationInputSqlServerSqlMISyncTaskProperties(ProjectTaskProperties): - """Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance sync scenario. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMISyncTaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: - list[~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMISyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ValidateMigrationInputSqlServerSqlMISyncTaskInput'}, - 'output': {'key': 'output', 'type': '[ValidateMigrationInputSqlServerSqlMISyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateMigrationInputSqlServerSqlMISyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ValidateMigrationInputSqlServerSqlMITaskInput(msrest.serialization.Model): - """Input for task that validates migration input for SQL to Azure SQL Managed Instance. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] - :param selected_logins: Logins to migrate. - :type selected_logins: list[str] - :param backup_file_share: Backup file share information for all selected databases. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param backup_blob_share: Required. SAS URI of Azure Storage Account Container to be used for - storing backup files. - :type backup_blob_share: ~azure.mgmt.datamigration.models.BlobShare - :param backup_mode: Backup Mode to specify whether to use existing backup or create new backup. - Possible values include: "CreateBackup", "ExistingBackup". - :type backup_mode: str or ~azure.mgmt.datamigration.models.BackupMode - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'selected_databases': {'required': True}, - 'backup_blob_share': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSqlServerSqlMIDatabaseInput]'}, - 'selected_logins': {'key': 'selectedLogins', 'type': '[str]'}, - 'backup_file_share': {'key': 'backupFileShare', 'type': 'FileShare'}, - 'backup_blob_share': {'key': 'backupBlobShare', 'type': 'BlobShare'}, - 'backup_mode': {'key': 'backupMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateMigrationInputSqlServerSqlMITaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.target_connection_info = kwargs['target_connection_info'] - self.selected_databases = kwargs['selected_databases'] - self.selected_logins = kwargs.get('selected_logins', None) - self.backup_file_share = kwargs.get('backup_file_share', None) - self.backup_blob_share = kwargs['backup_blob_share'] - self.backup_mode = kwargs.get('backup_mode', None) - - -class ValidateMigrationInputSqlServerSqlMITaskOutput(msrest.serialization.Model): - """Output for task that validates migration input for SQL to Azure SQL Managed Instance migrations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Result identifier. - :vartype id: str - :ivar name: Name of database. - :vartype name: str - :ivar restore_database_name_errors: Errors associated with the RestoreDatabaseName. - :vartype restore_database_name_errors: - list[~azure.mgmt.datamigration.models.ReportableException] - :ivar backup_folder_errors: Errors associated with the BackupFolder path. - :vartype backup_folder_errors: list[~azure.mgmt.datamigration.models.ReportableException] - :ivar backup_share_credentials_errors: Errors associated with backup share user name and - password credentials. - :vartype backup_share_credentials_errors: - list[~azure.mgmt.datamigration.models.ReportableException] - :ivar backup_storage_account_errors: Errors associated with the storage account provided. - :vartype backup_storage_account_errors: - list[~azure.mgmt.datamigration.models.ReportableException] - :ivar existing_backup_errors: Errors associated with existing backup files. - :vartype existing_backup_errors: list[~azure.mgmt.datamigration.models.ReportableException] - :param database_backup_info: Information about backup files when existing backup mode is used. - :type database_backup_info: ~azure.mgmt.datamigration.models.DatabaseBackupInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'restore_database_name_errors': {'readonly': True}, - 'backup_folder_errors': {'readonly': True}, - 'backup_share_credentials_errors': {'readonly': True}, - 'backup_storage_account_errors': {'readonly': True}, - 'existing_backup_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'restore_database_name_errors': {'key': 'restoreDatabaseNameErrors', 'type': '[ReportableException]'}, - 'backup_folder_errors': {'key': 'backupFolderErrors', 'type': '[ReportableException]'}, - 'backup_share_credentials_errors': {'key': 'backupShareCredentialsErrors', 'type': '[ReportableException]'}, - 'backup_storage_account_errors': {'key': 'backupStorageAccountErrors', 'type': '[ReportableException]'}, - 'existing_backup_errors': {'key': 'existingBackupErrors', 'type': '[ReportableException]'}, - 'database_backup_info': {'key': 'databaseBackupInfo', 'type': 'DatabaseBackupInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateMigrationInputSqlServerSqlMITaskOutput, self).__init__(**kwargs) - self.id = None - self.name = None - self.restore_database_name_errors = None - self.backup_folder_errors = None - self.backup_share_credentials_errors = None - self.backup_storage_account_errors = None - self.existing_backup_errors = None - self.database_backup_info = kwargs.get('database_backup_info', None) - - -class ValidateMigrationInputSqlServerSqlMITaskProperties(ProjectTaskProperties): - """Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMITaskInput - :ivar output: Task output. This is ignored if submitted. - :vartype output: - list[~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMITaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'ValidateMigrationInputSqlServerSqlMITaskInput'}, - 'output': {'key': 'output', 'type': '[ValidateMigrationInputSqlServerSqlMITaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateMigrationInputSqlServerSqlMITaskProperties, self).__init__(**kwargs) - self.task_type = 'ValidateMigrationInput.SqlServer.AzureSqlDbMI' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ValidateMongoDbTaskProperties(ProjectTaskProperties): - """Properties for the task that validates a migration between MongoDB data sources. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Describes how a MongoDB data migration should be performed. - :type input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings - :ivar output: An array containing a single MongoDbMigrationProgress object. - :vartype output: list[~azure.mgmt.datamigration.models.MongoDbMigrationProgress] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MongoDbMigrationSettings'}, - 'output': {'key': 'output', 'type': '[MongoDbMigrationProgress]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateMongoDbTaskProperties, self).__init__(**kwargs) - self.task_type = 'Validate.MongoDb' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskProperties): - """Properties for the task that validates a migration for Oracle to Azure Database for PostgreSQL for online migrations. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str - :ivar errors: Array of errors. This is ignored if submitted. - :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] - :ivar state: The state of the task. This is ignored if submitted. Possible values include: - "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", - "Faulted". - :vartype state: str or ~azure.mgmt.datamigration.models.TaskState - :ivar commands: Array of command properties. - :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Input for the task that migrates Oracle databases to Azure Database for - PostgreSQL for online migrations. - :type input: ~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskInput - :ivar output: An array containing a single validation error response object. - :vartype output: - list[~azure.mgmt.datamigration.models.ValidateOracleAzureDbPostgreSqlSyncTaskOutput] - """ - - _validation = { - 'task_type': {'required': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'commands': {'readonly': True}, - 'output': {'readonly': True}, - } - - _attribute_map = { - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ODataError]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, - 'client_data': {'key': 'clientData', 'type': '{str}'}, - 'input': {'key': 'input', 'type': 'MigrateOracleAzureDbPostgreSqlSyncTaskInput'}, - 'output': {'key': 'output', 'type': '[ValidateOracleAzureDbPostgreSqlSyncTaskOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateOracleAzureDbForPostgreSqlSyncTaskProperties, self).__init__(**kwargs) - self.task_type = 'Validate.Oracle.AzureDbPostgreSql.Sync' # type: str - self.input = kwargs.get('input', None) - self.output = None - - -class ValidateOracleAzureDbPostgreSqlSyncTaskOutput(msrest.serialization.Model): - """Output for task that validates migration input for Oracle to Azure Database for PostgreSQL for online migrations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar validation_errors: Errors associated with a selected database object. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateOracleAzureDbPostgreSqlSyncTaskOutput, self).__init__(**kwargs) - self.validation_errors = None - - -class ValidateSyncMigrationInputSqlServerTaskInput(msrest.serialization.Model): - """Input for task that validates migration input for SQL sync migrations. - - All required parameters must be populated in order to send to Azure. - - :param source_connection_info: Required. Information for connecting to source SQL server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: - list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncDatabaseInput] - """ - - _validation = { - 'source_connection_info': {'required': True}, - 'target_connection_info': {'required': True}, - 'selected_databases': {'required': True}, - } - - _attribute_map = { - 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, - 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSqlServerSqlDbSyncDatabaseInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateSyncMigrationInputSqlServerTaskInput, self).__init__(**kwargs) - self.source_connection_info = kwargs['source_connection_info'] - self.target_connection_info = kwargs['target_connection_info'] - self.selected_databases = kwargs['selected_databases'] - - -class ValidateSyncMigrationInputSqlServerTaskOutput(msrest.serialization.Model): - """Output for task that validates migration input for SQL sync migrations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Database identifier. - :vartype id: str - :ivar name: Name of database. - :vartype name: str - :ivar validation_errors: Errors associated with a selected database object. - :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'validation_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateSyncMigrationInputSqlServerTaskOutput, self).__init__(**kwargs) - self.id = None - self.name = None - self.validation_errors = None - - -class ValidationError(msrest.serialization.Model): - """Description about the errors happen while performing migration validation. - - :param text: Error Text. - :type text: str - :param severity: Severity of the error. Possible values include: "Message", "Warning", "Error". - :type severity: str or ~azure.mgmt.datamigration.models.Severity - """ - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidationError, self).__init__(**kwargs) - self.text = kwargs.get('text', None) - self.severity = kwargs.get('severity', None) - - -class WaitStatistics(msrest.serialization.Model): - """Wait statistics gathered during query batch execution. - - :param wait_type: Type of the Wait. - :type wait_type: str - :param wait_time_ms: Total wait time in millisecond(s). - :type wait_time_ms: float - :param wait_count: Total no. of waits. - :type wait_count: long - """ - - _attribute_map = { - 'wait_type': {'key': 'waitType', 'type': 'str'}, - 'wait_time_ms': {'key': 'waitTimeMs', 'type': 'float'}, - 'wait_count': {'key': 'waitCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(WaitStatistics, self).__init__(**kwargs) - self.wait_type = kwargs.get('wait_type', None) - self.wait_time_ms = kwargs.get('wait_time_ms', 0) - self.wait_count = kwargs.get('wait_count', None) diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_models_py3.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_models_py3.py index 2b210bbce4ea..e0fabe677e93 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_models_py3.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -20,8 +20,8 @@ class ApiError(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param error: Error information in OData format. - :type error: ~azure.mgmt.datamigration.models.ODataError + :ivar error: Error information in OData format. + :vartype error: ~azure.mgmt.datamigration.models.ODataError :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.datamigration.models.SystemData """ @@ -41,20 +41,56 @@ def __init__( error: Optional["ODataError"] = None, **kwargs ): + """ + :keyword error: Error information in OData format. + :paramtype error: ~azure.mgmt.datamigration.models.ODataError + """ super(ApiError, self).__init__(**kwargs) self.error = error self.system_data = None +class AuthenticationKeys(msrest.serialization.Model): + """An authentication key. + + :ivar auth_key1: The first authentication key. + :vartype auth_key1: str + :ivar auth_key2: The second authentication key. + :vartype auth_key2: str + """ + + _attribute_map = { + 'auth_key1': {'key': 'authKey1', 'type': 'str'}, + 'auth_key2': {'key': 'authKey2', 'type': 'str'}, + } + + def __init__( + self, + *, + auth_key1: Optional[str] = None, + auth_key2: Optional[str] = None, + **kwargs + ): + """ + :keyword auth_key1: The first authentication key. + :paramtype auth_key1: str + :keyword auth_key2: The second authentication key. + :paramtype auth_key2: str + """ + super(AuthenticationKeys, self).__init__(**kwargs) + self.auth_key1 = auth_key1 + self.auth_key2 = auth_key2 + + class AvailableServiceSku(msrest.serialization.Model): """Describes the available service SKU. - :param resource_type: The resource type, including the provider namespace. - :type resource_type: str - :param sku: SKU name, tier, etc. - :type sku: ~azure.mgmt.datamigration.models.AvailableServiceSkuSku - :param capacity: A description of the scaling capacities of the SKU. - :type capacity: ~azure.mgmt.datamigration.models.AvailableServiceSkuCapacity + :ivar resource_type: The resource type, including the provider namespace. + :vartype resource_type: str + :ivar sku: SKU name, tier, etc. + :vartype sku: ~azure.mgmt.datamigration.models.AvailableServiceSkuSku + :ivar capacity: A description of the scaling capacities of the SKU. + :vartype capacity: ~azure.mgmt.datamigration.models.AvailableServiceSkuCapacity """ _attribute_map = { @@ -71,6 +107,14 @@ def __init__( capacity: Optional["AvailableServiceSkuCapacity"] = None, **kwargs ): + """ + :keyword resource_type: The resource type, including the provider namespace. + :paramtype resource_type: str + :keyword sku: SKU name, tier, etc. + :paramtype sku: ~azure.mgmt.datamigration.models.AvailableServiceSkuSku + :keyword capacity: A description of the scaling capacities of the SKU. + :paramtype capacity: ~azure.mgmt.datamigration.models.AvailableServiceSkuCapacity + """ super(AvailableServiceSku, self).__init__(**kwargs) self.resource_type = resource_type self.sku = sku @@ -80,15 +124,15 @@ def __init__( class AvailableServiceSkuCapacity(msrest.serialization.Model): """A description of the scaling capacities of the SKU. - :param minimum: The minimum capacity, usually 0 or 1. - :type minimum: int - :param maximum: The maximum capacity. - :type maximum: int - :param default: The default capacity. - :type default: int - :param scale_type: The scalability approach. Possible values include: "none", "manual", + :ivar minimum: The minimum capacity, usually 0 or 1. + :vartype minimum: int + :ivar maximum: The maximum capacity. + :vartype maximum: int + :ivar default: The default capacity. + :vartype default: int + :ivar scale_type: The scalability approach. Possible values include: "none", "manual", "automatic". - :type scale_type: str or ~azure.mgmt.datamigration.models.ServiceScalability + :vartype scale_type: str or ~azure.mgmt.datamigration.models.ServiceScalability """ _attribute_map = { @@ -107,6 +151,17 @@ def __init__( scale_type: Optional[Union[str, "ServiceScalability"]] = None, **kwargs ): + """ + :keyword minimum: The minimum capacity, usually 0 or 1. + :paramtype minimum: int + :keyword maximum: The maximum capacity. + :paramtype maximum: int + :keyword default: The default capacity. + :paramtype default: int + :keyword scale_type: The scalability approach. Possible values include: "none", "manual", + "automatic". + :paramtype scale_type: str or ~azure.mgmt.datamigration.models.ServiceScalability + """ super(AvailableServiceSkuCapacity, self).__init__(**kwargs) self.minimum = minimum self.maximum = maximum @@ -117,14 +172,14 @@ def __init__( class AvailableServiceSkuSku(msrest.serialization.Model): """SKU name, tier, etc. - :param name: The name of the SKU. - :type name: str - :param family: SKU family. - :type family: str - :param size: SKU size. - :type size: str - :param tier: The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical". - :type tier: str + :ivar name: The name of the SKU. + :vartype name: str + :ivar family: SKU family. + :vartype family: str + :ivar size: SKU size. + :vartype size: str + :ivar tier: The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical". + :vartype tier: str """ _attribute_map = { @@ -143,6 +198,16 @@ def __init__( tier: Optional[str] = None, **kwargs ): + """ + :keyword name: The name of the SKU. + :paramtype name: str + :keyword family: SKU family. + :paramtype family: str + :keyword size: SKU size. + :paramtype size: str + :keyword tier: The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical". + :paramtype tier: str + """ super(AvailableServiceSkuSku, self).__init__(**kwargs) self.name = name self.family = family @@ -153,52 +218,131 @@ def __init__( class AzureActiveDirectoryApp(msrest.serialization.Model): """Azure Active Directory Application. - All required parameters must be populated in order to send to Azure. - - :param application_id: Required. Application ID of the Azure Active Directory Application. - :type application_id: str - :param app_key: Required. Key used to authenticate to the Azure Active Directory Application. - :type app_key: str - :param tenant_id: Required. Tenant id of the customer. - :type tenant_id: str + :ivar application_id: Application ID of the Azure Active Directory Application. + :vartype application_id: str + :ivar app_key: Key used to authenticate to the Azure Active Directory Application. + :vartype app_key: str + :ivar tenant_id: Tenant id of the customer. + :vartype tenant_id: str + :ivar ignore_azure_permissions: Ignore checking azure permissions on the AAD app. + :vartype ignore_azure_permissions: bool """ - _validation = { - 'application_id': {'required': True}, - 'app_key': {'required': True}, - 'tenant_id': {'required': True}, - } - _attribute_map = { 'application_id': {'key': 'applicationId', 'type': 'str'}, 'app_key': {'key': 'appKey', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'ignore_azure_permissions': {'key': 'ignoreAzurePermissions', 'type': 'bool'}, } def __init__( self, *, - application_id: str, - app_key: str, - tenant_id: str, - **kwargs - ): + application_id: Optional[str] = None, + app_key: Optional[str] = None, + tenant_id: Optional[str] = None, + ignore_azure_permissions: Optional[bool] = None, + **kwargs + ): + """ + :keyword application_id: Application ID of the Azure Active Directory Application. + :paramtype application_id: str + :keyword app_key: Key used to authenticate to the Azure Active Directory Application. + :paramtype app_key: str + :keyword tenant_id: Tenant id of the customer. + :paramtype tenant_id: str + :keyword ignore_azure_permissions: Ignore checking azure permissions on the AAD app. + :paramtype ignore_azure_permissions: bool + """ super(AzureActiveDirectoryApp, self).__init__(**kwargs) self.application_id = application_id self.app_key = app_key self.tenant_id = tenant_id + self.ignore_azure_permissions = ignore_azure_permissions + + +class AzureBlob(msrest.serialization.Model): + """Azure Blob Details. + + :ivar storage_account_resource_id: Resource Id of the storage account where backups are stored. + :vartype storage_account_resource_id: str + :ivar account_key: Storage Account Key. + :vartype account_key: str + :ivar blob_container_name: Blob container name where backups are stored. + :vartype blob_container_name: str + """ + + _attribute_map = { + 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, + 'account_key': {'key': 'accountKey', 'type': 'str'}, + 'blob_container_name': {'key': 'blobContainerName', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_resource_id: Optional[str] = None, + account_key: Optional[str] = None, + blob_container_name: Optional[str] = None, + **kwargs + ): + """ + :keyword storage_account_resource_id: Resource Id of the storage account where backups are + stored. + :paramtype storage_account_resource_id: str + :keyword account_key: Storage Account Key. + :paramtype account_key: str + :keyword blob_container_name: Blob container name where backups are stored. + :paramtype blob_container_name: str + """ + super(AzureBlob, self).__init__(**kwargs) + self.storage_account_resource_id = storage_account_resource_id + self.account_key = account_key + self.blob_container_name = blob_container_name + + +class BackupConfiguration(msrest.serialization.Model): + """Backup Configuration. + + :ivar source_location: Source location of backups. + :vartype source_location: ~azure.mgmt.datamigration.models.SourceLocation + :ivar target_location: Target location for copying backups. + :vartype target_location: ~azure.mgmt.datamigration.models.TargetLocation + """ + + _attribute_map = { + 'source_location': {'key': 'sourceLocation', 'type': 'SourceLocation'}, + 'target_location': {'key': 'targetLocation', 'type': 'TargetLocation'}, + } + + def __init__( + self, + *, + source_location: Optional["SourceLocation"] = None, + target_location: Optional["TargetLocation"] = None, + **kwargs + ): + """ + :keyword source_location: Source location of backups. + :paramtype source_location: ~azure.mgmt.datamigration.models.SourceLocation + :keyword target_location: Target location for copying backups. + :paramtype target_location: ~azure.mgmt.datamigration.models.TargetLocation + """ + super(BackupConfiguration, self).__init__(**kwargs) + self.source_location = source_location + self.target_location = target_location class BackupFileInfo(msrest.serialization.Model): """Information of the backup file. - :param file_location: Location of the backup file in shared folder. - :type file_location: str - :param family_sequence_number: Sequence number of the backup file in the backup set. - :type family_sequence_number: int - :param status: Status of the backup file during migration. Possible values include: "Arrived", + :ivar file_location: Location of the backup file in shared folder. + :vartype file_location: str + :ivar family_sequence_number: Sequence number of the backup file in the backup set. + :vartype family_sequence_number: int + :ivar status: Status of the backup file during migration. Possible values include: "Arrived", "Queued", "Uploading", "Uploaded", "Restoring", "Restored", "Cancelled". - :type status: str or ~azure.mgmt.datamigration.models.BackupFileStatus + :vartype status: str or ~azure.mgmt.datamigration.models.BackupFileStatus """ _attribute_map = { @@ -215,6 +359,15 @@ def __init__( status: Optional[Union[str, "BackupFileStatus"]] = None, **kwargs ): + """ + :keyword file_location: Location of the backup file in shared folder. + :paramtype file_location: str + :keyword family_sequence_number: Sequence number of the backup file in the backup set. + :paramtype family_sequence_number: int + :keyword status: Status of the backup file during migration. Possible values include: + "Arrived", "Queued", "Uploading", "Uploaded", "Restoring", "Restored", "Cancelled". + :paramtype status: str or ~azure.mgmt.datamigration.models.BackupFileStatus + """ super(BackupFileInfo, self).__init__(**kwargs) self.file_location = file_location self.family_sequence_number = family_sequence_number @@ -224,28 +377,28 @@ def __init__( class BackupSetInfo(msrest.serialization.Model): """Information of backup set. - :param backup_set_id: Id for the set of backup files. - :type backup_set_id: str - :param first_lsn: First log sequence number of the backup file. - :type first_lsn: str - :param last_lsn: Last log sequence number of the backup file. - :type last_lsn: str - :param last_modified_time: Last modified time of the backup file in share location. - :type last_modified_time: ~datetime.datetime - :param backup_type: Enum of the different backup types. Possible values include: "Database", + :ivar backup_set_id: Id for the set of backup files. + :vartype backup_set_id: str + :ivar first_lsn: First log sequence number of the backup file. + :vartype first_lsn: str + :ivar last_lsn: Last log sequence number of the backup file. + :vartype last_lsn: str + :ivar last_modified_time: Last modified time of the backup file in share location. + :vartype last_modified_time: ~datetime.datetime + :ivar backup_type: Enum of the different backup types. Possible values include: "Database", "TransactionLog", "File", "DifferentialDatabase", "DifferentialFile", "Partial", "DifferentialPartial". - :type backup_type: str or ~azure.mgmt.datamigration.models.BackupType - :param list_of_backup_files: List of files in the backup set. - :type list_of_backup_files: list[~azure.mgmt.datamigration.models.BackupFileInfo] - :param database_name: Name of the database to which the backup set belongs. - :type database_name: str - :param backup_start_date: Date and time that the backup operation began. - :type backup_start_date: ~datetime.datetime - :param backup_finished_date: Date and time that the backup operation finished. - :type backup_finished_date: ~datetime.datetime - :param is_backup_restored: Whether the backup set is restored or not. - :type is_backup_restored: bool + :vartype backup_type: str or ~azure.mgmt.datamigration.models.BackupType + :ivar list_of_backup_files: List of files in the backup set. + :vartype list_of_backup_files: list[~azure.mgmt.datamigration.models.BackupFileInfo] + :ivar database_name: Name of the database to which the backup set belongs. + :vartype database_name: str + :ivar backup_start_date: Date and time that the backup operation began. + :vartype backup_start_date: ~datetime.datetime + :ivar backup_finished_date: Date and time that the backup operation finished. + :vartype backup_finished_date: ~datetime.datetime + :ivar is_backup_restored: Whether the backup set is restored or not. + :vartype is_backup_restored: bool """ _attribute_map = { @@ -276,6 +429,30 @@ def __init__( is_backup_restored: Optional[bool] = None, **kwargs ): + """ + :keyword backup_set_id: Id for the set of backup files. + :paramtype backup_set_id: str + :keyword first_lsn: First log sequence number of the backup file. + :paramtype first_lsn: str + :keyword last_lsn: Last log sequence number of the backup file. + :paramtype last_lsn: str + :keyword last_modified_time: Last modified time of the backup file in share location. + :paramtype last_modified_time: ~datetime.datetime + :keyword backup_type: Enum of the different backup types. Possible values include: "Database", + "TransactionLog", "File", "DifferentialDatabase", "DifferentialFile", "Partial", + "DifferentialPartial". + :paramtype backup_type: str or ~azure.mgmt.datamigration.models.BackupType + :keyword list_of_backup_files: List of files in the backup set. + :paramtype list_of_backup_files: list[~azure.mgmt.datamigration.models.BackupFileInfo] + :keyword database_name: Name of the database to which the backup set belongs. + :paramtype database_name: str + :keyword backup_start_date: Date and time that the backup operation began. + :paramtype backup_start_date: ~datetime.datetime + :keyword backup_finished_date: Date and time that the backup operation finished. + :paramtype backup_finished_date: ~datetime.datetime + :keyword is_backup_restored: Whether the backup set is restored or not. + :paramtype is_backup_restored: bool + """ super(BackupSetInfo, self).__init__(**kwargs) self.backup_set_id = backup_set_id self.first_lsn = first_lsn @@ -292,16 +469,10 @@ def __init__( class BlobShare(msrest.serialization.Model): """Blob container storage information. - All required parameters must be populated in order to send to Azure. - - :param sas_uri: Required. SAS URI of Azure Storage Account Container. - :type sas_uri: str + :ivar sas_uri: SAS URI of Azure Storage Account Container. + :vartype sas_uri: str """ - _validation = { - 'sas_uri': {'required': True}, - } - _attribute_map = { 'sas_uri': {'key': 'sasUri', 'type': 'str'}, } @@ -309,9 +480,13 @@ class BlobShare(msrest.serialization.Model): def __init__( self, *, - sas_uri: str, + sas_uri: Optional[str] = None, **kwargs ): + """ + :keyword sas_uri: SAS URI of Azure Storage Account Container. + :paramtype sas_uri: str + """ super(BlobShare, self).__init__(**kwargs) self.sas_uri = sas_uri @@ -319,8 +494,8 @@ def __init__( class CheckOCIDriverTaskInput(msrest.serialization.Model): """Input for the service task to check for OCI drivers. - :param server_version: Version of the source server to check against. Optional. - :type server_version: str + :ivar server_version: Version of the source server to check against. Optional. + :vartype server_version: str """ _attribute_map = { @@ -333,6 +508,10 @@ def __init__( server_version: Optional[str] = None, **kwargs ): + """ + :keyword server_version: Version of the source server to check against. Optional. + :paramtype server_version: str + """ super(CheckOCIDriverTaskInput, self).__init__(**kwargs) self.server_version = server_version @@ -342,8 +521,8 @@ class CheckOCIDriverTaskOutput(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param installed_driver: Information about the installed driver if found and valid. - :type installed_driver: ~azure.mgmt.datamigration.models.OracleOCIDriverInfo + :ivar installed_driver: Information about the installed driver if found and valid. + :vartype installed_driver: ~azure.mgmt.datamigration.models.OracleOCIDriverInfo :ivar validation_errors: Validation errors. :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] """ @@ -363,6 +542,10 @@ def __init__( installed_driver: Optional["OracleOCIDriverInfo"] = None, **kwargs ): + """ + :keyword installed_driver: Information about the installed driver if found and valid. + :paramtype installed_driver: ~azure.mgmt.datamigration.models.OracleOCIDriverInfo + """ super(CheckOCIDriverTaskOutput, self).__init__(**kwargs) self.installed_driver = installed_driver self.validation_errors = None @@ -378,8 +561,25 @@ class ProjectTaskProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -388,8 +588,8 @@ class ProjectTaskProperties(msrest.serialization.Model): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] """ _validation = { @@ -417,6 +617,10 @@ def __init__( client_data: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + """ super(ProjectTaskProperties, self).__init__(**kwargs) self.task_type = None # type: Optional[str] self.errors = None @@ -432,8 +636,25 @@ class CheckOCIDriverTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -442,10 +663,10 @@ class CheckOCIDriverTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Input for the service task to check for OCI drivers. - :type input: ~azure.mgmt.datamigration.models.CheckOCIDriverTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Input for the service task to check for OCI drivers. + :vartype input: ~azure.mgmt.datamigration.models.CheckOCIDriverTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.CheckOCIDriverTaskOutput] """ @@ -475,6 +696,12 @@ def __init__( input: Optional["CheckOCIDriverTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Input for the service task to check for OCI drivers. + :paramtype input: ~azure.mgmt.datamigration.models.CheckOCIDriverTaskInput + """ super(CheckOCIDriverTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Service.Check.OCI' # type: str self.input = input @@ -491,8 +718,10 @@ class CommandProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str + :ivar command_type: Required. Command type.Constant filled by server. Possible values include: + "Migrate.Sync.Complete.Database", "Migrate.SqlServer.AzureDbSqlMi.Complete", "cancel", + "finish", "restart". + :vartype command_type: str or ~azure.mgmt.datamigration.models.CommandType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the command. This is ignored if submitted. Possible values include: @@ -520,6 +749,8 @@ def __init__( self, **kwargs ): + """ + """ super(CommandProperties, self).__init__(**kwargs) self.command_type = None # type: Optional[str] self.errors = None @@ -534,12 +765,12 @@ class ConnectionInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str + :ivar type: Required. Type of connection info.Constant filled by server. + :vartype type: str + :ivar user_name: User name. + :vartype user_name: str + :ivar password: Password credential. + :vartype password: str """ _validation = { @@ -563,6 +794,12 @@ def __init__( password: Optional[str] = None, **kwargs ): + """ + :keyword user_name: User name. + :paramtype user_name: str + :keyword password: Password credential. + :paramtype password: str + """ super(ConnectionInfo, self).__init__(**kwargs) self.type = None # type: Optional[str] self.user_name = user_name @@ -576,8 +813,25 @@ class ConnectToMongoDbTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -586,10 +840,10 @@ class ConnectToMongoDbTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Describes a connection to a MongoDB data source. - :type input: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Describes a connection to a MongoDB data source. + :vartype input: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo :ivar output: An array containing a single MongoDbClusterInfo object. :vartype output: list[~azure.mgmt.datamigration.models.MongoDbClusterInfo] """ @@ -619,6 +873,12 @@ def __init__( input: Optional["MongoDbConnectionInfo"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Describes a connection to a MongoDB data source. + :paramtype input: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + """ super(ConnectToMongoDbTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Connect.MongoDb' # type: str self.input = input @@ -630,18 +890,18 @@ class ConnectToSourceMySqlTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Information for connecting to MySQL source. - :type source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param target_platform: Target Platform for the migration. Possible values include: - "SqlServer", "AzureDbForMySQL". - :type target_platform: str or ~azure.mgmt.datamigration.models.MySqlTargetPlatformType - :param check_permissions_group: Permission group for validations. Possible values include: + :ivar source_connection_info: Required. Information for connecting to MySQL source. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :ivar target_platform: Target Platform for the migration. Possible values include: "SqlServer", + "AzureDbForMySQL". + :vartype target_platform: str or ~azure.mgmt.datamigration.models.MySqlTargetPlatformType + :ivar check_permissions_group: Permission group for validations. Possible values include: "Default", "MigrationFromSqlServerToAzureDB", "MigrationFromSqlServerToAzureMI", - "MigrationFromMySQLToAzureDBForMySQL". - :type check_permissions_group: str or + "MigrationFromMySQLToAzureDBForMySQL", "MigrationFromSqlServerToAzureVM". + :vartype check_permissions_group: str or ~azure.mgmt.datamigration.models.ServerLevelPermissionsGroup - :param is_offline_migration: Flag for whether or not the migration is offline. - :type is_offline_migration: bool + :ivar is_offline_migration: Flag for whether or not the migration is offline. + :vartype is_offline_migration: bool """ _validation = { @@ -664,6 +924,20 @@ def __init__( is_offline_migration: Optional[bool] = False, **kwargs ): + """ + :keyword source_connection_info: Required. Information for connecting to MySQL source. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :keyword target_platform: Target Platform for the migration. Possible values include: + "SqlServer", "AzureDbForMySQL". + :paramtype target_platform: str or ~azure.mgmt.datamigration.models.MySqlTargetPlatformType + :keyword check_permissions_group: Permission group for validations. Possible values include: + "Default", "MigrationFromSqlServerToAzureDB", "MigrationFromSqlServerToAzureMI", + "MigrationFromMySQLToAzureDBForMySQL", "MigrationFromSqlServerToAzureVM". + :paramtype check_permissions_group: str or + ~azure.mgmt.datamigration.models.ServerLevelPermissionsGroup + :keyword is_offline_migration: Flag for whether or not the migration is offline. + :paramtype is_offline_migration: bool + """ super(ConnectToSourceMySqlTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.target_platform = target_platform @@ -678,8 +952,25 @@ class ConnectToSourceMySqlTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -688,10 +979,10 @@ class ConnectToSourceMySqlTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToSourceMySqlTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToSourceMySqlTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceNonSqlTaskOutput] """ @@ -721,6 +1012,12 @@ def __init__( input: Optional["ConnectToSourceMySqlTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ConnectToSourceMySqlTaskInput + """ super(ConnectToSourceMySqlTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToSource.MySql' # type: str self.input = input @@ -764,6 +1061,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToSourceNonSqlTaskOutput, self).__init__(**kwargs) self.id = None self.source_server_brand_version = None @@ -777,8 +1076,8 @@ class ConnectToSourceOracleSyncTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Information for connecting to Oracle source. - :type source_connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo + :ivar source_connection_info: Required. Information for connecting to Oracle source. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo """ _validation = { @@ -795,6 +1094,10 @@ def __init__( source_connection_info: "OracleConnectionInfo", **kwargs ): + """ + :keyword source_connection_info: Required. Information for connecting to Oracle source. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo + """ super(ConnectToSourceOracleSyncTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info @@ -832,6 +1135,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToSourceOracleSyncTaskOutput, self).__init__(**kwargs) self.source_server_version = None self.databases = None @@ -846,8 +1151,25 @@ class ConnectToSourceOracleSyncTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -856,10 +1178,10 @@ class ConnectToSourceOracleSyncTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToSourceOracleSyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToSourceOracleSyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceOracleSyncTaskOutput] """ @@ -889,6 +1211,12 @@ def __init__( input: Optional["ConnectToSourceOracleSyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ConnectToSourceOracleSyncTaskInput + """ super(ConnectToSourceOracleSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToSource.Oracle.Sync' # type: str self.input = input @@ -900,8 +1228,8 @@ class ConnectToSourcePostgreSqlSyncTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Connection information for source PostgreSQL server. - :type source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :ivar source_connection_info: Required. Connection information for source PostgreSQL server. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo """ _validation = { @@ -918,6 +1246,10 @@ def __init__( source_connection_info: "PostgreSqlConnectionInfo", **kwargs ): + """ + :keyword source_connection_info: Required. Connection information for source PostgreSQL server. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + """ super(ConnectToSourcePostgreSqlSyncTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info @@ -959,6 +1291,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToSourcePostgreSqlSyncTaskOutput, self).__init__(**kwargs) self.id = None self.source_server_version = None @@ -974,8 +1308,25 @@ class ConnectToSourcePostgreSqlSyncTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -984,10 +1335,10 @@ class ConnectToSourcePostgreSqlSyncTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToSourcePostgreSqlSyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToSourcePostgreSqlSyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourcePostgreSqlSyncTaskOutput] """ @@ -1017,6 +1368,12 @@ def __init__( input: Optional["ConnectToSourcePostgreSqlSyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ConnectToSourcePostgreSqlSyncTaskInput + """ super(ConnectToSourcePostgreSqlSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToSource.PostgreSql.Sync' # type: str self.input = input @@ -1030,8 +1387,25 @@ class ConnectToSourceSqlServerSyncTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -1040,10 +1414,10 @@ class ConnectToSourceSqlServerSyncTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskOutput] """ @@ -1073,6 +1447,12 @@ def __init__( input: Optional["ConnectToSourceSqlServerTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskInput + """ super(ConnectToSourceSqlServerSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToSource.SqlServer.Sync' # type: str self.input = input @@ -1084,25 +1464,27 @@ class ConnectToSourceSqlServerTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Connection information for Source SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param check_permissions_group: Permission group for validations. Possible values include: + :ivar source_connection_info: Required. Connection information for Source SQL Server. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar check_permissions_group: Permission group for validations. Possible values include: "Default", "MigrationFromSqlServerToAzureDB", "MigrationFromSqlServerToAzureMI", - "MigrationFromMySQLToAzureDBForMySQL". - :type check_permissions_group: str or + "MigrationFromMySQLToAzureDBForMySQL", "MigrationFromSqlServerToAzureVM". + :vartype check_permissions_group: str or ~azure.mgmt.datamigration.models.ServerLevelPermissionsGroup - :param collect_databases: Flag for whether to collect databases from source server. - :type collect_databases: bool - :param collect_logins: Flag for whether to collect logins from source server. - :type collect_logins: bool - :param collect_agent_jobs: Flag for whether to collect agent jobs from source server. - :type collect_agent_jobs: bool - :param collect_tde_certificate_info: Flag for whether to collect TDE Certificate names from + :ivar collect_databases: Flag for whether to collect databases from source server. + :vartype collect_databases: bool + :ivar collect_logins: Flag for whether to collect logins from source server. + :vartype collect_logins: bool + :ivar collect_agent_jobs: Flag for whether to collect agent jobs from source server. + :vartype collect_agent_jobs: bool + :ivar collect_tde_certificate_info: Flag for whether to collect TDE Certificate names from + source server. + :vartype collect_tde_certificate_info: bool + :ivar validate_ssis_catalog_only: Flag for whether to validate SSIS catalog is reachable on the source server. - :type collect_tde_certificate_info: bool - :param validate_ssis_catalog_only: Flag for whether to validate SSIS catalog is reachable on - the source server. - :type validate_ssis_catalog_only: bool + :vartype validate_ssis_catalog_only: bool + :ivar encrypted_key_for_secure_fields: encrypted key for secure fields. + :vartype encrypted_key_for_secure_fields: str """ _validation = { @@ -1117,6 +1499,7 @@ class ConnectToSourceSqlServerTaskInput(msrest.serialization.Model): 'collect_agent_jobs': {'key': 'collectAgentJobs', 'type': 'bool'}, 'collect_tde_certificate_info': {'key': 'collectTdeCertificateInfo', 'type': 'bool'}, 'validate_ssis_catalog_only': {'key': 'validateSsisCatalogOnly', 'type': 'bool'}, + 'encrypted_key_for_secure_fields': {'key': 'encryptedKeyForSecureFields', 'type': 'str'}, } def __init__( @@ -1129,8 +1512,32 @@ def __init__( collect_agent_jobs: Optional[bool] = False, collect_tde_certificate_info: Optional[bool] = False, validate_ssis_catalog_only: Optional[bool] = False, - **kwargs - ): + encrypted_key_for_secure_fields: Optional[str] = None, + **kwargs + ): + """ + :keyword source_connection_info: Required. Connection information for Source SQL Server. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword check_permissions_group: Permission group for validations. Possible values include: + "Default", "MigrationFromSqlServerToAzureDB", "MigrationFromSqlServerToAzureMI", + "MigrationFromMySQLToAzureDBForMySQL", "MigrationFromSqlServerToAzureVM". + :paramtype check_permissions_group: str or + ~azure.mgmt.datamigration.models.ServerLevelPermissionsGroup + :keyword collect_databases: Flag for whether to collect databases from source server. + :paramtype collect_databases: bool + :keyword collect_logins: Flag for whether to collect logins from source server. + :paramtype collect_logins: bool + :keyword collect_agent_jobs: Flag for whether to collect agent jobs from source server. + :paramtype collect_agent_jobs: bool + :keyword collect_tde_certificate_info: Flag for whether to collect TDE Certificate names from + source server. + :paramtype collect_tde_certificate_info: bool + :keyword validate_ssis_catalog_only: Flag for whether to validate SSIS catalog is reachable on + the source server. + :paramtype validate_ssis_catalog_only: bool + :keyword encrypted_key_for_secure_fields: encrypted key for secure fields. + :paramtype encrypted_key_for_secure_fields: str + """ super(ConnectToSourceSqlServerTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.check_permissions_group = check_permissions_group @@ -1139,6 +1546,7 @@ def __init__( self.collect_agent_jobs = collect_agent_jobs self.collect_tde_certificate_info = collect_tde_certificate_info self.validate_ssis_catalog_only = validate_ssis_catalog_only + self.encrypted_key_for_secure_fields = encrypted_key_for_secure_fields class ConnectToSourceSqlServerTaskOutput(msrest.serialization.Model): @@ -1153,9 +1561,9 @@ class ConnectToSourceSqlServerTaskOutput(msrest.serialization.Model): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Type of result - database level or task level.Constant filled by + :ivar result_type: Required. Type of result - database level or task level.Constant filled by server. - :type result_type: str + :vartype result_type: str """ _validation = { @@ -1176,6 +1584,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToSourceSqlServerTaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -1190,9 +1600,9 @@ class ConnectToSourceSqlServerTaskOutputAgentJobLevel(ConnectToSourceSqlServerTa :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Type of result - database level or task level.Constant filled by + :ivar result_type: Required. Type of result - database level or task level.Constant filled by server. - :type result_type: str + :vartype result_type: str :ivar name: Agent Job name. :vartype name: str :ivar job_category: The type of Agent Job. @@ -1237,6 +1647,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToSourceSqlServerTaskOutputAgentJobLevel, self).__init__(**kwargs) self.result_type = 'AgentJobLevelOutput' # type: str self.name = None @@ -1257,9 +1669,9 @@ class ConnectToSourceSqlServerTaskOutputDatabaseLevel(ConnectToSourceSqlServerTa :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Type of result - database level or task level.Constant filled by + :ivar result_type: Required. Type of result - database level or task level.Constant filled by server. - :type result_type: str + :vartype result_type: str :ivar name: Database name. :vartype name: str :ivar size_mb: Size of the file in megabytes. @@ -1300,6 +1712,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToSourceSqlServerTaskOutputDatabaseLevel, self).__init__(**kwargs) self.result_type = 'DatabaseLevelOutput' # type: str self.name = None @@ -1318,9 +1732,9 @@ class ConnectToSourceSqlServerTaskOutputLoginLevel(ConnectToSourceSqlServerTaskO :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Type of result - database level or task level.Constant filled by + :ivar result_type: Required. Type of result - database level or task level.Constant filled by server. - :type result_type: str + :vartype result_type: str :ivar name: Login name. :vartype name: str :ivar login_type: The type of login. Possible values include: "WindowsUser", "WindowsGroup", @@ -1358,6 +1772,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToSourceSqlServerTaskOutputLoginLevel, self).__init__(**kwargs) self.result_type = 'LoginLevelOutput' # type: str self.name = None @@ -1376,9 +1792,9 @@ class ConnectToSourceSqlServerTaskOutputTaskLevel(ConnectToSourceSqlServerTaskOu :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Type of result - database level or task level.Constant filled by + :ivar result_type: Required. Type of result - database level or task level.Constant filled by server. - :type result_type: str + :vartype result_type: str :ivar databases: Source databases as a map from database name to database id. :vartype databases: str :ivar logins: Source logins as a map from login name to login id. @@ -1424,6 +1840,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToSourceSqlServerTaskOutputTaskLevel, self).__init__(**kwargs) self.result_type = 'TaskLevelOutput' # type: str self.databases = None @@ -1442,8 +1860,25 @@ class ConnectToSourceSqlServerTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -1452,12 +1887,14 @@ class ConnectToSourceSqlServerTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskOutput] + :ivar task_id: Task id. + :vartype task_id: str """ _validation = { @@ -1476,6 +1913,7 @@ class ConnectToSourceSqlServerTaskProperties(ProjectTaskProperties): 'client_data': {'key': 'clientData', 'type': '{str}'}, 'input': {'key': 'input', 'type': 'ConnectToSourceSqlServerTaskInput'}, 'output': {'key': 'output', 'type': '[ConnectToSourceSqlServerTaskOutput]'}, + 'task_id': {'key': 'taskId', 'type': 'str'}, } def __init__( @@ -1483,12 +1921,22 @@ def __init__( *, client_data: Optional[Dict[str, str]] = None, input: Optional["ConnectToSourceSqlServerTaskInput"] = None, + task_id: Optional[str] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskInput + :keyword task_id: Task id. + :paramtype task_id: str + """ super(ConnectToSourceSqlServerTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToSource.SqlServer' # type: str self.input = input self.output = None + self.task_id = task_id class ConnectToTargetAzureDbForMySqlTaskInput(msrest.serialization.Model): @@ -1496,13 +1944,13 @@ class ConnectToTargetAzureDbForMySqlTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Connection information for source MySQL server. - :type source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param target_connection_info: Required. Connection information for target Azure Database for + :ivar source_connection_info: Required. Connection information for source MySQL server. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :ivar target_connection_info: Required. Connection information for target Azure Database for MySQL server. - :type target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param is_offline_migration: Flag for whether or not the migration is offline. - :type is_offline_migration: bool + :vartype target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :ivar is_offline_migration: Flag for whether or not the migration is offline. + :vartype is_offline_migration: bool """ _validation = { @@ -1524,6 +1972,15 @@ def __init__( is_offline_migration: Optional[bool] = False, **kwargs ): + """ + :keyword source_connection_info: Required. Connection information for source MySQL server. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :keyword target_connection_info: Required. Connection information for target Azure Database for + MySQL server. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :keyword is_offline_migration: Flag for whether or not the migration is offline. + :paramtype is_offline_migration: bool + """ super(ConnectToTargetAzureDbForMySqlTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.target_connection_info = target_connection_info @@ -1567,6 +2024,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToTargetAzureDbForMySqlTaskOutput, self).__init__(**kwargs) self.id = None self.server_version = None @@ -1582,8 +2041,25 @@ class ConnectToTargetAzureDbForMySqlTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -1592,10 +2068,10 @@ class ConnectToTargetAzureDbForMySqlTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForMySqlTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForMySqlTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForMySqlTaskOutput] @@ -1626,6 +2102,12 @@ def __init__( input: Optional["ConnectToTargetAzureDbForMySqlTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForMySqlTaskInput + """ super(ConnectToTargetAzureDbForMySqlTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToTarget.AzureDbForMySql' # type: str self.input = input @@ -1637,11 +2119,11 @@ class ConnectToTargetAzureDbForPostgreSqlSyncTaskInput(msrest.serialization.Mode All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Connection information for source PostgreSQL server. - :type source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - :param target_connection_info: Required. Connection information for target Azure Database for + :ivar source_connection_info: Required. Connection information for source PostgreSQL server. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :ivar target_connection_info: Required. Connection information for target Azure Database for PostgreSQL server. - :type target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :vartype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo """ _validation = { @@ -1661,6 +2143,13 @@ def __init__( target_connection_info: "PostgreSqlConnectionInfo", **kwargs ): + """ + :keyword source_connection_info: Required. Connection information for source PostgreSQL server. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :keyword target_connection_info: Required. Connection information for target Azure Database for + PostgreSQL server. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + """ super(ConnectToTargetAzureDbForPostgreSqlSyncTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.target_connection_info = target_connection_info @@ -1703,6 +2192,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput, self).__init__(**kwargs) self.id = None self.target_server_version = None @@ -1718,8 +2209,25 @@ class ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskPropertie All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -1728,10 +2236,11 @@ class ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskPropertie :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForPostgreSqlSyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: + ~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForPostgreSqlSyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput] @@ -1762,6 +2271,13 @@ def __init__( input: Optional["ConnectToTargetAzureDbForPostgreSqlSyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: + ~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForPostgreSqlSyncTaskInput + """ super(ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToTarget.AzureDbForPostgreSql.Sync' # type: str self.input = input @@ -1773,9 +2289,9 @@ class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(msrest.serializatio All required parameters must be populated in order to send to Azure. - :param target_connection_info: Required. Connection information for target Azure Database for + :ivar target_connection_info: Required. Connection information for target Azure Database for PostgreSQL server. - :type target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :vartype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo """ _validation = { @@ -1792,6 +2308,11 @@ def __init__( target_connection_info: "PostgreSqlConnectionInfo", **kwargs ): + """ + :keyword target_connection_info: Required. Connection information for target Azure Database for + PostgreSQL server. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + """ super(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput, self).__init__(**kwargs) self.target_connection_info = target_connection_info @@ -1809,8 +2330,8 @@ class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(msrest.serializati :vartype target_server_brand_version: str :ivar validation_errors: Validation errors associated with the task. :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException] - :param database_schema_map: Mapping of schemas per database. - :type database_schema_map: + :ivar database_schema_map: Mapping of schemas per database. + :vartype database_schema_map: list[~azure.mgmt.datamigration.models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem] """ @@ -1835,6 +2356,11 @@ def __init__( database_schema_map: Optional[List["ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem"]] = None, **kwargs ): + """ + :keyword database_schema_map: Mapping of schemas per database. + :paramtype database_schema_map: + list[~azure.mgmt.datamigration.models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem] + """ super(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput, self).__init__(**kwargs) self.target_server_version = None self.databases = None @@ -1846,10 +2372,10 @@ def __init__( class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem(msrest.serialization.Model): """ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem. - :param database: - :type database: str - :param schemas: - :type schemas: list[str] + :ivar database: + :vartype database: str + :ivar schemas: + :vartype schemas: list[str] """ _attribute_map = { @@ -1864,6 +2390,12 @@ def __init__( schemas: Optional[List[str]] = None, **kwargs ): + """ + :keyword database: + :paramtype database: str + :keyword schemas: + :paramtype schemas: list[str] + """ super(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem, self).__init__(**kwargs) self.database = database self.schemas = schemas @@ -1876,8 +2408,25 @@ class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskPro All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -1886,10 +2435,10 @@ class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskPro :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: @@ -1921,6 +2470,13 @@ def __init__( input: Optional["ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: + ~azure.mgmt.datamigration.models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput + """ super(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync' # type: str self.input = input @@ -1932,10 +2488,10 @@ class ConnectToTargetSqlDbSyncTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Connection information for source SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Connection information for target SQL DB. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar source_connection_info: Required. Connection information for source SQL Server. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Connection information for target SQL DB. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo """ _validation = { @@ -1955,6 +2511,12 @@ def __init__( target_connection_info: "SqlConnectionInfo", **kwargs ): + """ + :keyword source_connection_info: Required. Connection information for source SQL Server. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Connection information for target SQL DB. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + """ super(ConnectToTargetSqlDbSyncTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.target_connection_info = target_connection_info @@ -1967,8 +2529,25 @@ class ConnectToTargetSqlDbSyncTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -1977,10 +2556,10 @@ class ConnectToTargetSqlDbSyncTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlDbSyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlDbSyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskOutput] """ @@ -2010,6 +2589,12 @@ def __init__( input: Optional["ConnectToTargetSqlDbSyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlDbSyncTaskInput + """ super(ConnectToTargetSqlDbSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToTarget.SqlDb.Sync' # type: str self.input = input @@ -2021,8 +2606,11 @@ class ConnectToTargetSqlDbTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param target_connection_info: Required. Connection information for target SQL DB. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Connection information for target SQL DB. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar query_object_counts: Boolean flag indicating whether to query object counts for each + database on the target server. + :vartype query_object_counts: bool """ _validation = { @@ -2031,16 +2619,26 @@ class ConnectToTargetSqlDbTaskInput(msrest.serialization.Model): _attribute_map = { 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, + 'query_object_counts': {'key': 'queryObjectCounts', 'type': 'bool'}, } def __init__( self, *, target_connection_info: "SqlConnectionInfo", + query_object_counts: Optional[bool] = None, **kwargs ): + """ + :keyword target_connection_info: Required. Connection information for target SQL DB. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword query_object_counts: Boolean flag indicating whether to query object counts for each + database on the target server. + :paramtype query_object_counts: bool + """ super(ConnectToTargetSqlDbTaskInput, self).__init__(**kwargs) self.target_connection_info = target_connection_info + self.query_object_counts = query_object_counts class ConnectToTargetSqlDbTaskOutput(msrest.serialization.Model): @@ -2076,6 +2674,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToTargetSqlDbTaskOutput, self).__init__(**kwargs) self.id = None self.databases = None @@ -2090,8 +2690,25 @@ class ConnectToTargetSqlDbTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -2100,12 +2717,14 @@ class ConnectToTargetSqlDbTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskOutput] + :ivar created_on: DateTime in UTC when the task was created. + :vartype created_on: str """ _validation = { @@ -2124,6 +2743,7 @@ class ConnectToTargetSqlDbTaskProperties(ProjectTaskProperties): 'client_data': {'key': 'clientData', 'type': '{str}'}, 'input': {'key': 'input', 'type': 'ConnectToTargetSqlDbTaskInput'}, 'output': {'key': 'output', 'type': '[ConnectToTargetSqlDbTaskOutput]'}, + 'created_on': {'key': 'createdOn', 'type': 'str'}, } def __init__( @@ -2131,12 +2751,22 @@ def __init__( *, client_data: Optional[Dict[str, str]] = None, input: Optional["ConnectToTargetSqlDbTaskInput"] = None, + created_on: Optional[str] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskInput + :keyword created_on: DateTime in UTC when the task was created. + :paramtype created_on: str + """ super(ConnectToTargetSqlDbTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToTarget.SqlDb' # type: str self.input = input self.output = None + self.created_on = created_on class ConnectToTargetSqlMISyncTaskInput(msrest.serialization.Model): @@ -2144,13 +2774,13 @@ class ConnectToTargetSqlMISyncTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param target_connection_info: Required. Connection information for Azure SQL Database Managed + :ivar target_connection_info: Required. Connection information for Azure SQL Database Managed Instance. - :type target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo - :param azure_app: Required. Azure Active Directory Application the DMS instance will use to + :vartype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo + :ivar azure_app: Required. Azure Active Directory Application the DMS instance will use to connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage Account. - :type azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + :vartype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp """ _validation = { @@ -2170,6 +2800,15 @@ def __init__( azure_app: "AzureActiveDirectoryApp", **kwargs ): + """ + :keyword target_connection_info: Required. Connection information for Azure SQL Database + Managed Instance. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo + :keyword azure_app: Required. Azure Active Directory Application the DMS instance will use to + connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage + Account. + :paramtype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + """ super(ConnectToTargetSqlMISyncTaskInput, self).__init__(**kwargs) self.target_connection_info = target_connection_info self.azure_app = azure_app @@ -2204,6 +2843,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToTargetSqlMISyncTaskOutput, self).__init__(**kwargs) self.target_server_version = None self.target_server_brand_version = None @@ -2217,8 +2858,25 @@ class ConnectToTargetSqlMISyncTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -2227,10 +2885,10 @@ class ConnectToTargetSqlMISyncTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlMISyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlMISyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlMISyncTaskOutput] """ @@ -2260,6 +2918,12 @@ def __init__( input: Optional["ConnectToTargetSqlMISyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlMISyncTaskInput + """ super(ConnectToTargetSqlMISyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToTarget.AzureSqlDbMI.Sync.LRS' # type: str self.input = input @@ -2271,15 +2935,15 @@ class ConnectToTargetSqlMITaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param target_connection_info: Required. Connection information for target SQL Server. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param collect_logins: Flag for whether to collect logins from target SQL MI server. - :type collect_logins: bool - :param collect_agent_jobs: Flag for whether to collect agent jobs from target SQL MI server. - :type collect_agent_jobs: bool - :param validate_ssis_catalog_only: Flag for whether to validate SSIS catalog is reachable on - the target SQL MI server. - :type validate_ssis_catalog_only: bool + :ivar target_connection_info: Required. Connection information for target SQL Server. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar collect_logins: Flag for whether to collect logins from target SQL MI server. + :vartype collect_logins: bool + :ivar collect_agent_jobs: Flag for whether to collect agent jobs from target SQL MI server. + :vartype collect_agent_jobs: bool + :ivar validate_ssis_catalog_only: Flag for whether to validate SSIS catalog is reachable on the + target SQL MI server. + :vartype validate_ssis_catalog_only: bool """ _validation = { @@ -2302,6 +2966,17 @@ def __init__( validate_ssis_catalog_only: Optional[bool] = False, **kwargs ): + """ + :keyword target_connection_info: Required. Connection information for target SQL Server. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword collect_logins: Flag for whether to collect logins from target SQL MI server. + :paramtype collect_logins: bool + :keyword collect_agent_jobs: Flag for whether to collect agent jobs from target SQL MI server. + :paramtype collect_agent_jobs: bool + :keyword validate_ssis_catalog_only: Flag for whether to validate SSIS catalog is reachable on + the target SQL MI server. + :paramtype validate_ssis_catalog_only: bool + """ super(ConnectToTargetSqlMITaskInput, self).__init__(**kwargs) self.target_connection_info = target_connection_info self.collect_logins = collect_logins @@ -2350,6 +3025,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConnectToTargetSqlMITaskOutput, self).__init__(**kwargs) self.id = None self.target_server_version = None @@ -2366,8 +3043,25 @@ class ConnectToTargetSqlMITaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -2376,10 +3070,10 @@ class ConnectToTargetSqlMITaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlMITaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlMITaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlMITaskOutput] """ @@ -2409,54 +3103,137 @@ def __init__( input: Optional["ConnectToTargetSqlMITaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlMITaskInput + """ super(ConnectToTargetSqlMITaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ConnectToTarget.AzureSqlDbMI' # type: str self.input = input self.output = None +class CopyProgressDetails(msrest.serialization.Model): + """Details on progress of ADF copy activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar table_name: Table Name. + :vartype table_name: str + :ivar status: Status of the Copy activity (InProgress, Succeeded, Failed, Canceled). + :vartype status: str + :ivar parallel_copy_type: Type of parallel copy (Dynamic range, Physical partition, none). + :vartype parallel_copy_type: str + :ivar used_parallel_copies: The degree of parallelization. + :vartype used_parallel_copies: int + :ivar data_read: Bytes read. + :vartype data_read: long + :ivar data_written: Bytes written. + :vartype data_written: long + :ivar rows_read: Rows read. + :vartype rows_read: long + :ivar rows_copied: Rows Copied. + :vartype rows_copied: long + :ivar copy_start: Copy Start. + :vartype copy_start: ~datetime.datetime + :ivar copy_throughput: Copy throughput in KBps. + :vartype copy_throughput: float + :ivar copy_duration: Copy Duration in seconds. + :vartype copy_duration: int + """ + + _validation = { + 'table_name': {'readonly': True}, + 'status': {'readonly': True}, + 'parallel_copy_type': {'readonly': True}, + 'used_parallel_copies': {'readonly': True}, + 'data_read': {'readonly': True}, + 'data_written': {'readonly': True}, + 'rows_read': {'readonly': True}, + 'rows_copied': {'readonly': True}, + 'copy_start': {'readonly': True}, + 'copy_throughput': {'readonly': True}, + 'copy_duration': {'readonly': True}, + } + + _attribute_map = { + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'parallel_copy_type': {'key': 'parallelCopyType', 'type': 'str'}, + 'used_parallel_copies': {'key': 'usedParallelCopies', 'type': 'int'}, + 'data_read': {'key': 'dataRead', 'type': 'long'}, + 'data_written': {'key': 'dataWritten', 'type': 'long'}, + 'rows_read': {'key': 'rowsRead', 'type': 'long'}, + 'rows_copied': {'key': 'rowsCopied', 'type': 'long'}, + 'copy_start': {'key': 'copyStart', 'type': 'iso-8601'}, + 'copy_throughput': {'key': 'copyThroughput', 'type': 'float'}, + 'copy_duration': {'key': 'copyDuration', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(CopyProgressDetails, self).__init__(**kwargs) + self.table_name = None + self.status = None + self.parallel_copy_type = None + self.used_parallel_copies = None + self.data_read = None + self.data_written = None + self.rows_read = None + self.rows_copied = None + self.copy_start = None + self.copy_throughput = None + self.copy_duration = None + + class Database(msrest.serialization.Model): """Information about a single database. - :param id: Unique identifier for the database. - :type id: str - :param name: Name of the database. - :type name: str - :param compatibility_level: SQL Server compatibility level of database. Possible values - include: "CompatLevel80", "CompatLevel90", "CompatLevel100", "CompatLevel110", - "CompatLevel120", "CompatLevel130", "CompatLevel140". - :type compatibility_level: str or ~azure.mgmt.datamigration.models.DatabaseCompatLevel - :param collation: Collation name of the database. - :type collation: str - :param server_name: Name of the server. - :type server_name: str - :param fqdn: Fully qualified name. - :type fqdn: str - :param install_id: Install id of the database. - :type install_id: str - :param server_version: Version of the server. - :type server_version: str - :param server_edition: Edition of the server. - :type server_edition: str - :param server_level: Product level of the server (RTM, SP, CTP). - :type server_level: str - :param server_default_data_path: Default path of the data files. - :type server_default_data_path: str - :param server_default_log_path: Default path of the log files. - :type server_default_log_path: str - :param server_default_backup_path: Default path of the backup folder. - :type server_default_backup_path: str - :param server_core_count: Number of cores on the server. - :type server_core_count: int - :param server_visible_online_core_count: Number of cores on the server that have VISIBLE ONLINE + :ivar id: Unique identifier for the database. + :vartype id: str + :ivar name: Name of the database. + :vartype name: str + :ivar compatibility_level: SQL Server compatibility level of database. Possible values include: + "CompatLevel80", "CompatLevel90", "CompatLevel100", "CompatLevel110", "CompatLevel120", + "CompatLevel130", "CompatLevel140". + :vartype compatibility_level: str or ~azure.mgmt.datamigration.models.DatabaseCompatLevel + :ivar collation: Collation name of the database. + :vartype collation: str + :ivar server_name: Name of the server. + :vartype server_name: str + :ivar fqdn: Fully qualified name. + :vartype fqdn: str + :ivar install_id: Install id of the database. + :vartype install_id: str + :ivar server_version: Version of the server. + :vartype server_version: str + :ivar server_edition: Edition of the server. + :vartype server_edition: str + :ivar server_level: Product level of the server (RTM, SP, CTP). + :vartype server_level: str + :ivar server_default_data_path: Default path of the data files. + :vartype server_default_data_path: str + :ivar server_default_log_path: Default path of the log files. + :vartype server_default_log_path: str + :ivar server_default_backup_path: Default path of the backup folder. + :vartype server_default_backup_path: str + :ivar server_core_count: Number of cores on the server. + :vartype server_core_count: int + :ivar server_visible_online_core_count: Number of cores on the server that have VISIBLE ONLINE status. - :type server_visible_online_core_count: int - :param database_state: State of the database. Possible values include: "Online", "Restoring", + :vartype server_visible_online_core_count: int + :ivar database_state: State of the database. Possible values include: "Online", "Restoring", "Recovering", "RecoveryPending", "Suspect", "Emergency", "Offline", "Copying", "OfflineSecondary". - :type database_state: str or ~azure.mgmt.datamigration.models.DatabaseState - :param server_id: The unique Server Id. - :type server_id: str + :vartype database_state: str or ~azure.mgmt.datamigration.models.DatabaseState + :ivar server_id: The unique Server Id. + :vartype server_id: str """ _attribute_map = { @@ -2501,6 +3278,47 @@ def __init__( server_id: Optional[str] = None, **kwargs ): + """ + :keyword id: Unique identifier for the database. + :paramtype id: str + :keyword name: Name of the database. + :paramtype name: str + :keyword compatibility_level: SQL Server compatibility level of database. Possible values + include: "CompatLevel80", "CompatLevel90", "CompatLevel100", "CompatLevel110", + "CompatLevel120", "CompatLevel130", "CompatLevel140". + :paramtype compatibility_level: str or ~azure.mgmt.datamigration.models.DatabaseCompatLevel + :keyword collation: Collation name of the database. + :paramtype collation: str + :keyword server_name: Name of the server. + :paramtype server_name: str + :keyword fqdn: Fully qualified name. + :paramtype fqdn: str + :keyword install_id: Install id of the database. + :paramtype install_id: str + :keyword server_version: Version of the server. + :paramtype server_version: str + :keyword server_edition: Edition of the server. + :paramtype server_edition: str + :keyword server_level: Product level of the server (RTM, SP, CTP). + :paramtype server_level: str + :keyword server_default_data_path: Default path of the data files. + :paramtype server_default_data_path: str + :keyword server_default_log_path: Default path of the log files. + :paramtype server_default_log_path: str + :keyword server_default_backup_path: Default path of the backup folder. + :paramtype server_default_backup_path: str + :keyword server_core_count: Number of cores on the server. + :paramtype server_core_count: int + :keyword server_visible_online_core_count: Number of cores on the server that have VISIBLE + ONLINE status. + :paramtype server_visible_online_core_count: int + :keyword database_state: State of the database. Possible values include: "Online", "Restoring", + "Recovering", "RecoveryPending", "Suspect", "Emergency", "Offline", "Copying", + "OfflineSecondary". + :paramtype database_state: str or ~azure.mgmt.datamigration.models.DatabaseState + :keyword server_id: The unique Server Id. + :paramtype server_id: str + """ super(Database, self).__init__(**kwargs) self.id = id self.name = name @@ -2572,6 +3390,8 @@ def __init__( self, **kwargs ): + """ + """ super(DatabaseBackupInfo, self).__init__(**kwargs) self.database_name = None self.backup_type = None @@ -2586,21 +3406,21 @@ def __init__( class DatabaseFileInfo(msrest.serialization.Model): """Database file specific information. - :param database_name: Name of the database. - :type database_name: str - :param id: Unique identifier for database file. - :type id: str - :param logical_name: Logical name of the file. - :type logical_name: str - :param physical_full_name: Operating-system full path of the file. - :type physical_full_name: str - :param restore_full_name: Suggested full path of the file for restoring. - :type restore_full_name: str - :param file_type: Database file type. Possible values include: "Rows", "Log", "Filestream", + :ivar database_name: Name of the database. + :vartype database_name: str + :ivar id: Unique identifier for database file. + :vartype id: str + :ivar logical_name: Logical name of the file. + :vartype logical_name: str + :ivar physical_full_name: Operating-system full path of the file. + :vartype physical_full_name: str + :ivar restore_full_name: Suggested full path of the file for restoring. + :vartype restore_full_name: str + :ivar file_type: Database file type. Possible values include: "Rows", "Log", "Filestream", "NotSupported", "Fulltext". - :type file_type: str or ~azure.mgmt.datamigration.models.DatabaseFileType - :param size_mb: Size of the file in megabytes. - :type size_mb: float + :vartype file_type: str or ~azure.mgmt.datamigration.models.DatabaseFileType + :ivar size_mb: Size of the file in megabytes. + :vartype size_mb: float """ _attribute_map = { @@ -2625,6 +3445,23 @@ def __init__( size_mb: Optional[float] = None, **kwargs ): + """ + :keyword database_name: Name of the database. + :paramtype database_name: str + :keyword id: Unique identifier for database file. + :paramtype id: str + :keyword logical_name: Logical name of the file. + :paramtype logical_name: str + :keyword physical_full_name: Operating-system full path of the file. + :paramtype physical_full_name: str + :keyword restore_full_name: Suggested full path of the file for restoring. + :paramtype restore_full_name: str + :keyword file_type: Database file type. Possible values include: "Rows", "Log", "Filestream", + "NotSupported", "Fulltext". + :paramtype file_type: str or ~azure.mgmt.datamigration.models.DatabaseFileType + :keyword size_mb: Size of the file in megabytes. + :paramtype size_mb: float + """ super(DatabaseFileInfo, self).__init__(**kwargs) self.database_name = database_name self.id = id @@ -2638,17 +3475,17 @@ def __init__( class DatabaseFileInput(msrest.serialization.Model): """Database file specific information for input. - :param id: Unique identifier for database file. - :type id: str - :param logical_name: Logical name of the file. - :type logical_name: str - :param physical_full_name: Operating-system full path of the file. - :type physical_full_name: str - :param restore_full_name: Suggested full path of the file for restoring. - :type restore_full_name: str - :param file_type: Database file type. Possible values include: "Rows", "Log", "Filestream", + :ivar id: Unique identifier for database file. + :vartype id: str + :ivar logical_name: Logical name of the file. + :vartype logical_name: str + :ivar physical_full_name: Operating-system full path of the file. + :vartype physical_full_name: str + :ivar restore_full_name: Suggested full path of the file for restoring. + :vartype restore_full_name: str + :ivar file_type: Database file type. Possible values include: "Rows", "Log", "Filestream", "NotSupported", "Fulltext". - :type file_type: str or ~azure.mgmt.datamigration.models.DatabaseFileType + :vartype file_type: str or ~azure.mgmt.datamigration.models.DatabaseFileType """ _attribute_map = { @@ -2669,6 +3506,19 @@ def __init__( file_type: Optional[Union[str, "DatabaseFileType"]] = None, **kwargs ): + """ + :keyword id: Unique identifier for database file. + :paramtype id: str + :keyword logical_name: Logical name of the file. + :paramtype logical_name: str + :keyword physical_full_name: Operating-system full path of the file. + :paramtype physical_full_name: str + :keyword restore_full_name: Suggested full path of the file for restoring. + :paramtype restore_full_name: str + :keyword file_type: Database file type. Possible values include: "Rows", "Log", "Filestream", + "NotSupported", "Fulltext". + :paramtype file_type: str or ~azure.mgmt.datamigration.models.DatabaseFileType + """ super(DatabaseFileInput, self).__init__(**kwargs) self.id = id self.logical_name = logical_name @@ -2682,8 +3532,8 @@ class DatabaseInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_database_name: Required. Name of the database. - :type source_database_name: str + :ivar source_database_name: Required. Name of the database. + :vartype source_database_name: str """ _validation = { @@ -2700,186 +3550,930 @@ def __init__( source_database_name: str, **kwargs ): + """ + :keyword source_database_name: Required. Name of the database. + :paramtype source_database_name: str + """ super(DatabaseInfo, self).__init__(**kwargs) self.source_database_name = source_database_name -class DatabaseObjectName(msrest.serialization.Model): - """A representation of the name of an object in a database. +class ProxyResource(msrest.serialization.Model): + """ProxyResource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar database_name: The unescaped name of the database containing the object. - :vartype database_name: str - :ivar object_name: The unescaped name of the object. - :vartype object_name: str - :ivar schema_name: The unescaped name of the schema containing the object. - :vartype schema_name: str - :param object_type: Type of the object in the database. Possible values include: - "StoredProcedures", "Table", "User", "View", "Function". - :type object_type: str or ~azure.mgmt.datamigration.models.ObjectType + :ivar id: + :vartype id: str + :ivar name: + :vartype name: str + :ivar type: + :vartype type: str """ _validation = { - 'database_name': {'readonly': True}, - 'object_name': {'readonly': True}, - 'schema_name': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'object_name': {'key': 'objectName', 'type': 'str'}, - 'schema_name': {'key': 'schemaName', 'type': 'str'}, - 'object_type': {'key': 'objectType', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, - *, - object_type: Optional[Union[str, "ObjectType"]] = None, **kwargs ): - super(DatabaseObjectName, self).__init__(**kwargs) - self.database_name = None - self.object_name = None - self.schema_name = None - self.object_type = object_type + """ + """ + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class DataItemMigrationSummaryResult(msrest.serialization.Model): - """Basic summary of a data item migration. +class DatabaseMigration(ProxyResource): + """Database Migration Resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Name of the item. + :ivar id: + :vartype id: str + :ivar name: :vartype name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar status_message: Status message. - :vartype status_message: str - :ivar items_count: Number of items. - :vartype items_count: long - :ivar items_completed_count: Number of successfully completed items. - :vartype items_completed_count: long - :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item. - :vartype error_prefix: str - :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the - item. - :vartype result_prefix: str + :ivar type: + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.datamigration.models.SystemData + :ivar properties: Database Migration Resource properties. + :vartype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationProperties """ _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'state': {'readonly': True}, - 'status_message': {'readonly': True}, - 'items_count': {'readonly': True}, - 'items_completed_count': {'readonly': True}, - 'error_prefix': {'readonly': True}, - 'result_prefix': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'state': {'key': 'state', 'type': 'str'}, - 'status_message': {'key': 'statusMessage', 'type': 'str'}, - 'items_count': {'key': 'itemsCount', 'type': 'long'}, - 'items_completed_count': {'key': 'itemsCompletedCount', 'type': 'long'}, - 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, - 'result_prefix': {'key': 'resultPrefix', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'DatabaseMigrationProperties'}, } def __init__( self, + *, + properties: Optional["DatabaseMigrationProperties"] = None, **kwargs ): - super(DataItemMigrationSummaryResult, self).__init__(**kwargs) - self.name = None - self.started_on = None - self.ended_on = None - self.state = None - self.status_message = None - self.items_count = None - self.items_completed_count = None - self.error_prefix = None - self.result_prefix = None + """ + :keyword properties: Database Migration Resource properties. + :paramtype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationProperties + """ + super(DatabaseMigration, self).__init__(**kwargs) + self.system_data = None + self.properties = properties -class DatabaseSummaryResult(DataItemMigrationSummaryResult): - """Summary of database results in the migration. +class DatabaseMigrationListResult(msrest.serialization.Model): + """A list of Database Migrations. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Name of the item. - :vartype name: str - :ivar started_on: Migration start time. - :vartype started_on: ~datetime.datetime - :ivar ended_on: Migration end time. - :vartype ended_on: ~datetime.datetime - :ivar state: Current state of migration. Possible values include: "None", "InProgress", - "Failed", "Warning", "Completed", "Skipped", "Stopped". - :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState - :ivar status_message: Status message. - :vartype status_message: str - :ivar items_count: Number of items. - :vartype items_count: long - :ivar items_completed_count: Number of successfully completed items. - :vartype items_completed_count: long - :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item. - :vartype error_prefix: str - :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the - item. - :vartype result_prefix: str - :ivar size_mb: Size of the database in megabytes. - :vartype size_mb: float + :ivar value: + :vartype value: list[~azure.mgmt.datamigration.models.DatabaseMigration] + :ivar next_link: + :vartype next_link: str """ _validation = { - 'name': {'readonly': True}, - 'started_on': {'readonly': True}, - 'ended_on': {'readonly': True}, - 'state': {'readonly': True}, - 'status_message': {'readonly': True}, - 'items_count': {'readonly': True}, - 'items_completed_count': {'readonly': True}, - 'error_prefix': {'readonly': True}, - 'result_prefix': {'readonly': True}, - 'size_mb': {'readonly': True}, + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, - 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, - 'state': {'key': 'state', 'type': 'str'}, - 'status_message': {'key': 'statusMessage', 'type': 'str'}, - 'items_count': {'key': 'itemsCount', 'type': 'long'}, - 'items_completed_count': {'key': 'itemsCompletedCount', 'type': 'long'}, - 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, - 'result_prefix': {'key': 'resultPrefix', 'type': 'str'}, - 'size_mb': {'key': 'sizeMB', 'type': 'float'}, + 'value': {'key': 'value', 'type': '[DatabaseMigration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DatabaseSummaryResult, self).__init__(**kwargs) - self.size_mb = None + """ + """ + super(DatabaseMigrationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None -class DatabaseTable(msrest.serialization.Model): - """Table properties. +class DatabaseMigrationProperties(msrest.serialization.Model): + """Database Migration Resource properties. - Variables are only populated by the server, and will be ignored when sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DatabaseMigrationPropertiesSqlDb, DatabaseMigrationPropertiesSqlMi, DatabaseMigrationPropertiesSqlVm. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar kind: Required. Constant filled by server. Possible values include: "SqlMi", "SqlVm", + "SqlDb". + :vartype kind: str or ~azure.mgmt.datamigration.models.ResourceType + :ivar scope: Resource Id of the target resource (SQL VM or SQL Managed Instance). + :vartype scope: str + :ivar provisioning_state: Provisioning State of migration. ProvisioningState as Succeeded + implies that validations have been performed and migration has started. + :vartype provisioning_state: str + :ivar migration_status: Migration status. + :vartype migration_status: str + :ivar started_on: Database migration start time. + :vartype started_on: ~datetime.datetime + :ivar ended_on: Database migration end time. + :vartype ended_on: ~datetime.datetime + :ivar source_sql_connection: Source SQL Server connection details. + :vartype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation + :ivar source_database_name: Name of the source database. + :vartype source_database_name: str + :ivar source_server_name: Name of the source sql server. + :vartype source_server_name: str + :ivar migration_service: Resource Id of the Migration Service. + :vartype migration_service: str + :ivar migration_operation_id: ID tracking current migration operation. + :vartype migration_operation_id: str + :ivar migration_failure_error: Error details in case of migration failure. + :vartype migration_failure_error: ~azure.mgmt.datamigration.models.ErrorInfo + :ivar target_database_collation: Database collation to be used for the target database. + :vartype target_database_collation: str + :ivar provisioning_error: Error message for migration provisioning failure, if any. + :vartype provisioning_error: str + """ + + _validation = { + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'migration_status': {'readonly': True}, + 'started_on': {'readonly': True}, + 'ended_on': {'readonly': True}, + 'source_server_name': {'readonly': True}, + 'migration_failure_error': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'migration_status': {'key': 'migrationStatus', 'type': 'str'}, + 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, + 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, + 'source_sql_connection': {'key': 'sourceSqlConnection', 'type': 'SqlConnectionInformation'}, + 'source_database_name': {'key': 'sourceDatabaseName', 'type': 'str'}, + 'source_server_name': {'key': 'sourceServerName', 'type': 'str'}, + 'migration_service': {'key': 'migrationService', 'type': 'str'}, + 'migration_operation_id': {'key': 'migrationOperationId', 'type': 'str'}, + 'migration_failure_error': {'key': 'migrationFailureError', 'type': 'ErrorInfo'}, + 'target_database_collation': {'key': 'targetDatabaseCollation', 'type': 'str'}, + 'provisioning_error': {'key': 'provisioningError', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'SqlDb': 'DatabaseMigrationPropertiesSqlDb', 'SqlMi': 'DatabaseMigrationPropertiesSqlMi', 'SqlVm': 'DatabaseMigrationPropertiesSqlVm'} + } + + def __init__( + self, + *, + scope: Optional[str] = None, + source_sql_connection: Optional["SqlConnectionInformation"] = None, + source_database_name: Optional[str] = None, + migration_service: Optional[str] = None, + migration_operation_id: Optional[str] = None, + target_database_collation: Optional[str] = None, + provisioning_error: Optional[str] = None, + **kwargs + ): + """ + :keyword scope: Resource Id of the target resource (SQL VM or SQL Managed Instance). + :paramtype scope: str + :keyword source_sql_connection: Source SQL Server connection details. + :paramtype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation + :keyword source_database_name: Name of the source database. + :paramtype source_database_name: str + :keyword migration_service: Resource Id of the Migration Service. + :paramtype migration_service: str + :keyword migration_operation_id: ID tracking current migration operation. + :paramtype migration_operation_id: str + :keyword target_database_collation: Database collation to be used for the target database. + :paramtype target_database_collation: str + :keyword provisioning_error: Error message for migration provisioning failure, if any. + :paramtype provisioning_error: str + """ + super(DatabaseMigrationProperties, self).__init__(**kwargs) + self.kind = None # type: Optional[str] + self.scope = scope + self.provisioning_state = None + self.migration_status = None + self.started_on = None + self.ended_on = None + self.source_sql_connection = source_sql_connection + self.source_database_name = source_database_name + self.source_server_name = None + self.migration_service = migration_service + self.migration_operation_id = migration_operation_id + self.migration_failure_error = None + self.target_database_collation = target_database_collation + self.provisioning_error = provisioning_error + + +class DatabaseMigrationPropertiesSqlDb(DatabaseMigrationProperties): + """Database Migration Resource properties for SQL database. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar kind: Required. Constant filled by server. Possible values include: "SqlMi", "SqlVm", + "SqlDb". + :vartype kind: str or ~azure.mgmt.datamigration.models.ResourceType + :ivar scope: Resource Id of the target resource (SQL VM or SQL Managed Instance). + :vartype scope: str + :ivar provisioning_state: Provisioning State of migration. ProvisioningState as Succeeded + implies that validations have been performed and migration has started. + :vartype provisioning_state: str + :ivar migration_status: Migration status. + :vartype migration_status: str + :ivar started_on: Database migration start time. + :vartype started_on: ~datetime.datetime + :ivar ended_on: Database migration end time. + :vartype ended_on: ~datetime.datetime + :ivar source_sql_connection: Source SQL Server connection details. + :vartype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation + :ivar source_database_name: Name of the source database. + :vartype source_database_name: str + :ivar source_server_name: Name of the source sql server. + :vartype source_server_name: str + :ivar migration_service: Resource Id of the Migration Service. + :vartype migration_service: str + :ivar migration_operation_id: ID tracking current migration operation. + :vartype migration_operation_id: str + :ivar migration_failure_error: Error details in case of migration failure. + :vartype migration_failure_error: ~azure.mgmt.datamigration.models.ErrorInfo + :ivar target_database_collation: Database collation to be used for the target database. + :vartype target_database_collation: str + :ivar provisioning_error: Error message for migration provisioning failure, if any. + :vartype provisioning_error: str + :ivar migration_status_details: Detailed migration status. Not included by default. + :vartype migration_status_details: ~azure.mgmt.datamigration.models.SqlDbMigrationStatusDetails + :ivar target_sql_connection: Target SQL DB connection details. + :vartype target_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation + :ivar offline_configuration: Offline configuration. + :vartype offline_configuration: ~azure.mgmt.datamigration.models.SqlDbOfflineConfiguration + :ivar table_list: List of tables to copy. + :vartype table_list: list[str] + """ + + _validation = { + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'migration_status': {'readonly': True}, + 'started_on': {'readonly': True}, + 'ended_on': {'readonly': True}, + 'source_server_name': {'readonly': True}, + 'migration_failure_error': {'readonly': True}, + 'migration_status_details': {'readonly': True}, + 'offline_configuration': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'migration_status': {'key': 'migrationStatus', 'type': 'str'}, + 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, + 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, + 'source_sql_connection': {'key': 'sourceSqlConnection', 'type': 'SqlConnectionInformation'}, + 'source_database_name': {'key': 'sourceDatabaseName', 'type': 'str'}, + 'source_server_name': {'key': 'sourceServerName', 'type': 'str'}, + 'migration_service': {'key': 'migrationService', 'type': 'str'}, + 'migration_operation_id': {'key': 'migrationOperationId', 'type': 'str'}, + 'migration_failure_error': {'key': 'migrationFailureError', 'type': 'ErrorInfo'}, + 'target_database_collation': {'key': 'targetDatabaseCollation', 'type': 'str'}, + 'provisioning_error': {'key': 'provisioningError', 'type': 'str'}, + 'migration_status_details': {'key': 'migrationStatusDetails', 'type': 'SqlDbMigrationStatusDetails'}, + 'target_sql_connection': {'key': 'targetSqlConnection', 'type': 'SqlConnectionInformation'}, + 'offline_configuration': {'key': 'offlineConfiguration', 'type': 'SqlDbOfflineConfiguration'}, + 'table_list': {'key': 'tableList', 'type': '[str]'}, + } + + def __init__( + self, + *, + scope: Optional[str] = None, + source_sql_connection: Optional["SqlConnectionInformation"] = None, + source_database_name: Optional[str] = None, + migration_service: Optional[str] = None, + migration_operation_id: Optional[str] = None, + target_database_collation: Optional[str] = None, + provisioning_error: Optional[str] = None, + target_sql_connection: Optional["SqlConnectionInformation"] = None, + table_list: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword scope: Resource Id of the target resource (SQL VM or SQL Managed Instance). + :paramtype scope: str + :keyword source_sql_connection: Source SQL Server connection details. + :paramtype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation + :keyword source_database_name: Name of the source database. + :paramtype source_database_name: str + :keyword migration_service: Resource Id of the Migration Service. + :paramtype migration_service: str + :keyword migration_operation_id: ID tracking current migration operation. + :paramtype migration_operation_id: str + :keyword target_database_collation: Database collation to be used for the target database. + :paramtype target_database_collation: str + :keyword provisioning_error: Error message for migration provisioning failure, if any. + :paramtype provisioning_error: str + :keyword target_sql_connection: Target SQL DB connection details. + :paramtype target_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation + :keyword table_list: List of tables to copy. + :paramtype table_list: list[str] + """ + super(DatabaseMigrationPropertiesSqlDb, self).__init__(scope=scope, source_sql_connection=source_sql_connection, source_database_name=source_database_name, migration_service=migration_service, migration_operation_id=migration_operation_id, target_database_collation=target_database_collation, provisioning_error=provisioning_error, **kwargs) + self.kind = 'SqlDb' # type: str + self.migration_status_details = None + self.target_sql_connection = target_sql_connection + self.offline_configuration = None + self.table_list = table_list + + +class DatabaseMigrationPropertiesSqlMi(DatabaseMigrationProperties): + """Database Migration Resource properties for SQL Managed Instance. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar kind: Required. Constant filled by server. Possible values include: "SqlMi", "SqlVm", + "SqlDb". + :vartype kind: str or ~azure.mgmt.datamigration.models.ResourceType + :ivar scope: Resource Id of the target resource (SQL VM or SQL Managed Instance). + :vartype scope: str + :ivar provisioning_state: Provisioning State of migration. ProvisioningState as Succeeded + implies that validations have been performed and migration has started. + :vartype provisioning_state: str + :ivar migration_status: Migration status. + :vartype migration_status: str + :ivar started_on: Database migration start time. + :vartype started_on: ~datetime.datetime + :ivar ended_on: Database migration end time. + :vartype ended_on: ~datetime.datetime + :ivar source_sql_connection: Source SQL Server connection details. + :vartype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation + :ivar source_database_name: Name of the source database. + :vartype source_database_name: str + :ivar source_server_name: Name of the source sql server. + :vartype source_server_name: str + :ivar migration_service: Resource Id of the Migration Service. + :vartype migration_service: str + :ivar migration_operation_id: ID tracking current migration operation. + :vartype migration_operation_id: str + :ivar migration_failure_error: Error details in case of migration failure. + :vartype migration_failure_error: ~azure.mgmt.datamigration.models.ErrorInfo + :ivar target_database_collation: Database collation to be used for the target database. + :vartype target_database_collation: str + :ivar provisioning_error: Error message for migration provisioning failure, if any. + :vartype provisioning_error: str + :ivar migration_status_details: Detailed migration status. Not included by default. + :vartype migration_status_details: ~azure.mgmt.datamigration.models.MigrationStatusDetails + :ivar backup_configuration: Backup configuration info. + :vartype backup_configuration: ~azure.mgmt.datamigration.models.BackupConfiguration + :ivar offline_configuration: Offline configuration. + :vartype offline_configuration: ~azure.mgmt.datamigration.models.OfflineConfiguration + """ + + _validation = { + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'migration_status': {'readonly': True}, + 'started_on': {'readonly': True}, + 'ended_on': {'readonly': True}, + 'source_server_name': {'readonly': True}, + 'migration_failure_error': {'readonly': True}, + 'migration_status_details': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'migration_status': {'key': 'migrationStatus', 'type': 'str'}, + 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, + 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, + 'source_sql_connection': {'key': 'sourceSqlConnection', 'type': 'SqlConnectionInformation'}, + 'source_database_name': {'key': 'sourceDatabaseName', 'type': 'str'}, + 'source_server_name': {'key': 'sourceServerName', 'type': 'str'}, + 'migration_service': {'key': 'migrationService', 'type': 'str'}, + 'migration_operation_id': {'key': 'migrationOperationId', 'type': 'str'}, + 'migration_failure_error': {'key': 'migrationFailureError', 'type': 'ErrorInfo'}, + 'target_database_collation': {'key': 'targetDatabaseCollation', 'type': 'str'}, + 'provisioning_error': {'key': 'provisioningError', 'type': 'str'}, + 'migration_status_details': {'key': 'migrationStatusDetails', 'type': 'MigrationStatusDetails'}, + 'backup_configuration': {'key': 'backupConfiguration', 'type': 'BackupConfiguration'}, + 'offline_configuration': {'key': 'offlineConfiguration', 'type': 'OfflineConfiguration'}, + } + + def __init__( + self, + *, + scope: Optional[str] = None, + source_sql_connection: Optional["SqlConnectionInformation"] = None, + source_database_name: Optional[str] = None, + migration_service: Optional[str] = None, + migration_operation_id: Optional[str] = None, + target_database_collation: Optional[str] = None, + provisioning_error: Optional[str] = None, + backup_configuration: Optional["BackupConfiguration"] = None, + offline_configuration: Optional["OfflineConfiguration"] = None, + **kwargs + ): + """ + :keyword scope: Resource Id of the target resource (SQL VM or SQL Managed Instance). + :paramtype scope: str + :keyword source_sql_connection: Source SQL Server connection details. + :paramtype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation + :keyword source_database_name: Name of the source database. + :paramtype source_database_name: str + :keyword migration_service: Resource Id of the Migration Service. + :paramtype migration_service: str + :keyword migration_operation_id: ID tracking current migration operation. + :paramtype migration_operation_id: str + :keyword target_database_collation: Database collation to be used for the target database. + :paramtype target_database_collation: str + :keyword provisioning_error: Error message for migration provisioning failure, if any. + :paramtype provisioning_error: str + :keyword backup_configuration: Backup configuration info. + :paramtype backup_configuration: ~azure.mgmt.datamigration.models.BackupConfiguration + :keyword offline_configuration: Offline configuration. + :paramtype offline_configuration: ~azure.mgmt.datamigration.models.OfflineConfiguration + """ + super(DatabaseMigrationPropertiesSqlMi, self).__init__(scope=scope, source_sql_connection=source_sql_connection, source_database_name=source_database_name, migration_service=migration_service, migration_operation_id=migration_operation_id, target_database_collation=target_database_collation, provisioning_error=provisioning_error, **kwargs) + self.kind = 'SqlMi' # type: str + self.migration_status_details = None + self.backup_configuration = backup_configuration + self.offline_configuration = offline_configuration + + +class DatabaseMigrationPropertiesSqlVm(DatabaseMigrationProperties): + """Database Migration Resource properties for SQL Virtual Machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar kind: Required. Constant filled by server. Possible values include: "SqlMi", "SqlVm", + "SqlDb". + :vartype kind: str or ~azure.mgmt.datamigration.models.ResourceType + :ivar scope: Resource Id of the target resource (SQL VM or SQL Managed Instance). + :vartype scope: str + :ivar provisioning_state: Provisioning State of migration. ProvisioningState as Succeeded + implies that validations have been performed and migration has started. + :vartype provisioning_state: str + :ivar migration_status: Migration status. + :vartype migration_status: str + :ivar started_on: Database migration start time. + :vartype started_on: ~datetime.datetime + :ivar ended_on: Database migration end time. + :vartype ended_on: ~datetime.datetime + :ivar source_sql_connection: Source SQL Server connection details. + :vartype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation + :ivar source_database_name: Name of the source database. + :vartype source_database_name: str + :ivar source_server_name: Name of the source sql server. + :vartype source_server_name: str + :ivar migration_service: Resource Id of the Migration Service. + :vartype migration_service: str + :ivar migration_operation_id: ID tracking current migration operation. + :vartype migration_operation_id: str + :ivar migration_failure_error: Error details in case of migration failure. + :vartype migration_failure_error: ~azure.mgmt.datamigration.models.ErrorInfo + :ivar target_database_collation: Database collation to be used for the target database. + :vartype target_database_collation: str + :ivar provisioning_error: Error message for migration provisioning failure, if any. + :vartype provisioning_error: str + :ivar migration_status_details: Detailed migration status. Not included by default. + :vartype migration_status_details: ~azure.mgmt.datamigration.models.MigrationStatusDetails + :ivar backup_configuration: Backup configuration info. + :vartype backup_configuration: ~azure.mgmt.datamigration.models.BackupConfiguration + :ivar offline_configuration: Offline configuration. + :vartype offline_configuration: ~azure.mgmt.datamigration.models.OfflineConfiguration + """ + + _validation = { + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'migration_status': {'readonly': True}, + 'started_on': {'readonly': True}, + 'ended_on': {'readonly': True}, + 'source_server_name': {'readonly': True}, + 'migration_failure_error': {'readonly': True}, + 'migration_status_details': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'migration_status': {'key': 'migrationStatus', 'type': 'str'}, + 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, + 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, + 'source_sql_connection': {'key': 'sourceSqlConnection', 'type': 'SqlConnectionInformation'}, + 'source_database_name': {'key': 'sourceDatabaseName', 'type': 'str'}, + 'source_server_name': {'key': 'sourceServerName', 'type': 'str'}, + 'migration_service': {'key': 'migrationService', 'type': 'str'}, + 'migration_operation_id': {'key': 'migrationOperationId', 'type': 'str'}, + 'migration_failure_error': {'key': 'migrationFailureError', 'type': 'ErrorInfo'}, + 'target_database_collation': {'key': 'targetDatabaseCollation', 'type': 'str'}, + 'provisioning_error': {'key': 'provisioningError', 'type': 'str'}, + 'migration_status_details': {'key': 'migrationStatusDetails', 'type': 'MigrationStatusDetails'}, + 'backup_configuration': {'key': 'backupConfiguration', 'type': 'BackupConfiguration'}, + 'offline_configuration': {'key': 'offlineConfiguration', 'type': 'OfflineConfiguration'}, + } + + def __init__( + self, + *, + scope: Optional[str] = None, + source_sql_connection: Optional["SqlConnectionInformation"] = None, + source_database_name: Optional[str] = None, + migration_service: Optional[str] = None, + migration_operation_id: Optional[str] = None, + target_database_collation: Optional[str] = None, + provisioning_error: Optional[str] = None, + backup_configuration: Optional["BackupConfiguration"] = None, + offline_configuration: Optional["OfflineConfiguration"] = None, + **kwargs + ): + """ + :keyword scope: Resource Id of the target resource (SQL VM or SQL Managed Instance). + :paramtype scope: str + :keyword source_sql_connection: Source SQL Server connection details. + :paramtype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation + :keyword source_database_name: Name of the source database. + :paramtype source_database_name: str + :keyword migration_service: Resource Id of the Migration Service. + :paramtype migration_service: str + :keyword migration_operation_id: ID tracking current migration operation. + :paramtype migration_operation_id: str + :keyword target_database_collation: Database collation to be used for the target database. + :paramtype target_database_collation: str + :keyword provisioning_error: Error message for migration provisioning failure, if any. + :paramtype provisioning_error: str + :keyword backup_configuration: Backup configuration info. + :paramtype backup_configuration: ~azure.mgmt.datamigration.models.BackupConfiguration + :keyword offline_configuration: Offline configuration. + :paramtype offline_configuration: ~azure.mgmt.datamigration.models.OfflineConfiguration + """ + super(DatabaseMigrationPropertiesSqlVm, self).__init__(scope=scope, source_sql_connection=source_sql_connection, source_database_name=source_database_name, migration_service=migration_service, migration_operation_id=migration_operation_id, target_database_collation=target_database_collation, provisioning_error=provisioning_error, **kwargs) + self.kind = 'SqlVm' # type: str + self.migration_status_details = None + self.backup_configuration = backup_configuration + self.offline_configuration = offline_configuration + + +class DatabaseMigrationSqlDb(ProxyResource): + """Database Migration Resource for SQL Database. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + :ivar name: + :vartype name: str + :ivar type: + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.datamigration.models.SystemData + :ivar properties: Database Migration Resource properties for SQL database. + :vartype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationPropertiesSqlDb + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'DatabaseMigrationPropertiesSqlDb'}, + } + + def __init__( + self, + *, + properties: Optional["DatabaseMigrationPropertiesSqlDb"] = None, + **kwargs + ): + """ + :keyword properties: Database Migration Resource properties for SQL database. + :paramtype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationPropertiesSqlDb + """ + super(DatabaseMigrationSqlDb, self).__init__(**kwargs) + self.system_data = None + self.properties = properties + + +class DatabaseMigrationSqlMi(ProxyResource): + """Database Migration Resource for SQL Managed Instance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + :ivar name: + :vartype name: str + :ivar type: + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.datamigration.models.SystemData + :ivar properties: Database Migration Resource properties for SQL Managed Instance. + :vartype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationPropertiesSqlMi + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'DatabaseMigrationPropertiesSqlMi'}, + } + + def __init__( + self, + *, + properties: Optional["DatabaseMigrationPropertiesSqlMi"] = None, + **kwargs + ): + """ + :keyword properties: Database Migration Resource properties for SQL Managed Instance. + :paramtype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationPropertiesSqlMi + """ + super(DatabaseMigrationSqlMi, self).__init__(**kwargs) + self.system_data = None + self.properties = properties + + +class DatabaseMigrationSqlVm(ProxyResource): + """Database Migration Resource for SQL Virtual Machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + :ivar name: + :vartype name: str + :ivar type: + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.datamigration.models.SystemData + :ivar properties: Database Migration Resource properties for SQL Virtual Machine. + :vartype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationPropertiesSqlVm + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'DatabaseMigrationPropertiesSqlVm'}, + } + + def __init__( + self, + *, + properties: Optional["DatabaseMigrationPropertiesSqlVm"] = None, + **kwargs + ): + """ + :keyword properties: Database Migration Resource properties for SQL Virtual Machine. + :paramtype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationPropertiesSqlVm + """ + super(DatabaseMigrationSqlVm, self).__init__(**kwargs) + self.system_data = None + self.properties = properties + + +class DatabaseObjectName(msrest.serialization.Model): + """A representation of the name of an object in a database. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar database_name: The unescaped name of the database containing the object. + :vartype database_name: str + :ivar object_name: The unescaped name of the object. + :vartype object_name: str + :ivar schema_name: The unescaped name of the schema containing the object. + :vartype schema_name: str + :ivar object_type: Type of the object in the database. Possible values include: + "StoredProcedures", "Table", "User", "View", "Function". + :vartype object_type: str or ~azure.mgmt.datamigration.models.ObjectType + """ + + _validation = { + 'database_name': {'readonly': True}, + 'object_name': {'readonly': True}, + 'schema_name': {'readonly': True}, + } + + _attribute_map = { + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'object_name': {'key': 'objectName', 'type': 'str'}, + 'schema_name': {'key': 'schemaName', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__( + self, + *, + object_type: Optional[Union[str, "ObjectType"]] = None, + **kwargs + ): + """ + :keyword object_type: Type of the object in the database. Possible values include: + "StoredProcedures", "Table", "User", "View", "Function". + :paramtype object_type: str or ~azure.mgmt.datamigration.models.ObjectType + """ + super(DatabaseObjectName, self).__init__(**kwargs) + self.database_name = None + self.object_name = None + self.schema_name = None + self.object_type = object_type + + +class DataItemMigrationSummaryResult(msrest.serialization.Model): + """Basic summary of a data item migration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the item. + :vartype name: str + :ivar started_on: Migration start time. + :vartype started_on: ~datetime.datetime + :ivar ended_on: Migration end time. + :vartype ended_on: ~datetime.datetime + :ivar state: Current state of migration. Possible values include: "None", "InProgress", + "Failed", "Warning", "Completed", "Skipped", "Stopped". + :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState + :ivar status_message: Status message. + :vartype status_message: str + :ivar items_count: Number of items. + :vartype items_count: long + :ivar items_completed_count: Number of successfully completed items. + :vartype items_completed_count: long + :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item. + :vartype error_prefix: str + :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the + item. + :vartype result_prefix: str + """ + + _validation = { + 'name': {'readonly': True}, + 'started_on': {'readonly': True}, + 'ended_on': {'readonly': True}, + 'state': {'readonly': True}, + 'status_message': {'readonly': True}, + 'items_count': {'readonly': True}, + 'items_completed_count': {'readonly': True}, + 'error_prefix': {'readonly': True}, + 'result_prefix': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, + 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + 'items_count': {'key': 'itemsCount', 'type': 'long'}, + 'items_completed_count': {'key': 'itemsCompletedCount', 'type': 'long'}, + 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, + 'result_prefix': {'key': 'resultPrefix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataItemMigrationSummaryResult, self).__init__(**kwargs) + self.name = None + self.started_on = None + self.ended_on = None + self.state = None + self.status_message = None + self.items_count = None + self.items_completed_count = None + self.error_prefix = None + self.result_prefix = None + + +class DatabaseSummaryResult(DataItemMigrationSummaryResult): + """Summary of database results in the migration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the item. + :vartype name: str + :ivar started_on: Migration start time. + :vartype started_on: ~datetime.datetime + :ivar ended_on: Migration end time. + :vartype ended_on: ~datetime.datetime + :ivar state: Current state of migration. Possible values include: "None", "InProgress", + "Failed", "Warning", "Completed", "Skipped", "Stopped". + :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState + :ivar status_message: Status message. + :vartype status_message: str + :ivar items_count: Number of items. + :vartype items_count: long + :ivar items_completed_count: Number of successfully completed items. + :vartype items_completed_count: long + :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item. + :vartype error_prefix: str + :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the + item. + :vartype result_prefix: str + :ivar size_mb: Size of the database in megabytes. + :vartype size_mb: float + """ + + _validation = { + 'name': {'readonly': True}, + 'started_on': {'readonly': True}, + 'ended_on': {'readonly': True}, + 'state': {'readonly': True}, + 'status_message': {'readonly': True}, + 'items_count': {'readonly': True}, + 'items_completed_count': {'readonly': True}, + 'error_prefix': {'readonly': True}, + 'result_prefix': {'readonly': True}, + 'size_mb': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, + 'ended_on': {'key': 'endedOn', 'type': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + 'items_count': {'key': 'itemsCount', 'type': 'long'}, + 'items_completed_count': {'key': 'itemsCompletedCount', 'type': 'long'}, + 'error_prefix': {'key': 'errorPrefix', 'type': 'str'}, + 'result_prefix': {'key': 'resultPrefix', 'type': 'str'}, + 'size_mb': {'key': 'sizeMB', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DatabaseSummaryResult, self).__init__(**kwargs) + self.size_mb = None + + +class DatabaseTable(msrest.serialization.Model): + """Table properties. + + Variables are only populated by the server, and will be ignored when sending a request. :ivar has_rows: Indicates whether table is empty or not. :vartype has_rows: bool @@ -2901,6 +4495,8 @@ def __init__( self, **kwargs ): + """ + """ super(DatabaseTable, self).__init__(**kwargs) self.has_rows = None self.name = None @@ -2909,11 +4505,11 @@ def __init__( class DataIntegrityValidationResult(msrest.serialization.Model): """Results for checksum based Data Integrity validation results. - :param failed_objects: List of failed table names of source and target pair. - :type failed_objects: dict[str, str] - :param validation_errors: List of errors that happened while performing data integrity + :ivar failed_objects: List of failed table names of source and target pair. + :vartype failed_objects: dict[str, str] + :ivar validation_errors: List of errors that happened while performing data integrity validation. - :type validation_errors: ~azure.mgmt.datamigration.models.ValidationError + :vartype validation_errors: ~azure.mgmt.datamigration.models.ValidationError """ _attribute_map = { @@ -2928,6 +4524,13 @@ def __init__( validation_errors: Optional["ValidationError"] = None, **kwargs ): + """ + :keyword failed_objects: List of failed table names of source and target pair. + :paramtype failed_objects: dict[str, str] + :keyword validation_errors: List of errors that happened while performing data integrity + validation. + :paramtype validation_errors: ~azure.mgmt.datamigration.models.ValidationError + """ super(DataIntegrityValidationResult, self).__init__(**kwargs) self.failed_objects = failed_objects self.validation_errors = validation_errors @@ -2940,8 +4543,8 @@ class DataMigrationError(msrest.serialization.Model): :ivar message: Error description. :vartype message: str - :param type: Error type. Possible values include: "Default", "Warning", "Error". - :type type: str or ~azure.mgmt.datamigration.models.ErrorType + :ivar type: Error type. Possible values include: "Default", "Warning", "Error". + :vartype type: str or ~azure.mgmt.datamigration.models.ErrorType """ _validation = { @@ -2959,6 +4562,10 @@ def __init__( type: Optional[Union[str, "ErrorType"]] = None, **kwargs ): + """ + :keyword type: Error type. Possible values include: "Default", "Warning", "Error". + :paramtype type: str or ~azure.mgmt.datamigration.models.ErrorType + """ super(DataMigrationError, self).__init__(**kwargs) self.message = None self.type = type @@ -2989,95 +4596,60 @@ class DataMigrationProjectMetadata(msrest.serialization.Model): """ _validation = { - 'source_server_name': {'readonly': True}, - 'source_server_port': {'readonly': True}, - 'source_username': {'readonly': True}, - 'target_server_name': {'readonly': True}, - 'target_username': {'readonly': True}, - 'target_db_name': {'readonly': True}, - 'target_using_win_auth': {'readonly': True}, - 'selected_migration_tables': {'readonly': True}, - } - - _attribute_map = { - 'source_server_name': {'key': 'sourceServerName', 'type': 'str'}, - 'source_server_port': {'key': 'sourceServerPort', 'type': 'str'}, - 'source_username': {'key': 'sourceUsername', 'type': 'str'}, - 'target_server_name': {'key': 'targetServerName', 'type': 'str'}, - 'target_username': {'key': 'targetUsername', 'type': 'str'}, - 'target_db_name': {'key': 'targetDbName', 'type': 'str'}, - 'target_using_win_auth': {'key': 'targetUsingWinAuth', 'type': 'bool'}, - 'selected_migration_tables': {'key': 'selectedMigrationTables', 'type': '[MigrationTableMetadata]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataMigrationProjectMetadata, self).__init__(**kwargs) - self.source_server_name = None - self.source_server_port = None - self.source_username = None - self.target_server_name = None - self.target_username = None - self.target_db_name = None - self.target_using_win_auth = None - self.selected_migration_tables = None - - -class Resource(msrest.serialization.Model): - """ARM resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + 'source_server_name': {'readonly': True}, + 'source_server_port': {'readonly': True}, + 'source_username': {'readonly': True}, + 'target_server_name': {'readonly': True}, + 'target_username': {'readonly': True}, + 'target_db_name': {'readonly': True}, + 'target_using_win_auth': {'readonly': True}, + 'selected_migration_tables': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'source_server_name': {'key': 'sourceServerName', 'type': 'str'}, + 'source_server_port': {'key': 'sourceServerPort', 'type': 'str'}, + 'source_username': {'key': 'sourceUsername', 'type': 'str'}, + 'target_server_name': {'key': 'targetServerName', 'type': 'str'}, + 'target_username': {'key': 'targetUsername', 'type': 'str'}, + 'target_db_name': {'key': 'targetDbName', 'type': 'str'}, + 'target_using_win_auth': {'key': 'targetUsingWinAuth', 'type': 'bool'}, + 'selected_migration_tables': {'key': 'selectedMigrationTables', 'type': '[MigrationTableMetadata]'}, } def __init__( self, **kwargs ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + """ + """ + super(DataMigrationProjectMetadata, self).__init__(**kwargs) + self.source_server_name = None + self.source_server_port = None + self.source_username = None + self.target_server_name = None + self.target_username = None + self.target_db_name = None + self.target_using_win_auth = None + self.selected_migration_tables = None -class TrackedResource(Resource): - """ARM tracked top level resource. +class TrackedResource(msrest.serialization.Model): + """TrackedResource. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. + :ivar location: + :vartype location: str + :ivar tags: A set of tags. Dictionary of :code:``. + :vartype tags: dict[str, str] + :ivar id: :vartype id: str - :ivar name: Resource name. + :ivar name: :vartype name: str - :ivar type: Resource type. + :ivar type: :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :ivar system_data: :vartype system_data: ~azure.mgmt.datamigration.models.SystemData """ @@ -3085,29 +4657,37 @@ class TrackedResource(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, 'system_data': {'readonly': True}, } _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( self, *, - location: str, + location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: + :paramtype location: str + :keyword tags: A set of tags. Dictionary of :code:``. + :paramtype tags: dict[str, str] + """ super(TrackedResource, self).__init__(**kwargs) - self.tags = tags self.location = location + self.tags = tags + self.id = None + self.name = None + self.type = None self.system_data = None @@ -3116,55 +4696,57 @@ class DataMigrationService(TrackedResource): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. + :ivar location: + :vartype location: str + :ivar tags: A set of tags. Dictionary of :code:``. + :vartype tags: dict[str, str] + :ivar id: :vartype id: str - :ivar name: Resource name. + :ivar name: :vartype name: str - :ivar type: Resource type. + :ivar type: :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :ivar system_data: :vartype system_data: ~azure.mgmt.datamigration.models.SystemData - :param etag: HTTP strong entity tag value. Ignored if submitted. - :type etag: str - :param kind: The resource kind. Only 'vm' (the default) is supported. - :type kind: str - :param sku: Service SKU. - :type sku: ~azure.mgmt.datamigration.models.ServiceSku + :ivar etag: HTTP strong entity tag value. Ignored if submitted. + :vartype etag: str + :ivar kind: The resource kind. Only 'vm' (the default) is supported. + :vartype kind: str + :ivar sku: Service SKU. + :vartype sku: ~azure.mgmt.datamigration.models.ServiceSku :ivar provisioning_state: The resource's provisioning state. Possible values include: "Accepted", "Deleting", "Deploying", "Stopped", "Stopping", "Starting", "FailedToStart", "FailedToStop", "Succeeded", "Failed". :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ServiceProvisioningState - :param public_key: The public key of the service, used to encrypt secrets sent to the service. - :type public_key: str - :param virtual_subnet_id: The ID of the Microsoft.Network/virtualNetworks/subnets resource to + :ivar public_key: The public key of the service, used to encrypt secrets sent to the service. + :vartype public_key: str + :ivar virtual_subnet_id: The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined. - :type virtual_subnet_id: str - :param virtual_nic_id: The ID of the Microsoft.Network/networkInterfaces resource which the + :vartype virtual_subnet_id: str + :ivar virtual_nic_id: The ID of the Microsoft.Network/networkInterfaces resource which the service have. - :type virtual_nic_id: str + :vartype virtual_nic_id: str + :ivar auto_stop_delay: The time delay before the service is auto-stopped when idle. + :vartype auto_stop_delay: str + :ivar delete_resources_on_stop: Whether service resources should be deleted when stopped. + (Turned on by default). + :vartype delete_resources_on_stop: bool """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, } _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, @@ -3173,12 +4755,14 @@ class DataMigrationService(TrackedResource): 'public_key': {'key': 'properties.publicKey', 'type': 'str'}, 'virtual_subnet_id': {'key': 'properties.virtualSubnetId', 'type': 'str'}, 'virtual_nic_id': {'key': 'properties.virtualNicId', 'type': 'str'}, + 'auto_stop_delay': {'key': 'properties.autoStopDelay', 'type': 'str'}, + 'delete_resources_on_stop': {'key': 'properties.deleteResourcesOnStop', 'type': 'bool'}, } def __init__( self, *, - location: str, + location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, etag: Optional[str] = None, kind: Optional[str] = None, @@ -3186,9 +4770,37 @@ def __init__( public_key: Optional[str] = None, virtual_subnet_id: Optional[str] = None, virtual_nic_id: Optional[str] = None, - **kwargs - ): - super(DataMigrationService, self).__init__(tags=tags, location=location, **kwargs) + auto_stop_delay: Optional[str] = None, + delete_resources_on_stop: Optional[bool] = None, + **kwargs + ): + """ + :keyword location: + :paramtype location: str + :keyword tags: A set of tags. Dictionary of :code:``. + :paramtype tags: dict[str, str] + :keyword etag: HTTP strong entity tag value. Ignored if submitted. + :paramtype etag: str + :keyword kind: The resource kind. Only 'vm' (the default) is supported. + :paramtype kind: str + :keyword sku: Service SKU. + :paramtype sku: ~azure.mgmt.datamigration.models.ServiceSku + :keyword public_key: The public key of the service, used to encrypt secrets sent to the + service. + :paramtype public_key: str + :keyword virtual_subnet_id: The ID of the Microsoft.Network/virtualNetworks/subnets resource to + which the service should be joined. + :paramtype virtual_subnet_id: str + :keyword virtual_nic_id: The ID of the Microsoft.Network/networkInterfaces resource which the + service have. + :paramtype virtual_nic_id: str + :keyword auto_stop_delay: The time delay before the service is auto-stopped when idle. + :paramtype auto_stop_delay: str + :keyword delete_resources_on_stop: Whether service resources should be deleted when stopped. + (Turned on by default). + :paramtype delete_resources_on_stop: bool + """ + super(DataMigrationService, self).__init__(location=location, tags=tags, **kwargs) self.etag = etag self.kind = kind self.sku = sku @@ -3196,15 +4808,17 @@ def __init__( self.public_key = public_key self.virtual_subnet_id = virtual_subnet_id self.virtual_nic_id = virtual_nic_id + self.auto_stop_delay = auto_stop_delay + self.delete_resources_on_stop = delete_resources_on_stop class DataMigrationServiceList(msrest.serialization.Model): """OData page of service objects. - :param value: List of services. - :type value: list[~azure.mgmt.datamigration.models.DataMigrationService] - :param next_link: URL to load the next page of services. - :type next_link: str + :ivar value: List of services. + :vartype value: list[~azure.mgmt.datamigration.models.DataMigrationService] + :ivar next_link: URL to load the next page of services. + :vartype next_link: str """ _attribute_map = { @@ -3219,6 +4833,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of services. + :paramtype value: list[~azure.mgmt.datamigration.models.DataMigrationService] + :keyword next_link: URL to load the next page of services. + :paramtype next_link: str + """ super(DataMigrationServiceList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -3227,20 +4847,23 @@ def __init__( class DataMigrationServiceStatusResponse(msrest.serialization.Model): """Service health status. - :param agent_version: The DMS instance agent version. - :type agent_version: str - :param status: The machine-readable status, such as 'Initializing', 'Offline', 'Online', + :ivar agent_version: The DMS instance agent version. + :vartype agent_version: str + :ivar agent_configuration: Agent Configuration. + :vartype agent_configuration: any + :ivar status: The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. - :type status: str - :param vm_size: The services virtual machine size, such as 'Standard_D2_v2'. - :type vm_size: str - :param supported_task_types: The list of supported task types. - :type supported_task_types: list[str] + :vartype status: str + :ivar vm_size: The services virtual machine size, such as 'Standard_D2_v2'. + :vartype vm_size: str + :ivar supported_task_types: The list of supported task types. + :vartype supported_task_types: list[str] """ _attribute_map = { 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'object'}, 'status': {'key': 'status', 'type': 'str'}, 'vm_size': {'key': 'vmSize', 'type': 'str'}, 'supported_task_types': {'key': 'supportedTaskTypes', 'type': '[str]'}, @@ -3250,33 +4873,113 @@ def __init__( self, *, agent_version: Optional[str] = None, + agent_configuration: Optional[Any] = None, status: Optional[str] = None, vm_size: Optional[str] = None, supported_task_types: Optional[List[str]] = None, **kwargs ): + """ + :keyword agent_version: The DMS instance agent version. + :paramtype agent_version: str + :keyword agent_configuration: Agent Configuration. + :paramtype agent_configuration: any + :keyword status: The machine-readable status, such as 'Initializing', 'Offline', 'Online', + 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or + 'Failed'. + :paramtype status: str + :keyword vm_size: The services virtual machine size, such as 'Standard_D2_v2'. + :paramtype vm_size: str + :keyword supported_task_types: The list of supported task types. + :paramtype supported_task_types: list[str] + """ super(DataMigrationServiceStatusResponse, self).__init__(**kwargs) self.agent_version = agent_version + self.agent_configuration = agent_configuration self.status = status self.vm_size = vm_size self.supported_task_types = supported_task_types +class DeleteNode(msrest.serialization.Model): + """Details of node to be deleted. + + :ivar node_name: The name of node to delete. + :vartype node_name: str + :ivar integration_runtime_name: The name of integration runtime. + :vartype integration_runtime_name: str + """ + + _attribute_map = { + 'node_name': {'key': 'nodeName', 'type': 'str'}, + 'integration_runtime_name': {'key': 'integrationRuntimeName', 'type': 'str'}, + } + + def __init__( + self, + *, + node_name: Optional[str] = None, + integration_runtime_name: Optional[str] = None, + **kwargs + ): + """ + :keyword node_name: The name of node to delete. + :paramtype node_name: str + :keyword integration_runtime_name: The name of integration runtime. + :paramtype integration_runtime_name: str + """ + super(DeleteNode, self).__init__(**kwargs) + self.node_name = node_name + self.integration_runtime_name = integration_runtime_name + + +class ErrorInfo(msrest.serialization.Model): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ErrorInfo, self).__init__(**kwargs) + self.code = None + self.message = None + + class ExecutionStatistics(msrest.serialization.Model): """Description about the errors happen while performing migration validation. - :param execution_count: No. of query executions. - :type execution_count: long - :param cpu_time_ms: CPU Time in millisecond(s) for the query execution. - :type cpu_time_ms: float - :param elapsed_time_ms: Time taken in millisecond(s) for executing the query. - :type elapsed_time_ms: float - :param wait_stats: Dictionary of sql query execution wait types and the respective statistics. - :type wait_stats: dict[str, ~azure.mgmt.datamigration.models.WaitStatistics] - :param has_errors: Indicates whether the query resulted in an error. - :type has_errors: bool - :param sql_errors: List of sql Errors. - :type sql_errors: list[str] + :ivar execution_count: No. of query executions. + :vartype execution_count: long + :ivar cpu_time_ms: CPU Time in millisecond(s) for the query execution. + :vartype cpu_time_ms: float + :ivar elapsed_time_ms: Time taken in millisecond(s) for executing the query. + :vartype elapsed_time_ms: float + :ivar wait_stats: Dictionary of sql query execution wait types and the respective statistics. + :vartype wait_stats: dict[str, ~azure.mgmt.datamigration.models.WaitStatistics] + :ivar has_errors: Indicates whether the query resulted in an error. + :vartype has_errors: bool + :ivar sql_errors: List of sql Errors. + :vartype sql_errors: list[str] """ _attribute_map = { @@ -3299,6 +5002,21 @@ def __init__( sql_errors: Optional[List[str]] = None, **kwargs ): + """ + :keyword execution_count: No. of query executions. + :paramtype execution_count: long + :keyword cpu_time_ms: CPU Time in millisecond(s) for the query execution. + :paramtype cpu_time_ms: float + :keyword elapsed_time_ms: Time taken in millisecond(s) for executing the query. + :paramtype elapsed_time_ms: float + :keyword wait_stats: Dictionary of sql query execution wait types and the respective + statistics. + :paramtype wait_stats: dict[str, ~azure.mgmt.datamigration.models.WaitStatistics] + :keyword has_errors: Indicates whether the query resulted in an error. + :paramtype has_errors: bool + :keyword sql_errors: List of sql Errors. + :paramtype sql_errors: list[str] + """ super(ExecutionStatistics, self).__init__(**kwargs) self.execution_count = execution_count self.cpu_time_ms = cpu_time_ms @@ -3311,10 +5029,10 @@ def __init__( class FileList(msrest.serialization.Model): """OData page of files. - :param value: List of files. - :type value: list[~azure.mgmt.datamigration.models.ProjectFile] - :param next_link: URL to load the next page of files. - :type next_link: str + :ivar value: List of files. + :vartype value: list[~azure.mgmt.datamigration.models.ProjectFile] + :ivar next_link: URL to load the next page of files. + :vartype next_link: str """ _attribute_map = { @@ -3329,6 +5047,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of files. + :paramtype value: list[~azure.mgmt.datamigration.models.ProjectFile] + :keyword next_link: URL to load the next page of files. + :paramtype next_link: str + """ super(FileList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -3339,12 +5063,12 @@ class FileShare(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param user_name: User name credential to connect to the share location. - :type user_name: str - :param password: Password credential used to connect to the share location. - :type password: str - :param path: Required. The folder path for this share. - :type path: str + :ivar user_name: User name credential to connect to the share location. + :vartype user_name: str + :ivar password: Password credential used to connect to the share location. + :vartype password: str + :ivar path: Required. The folder path for this share. + :vartype path: str """ _validation = { @@ -3365,6 +5089,14 @@ def __init__( password: Optional[str] = None, **kwargs ): + """ + :keyword user_name: User name credential to connect to the share location. + :paramtype user_name: str + :keyword password: Password credential used to connect to the share location. + :paramtype password: str + :keyword path: Required. The folder path for this share. + :paramtype path: str + """ super(FileShare, self).__init__(**kwargs) self.user_name = user_name self.password = password @@ -3374,10 +5106,10 @@ def __init__( class FileStorageInfo(msrest.serialization.Model): """File storage information. - :param uri: A URI that can be used to access the file content. - :type uri: str - :param headers: Dictionary of :code:``. - :type headers: dict[str, str] + :ivar uri: A URI that can be used to access the file content. + :vartype uri: str + :ivar headers: Dictionary of :code:``. + :vartype headers: dict[str, str] """ _attribute_map = { @@ -3392,6 +5124,12 @@ def __init__( headers: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword uri: A URI that can be used to access the file content. + :paramtype uri: str + :keyword headers: Dictionary of :code:``. + :paramtype headers: dict[str, str] + """ super(FileStorageInfo, self).__init__(**kwargs) self.uri = uri self.headers = headers @@ -3402,11 +5140,11 @@ class GetProjectDetailsNonSqlTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param project_name: Required. Name of the migration project. - :type project_name: str - :param project_location: Required. A URL that points to the location to access project + :ivar project_name: Required. Name of the migration project. + :vartype project_name: str + :ivar project_location: Required. A URL that points to the location to access project artifacts. - :type project_location: str + :vartype project_location: str """ _validation = { @@ -3426,6 +5164,13 @@ def __init__( project_location: str, **kwargs ): + """ + :keyword project_name: Required. Name of the migration project. + :paramtype project_name: str + :keyword project_location: Required. A URL that points to the location to access project + artifacts. + :paramtype project_location: str + """ super(GetProjectDetailsNonSqlTaskInput, self).__init__(**kwargs) self.project_name = project_name self.project_location = project_location @@ -3436,14 +5181,14 @@ class GetTdeCertificatesSqlTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param connection_info: Required. Connection information for SQL Server. - :type connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param backup_file_share: Required. Backup file share information for file share to be used for + :ivar connection_info: Required. Connection information for SQL Server. + :vartype connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar backup_file_share: Required. Backup file share information for file share to be used for temporarily storing files. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param selected_certificates: Required. List containing certificate names and corresponding + :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :ivar selected_certificates: Required. List containing certificate names and corresponding password to use for encrypting the exported certificate. - :type selected_certificates: list[~azure.mgmt.datamigration.models.SelectedCertificateInput] + :vartype selected_certificates: list[~azure.mgmt.datamigration.models.SelectedCertificateInput] """ _validation = { @@ -3466,6 +5211,17 @@ def __init__( selected_certificates: List["SelectedCertificateInput"], **kwargs ): + """ + :keyword connection_info: Required. Connection information for SQL Server. + :paramtype connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword backup_file_share: Required. Backup file share information for file share to be used + for temporarily storing files. + :paramtype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :keyword selected_certificates: Required. List containing certificate names and corresponding + password to use for encrypting the exported certificate. + :paramtype selected_certificates: + list[~azure.mgmt.datamigration.models.SelectedCertificateInput] + """ super(GetTdeCertificatesSqlTaskInput, self).__init__(**kwargs) self.connection_info = connection_info self.backup_file_share = backup_file_share @@ -3497,6 +5253,8 @@ def __init__( self, **kwargs ): + """ + """ super(GetTdeCertificatesSqlTaskOutput, self).__init__(**kwargs) self.base64_encoded_certificates = None self.validation_errors = None @@ -3509,8 +5267,25 @@ class GetTdeCertificatesSqlTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -3519,10 +5294,10 @@ class GetTdeCertificatesSqlTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetTdeCertificatesSqlTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.GetTdeCertificatesSqlTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.GetTdeCertificatesSqlTaskOutput] """ @@ -3552,6 +5327,12 @@ def __init__( input: Optional["GetTdeCertificatesSqlTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.GetTdeCertificatesSqlTaskInput + """ super(GetTdeCertificatesSqlTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'GetTDECertificates.Sql' # type: str self.input = input @@ -3563,10 +5344,10 @@ class GetUserTablesMySqlTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param connection_info: Required. Connection information for SQL Server. - :type connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param selected_databases: Required. List of database names to collect tables for. - :type selected_databases: list[str] + :ivar connection_info: Required. Connection information for SQL Server. + :vartype connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :ivar selected_databases: Required. List of database names to collect tables for. + :vartype selected_databases: list[str] """ _validation = { @@ -3586,6 +5367,12 @@ def __init__( selected_databases: List[str], **kwargs ): + """ + :keyword connection_info: Required. Connection information for SQL Server. + :paramtype connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :keyword selected_databases: Required. List of database names to collect tables for. + :paramtype selected_databases: list[str] + """ super(GetUserTablesMySqlTaskInput, self).__init__(**kwargs) self.connection_info = connection_info self.selected_databases = selected_databases @@ -3620,6 +5407,8 @@ def __init__( self, **kwargs ): + """ + """ super(GetUserTablesMySqlTaskOutput, self).__init__(**kwargs) self.id = None self.databases_to_tables = None @@ -3633,8 +5422,25 @@ class GetUserTablesMySqlTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -3643,10 +5449,10 @@ class GetUserTablesMySqlTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetUserTablesMySqlTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.GetUserTablesMySqlTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesMySqlTaskOutput] """ @@ -3676,6 +5482,12 @@ def __init__( input: Optional["GetUserTablesMySqlTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.GetUserTablesMySqlTaskInput + """ super(GetUserTablesMySqlTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'GetUserTablesMySql' # type: str self.input = input @@ -3687,10 +5499,10 @@ class GetUserTablesOracleTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param connection_info: Required. Information for connecting to Oracle source. - :type connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo - :param selected_schemas: Required. List of Oracle schemas for which to collect tables. - :type selected_schemas: list[str] + :ivar connection_info: Required. Information for connecting to Oracle source. + :vartype connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo + :ivar selected_schemas: Required. List of Oracle schemas for which to collect tables. + :vartype selected_schemas: list[str] """ _validation = { @@ -3710,6 +5522,12 @@ def __init__( selected_schemas: List[str], **kwargs ): + """ + :keyword connection_info: Required. Information for connecting to Oracle source. + :paramtype connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo + :keyword selected_schemas: Required. List of Oracle schemas for which to collect tables. + :paramtype selected_schemas: list[str] + """ super(GetUserTablesOracleTaskInput, self).__init__(**kwargs) self.connection_info = connection_info self.selected_schemas = selected_schemas @@ -3744,6 +5562,8 @@ def __init__( self, **kwargs ): + """ + """ super(GetUserTablesOracleTaskOutput, self).__init__(**kwargs) self.schema_name = None self.tables = None @@ -3757,8 +5577,25 @@ class GetUserTablesOracleTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -3767,10 +5604,10 @@ class GetUserTablesOracleTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetUserTablesOracleTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.GetUserTablesOracleTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesOracleTaskOutput] """ @@ -3800,6 +5637,12 @@ def __init__( input: Optional["GetUserTablesOracleTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.GetUserTablesOracleTaskInput + """ super(GetUserTablesOracleTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'GetUserTablesOracle' # type: str self.input = input @@ -3811,10 +5654,10 @@ class GetUserTablesPostgreSqlTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param connection_info: Required. Information for connecting to PostgreSQL source. - :type connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - :param selected_databases: Required. List of PostgreSQL databases for which to collect tables. - :type selected_databases: list[str] + :ivar connection_info: Required. Information for connecting to PostgreSQL source. + :vartype connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :ivar selected_databases: Required. List of PostgreSQL databases for which to collect tables. + :vartype selected_databases: list[str] """ _validation = { @@ -3834,6 +5677,13 @@ def __init__( selected_databases: List[str], **kwargs ): + """ + :keyword connection_info: Required. Information for connecting to PostgreSQL source. + :paramtype connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :keyword selected_databases: Required. List of PostgreSQL databases for which to collect + tables. + :paramtype selected_databases: list[str] + """ super(GetUserTablesPostgreSqlTaskInput, self).__init__(**kwargs) self.connection_info = connection_info self.selected_databases = selected_databases @@ -3868,6 +5718,8 @@ def __init__( self, **kwargs ): + """ + """ super(GetUserTablesPostgreSqlTaskOutput, self).__init__(**kwargs) self.database_name = None self.tables = None @@ -3881,8 +5733,25 @@ class GetUserTablesPostgreSqlTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -3891,10 +5760,10 @@ class GetUserTablesPostgreSqlTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetUserTablesPostgreSqlTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.GetUserTablesPostgreSqlTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesPostgreSqlTaskOutput] """ @@ -3924,6 +5793,12 @@ def __init__( input: Optional["GetUserTablesPostgreSqlTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.GetUserTablesPostgreSqlTaskInput + """ super(GetUserTablesPostgreSqlTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'GetUserTablesPostgreSql' # type: str self.input = input @@ -3935,16 +5810,14 @@ class GetUserTablesSqlSyncTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Connection information for SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Connection information for SQL DB. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_source_databases: Required. List of source database names to collect tables - for. - :type selected_source_databases: list[str] - :param selected_target_databases: Required. List of target database names to collect tables - for. - :type selected_target_databases: list[str] + :ivar source_connection_info: Required. Connection information for SQL Server. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Connection information for SQL DB. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar selected_source_databases: Required. List of source database names to collect tables for. + :vartype selected_source_databases: list[str] + :ivar selected_target_databases: Required. List of target database names to collect tables for. + :vartype selected_target_databases: list[str] """ _validation = { @@ -3970,6 +5843,18 @@ def __init__( selected_target_databases: List[str], **kwargs ): + """ + :keyword source_connection_info: Required. Connection information for SQL Server. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Connection information for SQL DB. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword selected_source_databases: Required. List of source database names to collect tables + for. + :paramtype selected_source_databases: list[str] + :keyword selected_target_databases: Required. List of target database names to collect tables + for. + :paramtype selected_target_databases: list[str] + """ super(GetUserTablesSqlSyncTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.target_connection_info = target_connection_info @@ -4010,6 +5895,8 @@ def __init__( self, **kwargs ): + """ + """ super(GetUserTablesSqlSyncTaskOutput, self).__init__(**kwargs) self.databases_to_source_tables = None self.databases_to_target_tables = None @@ -4024,8 +5911,25 @@ class GetUserTablesSqlSyncTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -4034,10 +5938,10 @@ class GetUserTablesSqlSyncTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetUserTablesSqlSyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.GetUserTablesSqlSyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesSqlSyncTaskOutput] """ @@ -4067,6 +5971,12 @@ def __init__( input: Optional["GetUserTablesSqlSyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.GetUserTablesSqlSyncTaskInput + """ super(GetUserTablesSqlSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'GetUserTables.AzureSqlDb.Sync' # type: str self.input = input @@ -4078,10 +5988,12 @@ class GetUserTablesSqlTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param connection_info: Required. Connection information for SQL Server. - :type connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. List of database names to collect tables for. - :type selected_databases: list[str] + :ivar connection_info: Required. Connection information for SQL Server. + :vartype connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar selected_databases: Required. List of database names to collect tables for. + :vartype selected_databases: list[str] + :ivar encrypted_key_for_secure_fields: encrypted key for secure fields. + :vartype encrypted_key_for_secure_fields: str """ _validation = { @@ -4092,6 +6004,7 @@ class GetUserTablesSqlTaskInput(msrest.serialization.Model): _attribute_map = { 'connection_info': {'key': 'connectionInfo', 'type': 'SqlConnectionInfo'}, 'selected_databases': {'key': 'selectedDatabases', 'type': '[str]'}, + 'encrypted_key_for_secure_fields': {'key': 'encryptedKeyForSecureFields', 'type': 'str'}, } def __init__( @@ -4099,11 +6012,21 @@ def __init__( *, connection_info: "SqlConnectionInfo", selected_databases: List[str], + encrypted_key_for_secure_fields: Optional[str] = None, **kwargs ): + """ + :keyword connection_info: Required. Connection information for SQL Server. + :paramtype connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword selected_databases: Required. List of database names to collect tables for. + :paramtype selected_databases: list[str] + :keyword encrypted_key_for_secure_fields: encrypted key for secure fields. + :paramtype encrypted_key_for_secure_fields: str + """ super(GetUserTablesSqlTaskInput, self).__init__(**kwargs) self.connection_info = connection_info self.selected_databases = selected_databases + self.encrypted_key_for_secure_fields = encrypted_key_for_secure_fields class GetUserTablesSqlTaskOutput(msrest.serialization.Model): @@ -4135,6 +6058,8 @@ def __init__( self, **kwargs ): + """ + """ super(GetUserTablesSqlTaskOutput, self).__init__(**kwargs) self.id = None self.databases_to_tables = None @@ -4148,8 +6073,25 @@ class GetUserTablesSqlTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -4158,12 +6100,14 @@ class GetUserTablesSqlTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.GetUserTablesSqlTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.GetUserTablesSqlTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesSqlTaskOutput] + :ivar task_id: Task id. + :vartype task_id: str """ _validation = { @@ -4182,6 +6126,7 @@ class GetUserTablesSqlTaskProperties(ProjectTaskProperties): 'client_data': {'key': 'clientData', 'type': '{str}'}, 'input': {'key': 'input', 'type': 'GetUserTablesSqlTaskInput'}, 'output': {'key': 'output', 'type': '[GetUserTablesSqlTaskOutput]'}, + 'task_id': {'key': 'taskId', 'type': 'str'}, } def __init__( @@ -4189,19 +6134,29 @@ def __init__( *, client_data: Optional[Dict[str, str]] = None, input: Optional["GetUserTablesSqlTaskInput"] = None, + task_id: Optional[str] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.GetUserTablesSqlTaskInput + :keyword task_id: Task id. + :paramtype task_id: str + """ super(GetUserTablesSqlTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'GetUserTables.Sql' # type: str self.input = input self.output = None + self.task_id = task_id class InstallOCIDriverTaskInput(msrest.serialization.Model): """Input for the service task to install an OCI driver. - :param driver_package_name: Name of the uploaded driver package to install. - :type driver_package_name: str + :ivar driver_package_name: Name of the uploaded driver package to install. + :vartype driver_package_name: str """ _attribute_map = { @@ -4214,6 +6169,10 @@ def __init__( driver_package_name: Optional[str] = None, **kwargs ): + """ + :keyword driver_package_name: Name of the uploaded driver package to install. + :paramtype driver_package_name: str + """ super(InstallOCIDriverTaskInput, self).__init__(**kwargs) self.driver_package_name = driver_package_name @@ -4239,6 +6198,8 @@ def __init__( self, **kwargs ): + """ + """ super(InstallOCIDriverTaskOutput, self).__init__(**kwargs) self.validation_errors = None @@ -4250,8 +6211,25 @@ class InstallOCIDriverTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -4260,10 +6238,10 @@ class InstallOCIDriverTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Input for the service task to install an OCI driver. - :type input: ~azure.mgmt.datamigration.models.InstallOCIDriverTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Input for the service task to install an OCI driver. + :vartype input: ~azure.mgmt.datamigration.models.InstallOCIDriverTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.InstallOCIDriverTaskOutput] """ @@ -4293,19 +6271,57 @@ def __init__( input: Optional["InstallOCIDriverTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Input for the service task to install an OCI driver. + :paramtype input: ~azure.mgmt.datamigration.models.InstallOCIDriverTaskInput + """ super(InstallOCIDriverTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Service.Install.OCI' # type: str self.input = input self.output = None +class IntegrationRuntimeMonitoringData(msrest.serialization.Model): + """Integration Runtime Monitoring Data. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of Integration Runtime. + :vartype name: str + :ivar nodes: Integration Runtime node monitoring data. + :vartype nodes: list[~azure.mgmt.datamigration.models.NodeMonitoringData] + """ + + _validation = { + 'name': {'readonly': True}, + 'nodes': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nodes': {'key': 'nodes', 'type': '[NodeMonitoringData]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(IntegrationRuntimeMonitoringData, self).__init__(**kwargs) + self.name = None + self.nodes = None + + class MigrateMISyncCompleteCommandInput(msrest.serialization.Model): """Input for command that completes online migration for an Azure SQL Database Managed Instance. All required parameters must be populated in order to send to Azure. - :param source_database_name: Required. Name of managed instance database. - :type source_database_name: str + :ivar source_database_name: Required. Name of managed instance database. + :vartype source_database_name: str """ _validation = { @@ -4322,6 +6338,10 @@ def __init__( source_database_name: str, **kwargs ): + """ + :keyword source_database_name: Required. Name of managed instance database. + :paramtype source_database_name: str + """ super(MigrateMISyncCompleteCommandInput, self).__init__(**kwargs) self.source_database_name = source_database_name @@ -4329,8 +6349,8 @@ def __init__( class MigrateMISyncCompleteCommandOutput(msrest.serialization.Model): """Output for command that completes online migration for an Azure SQL Database Managed Instance. - :param errors: List of errors that happened during the command execution. - :type errors: list[~azure.mgmt.datamigration.models.ReportableException] + :ivar errors: List of errors that happened during the command execution. + :vartype errors: list[~azure.mgmt.datamigration.models.ReportableException] """ _attribute_map = { @@ -4343,6 +6363,10 @@ def __init__( errors: Optional[List["ReportableException"]] = None, **kwargs ): + """ + :keyword errors: List of errors that happened during the command execution. + :paramtype errors: list[~azure.mgmt.datamigration.models.ReportableException] + """ super(MigrateMISyncCompleteCommandOutput, self).__init__(**kwargs) self.errors = errors @@ -4354,15 +6378,17 @@ class MigrateMISyncCompleteCommandProperties(CommandProperties): All required parameters must be populated in order to send to Azure. - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str + :ivar command_type: Required. Command type.Constant filled by server. Possible values include: + "Migrate.Sync.Complete.Database", "Migrate.SqlServer.AzureDbSqlMi.Complete", "cancel", + "finish", "restart". + :vartype command_type: str or ~azure.mgmt.datamigration.models.CommandType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the command. This is ignored if submitted. Possible values include: "Unknown", "Accepted", "Running", "Succeeded", "Failed". :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - :param input: Command input. - :type input: ~azure.mgmt.datamigration.models.MigrateMISyncCompleteCommandInput + :ivar input: Command input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateMISyncCompleteCommandInput :ivar output: Command output. This is ignored if submitted. :vartype output: ~azure.mgmt.datamigration.models.MigrateMISyncCompleteCommandOutput """ @@ -4388,6 +6414,10 @@ def __init__( input: Optional["MigrateMISyncCompleteCommandInput"] = None, **kwargs ): + """ + :keyword input: Command input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateMISyncCompleteCommandInput + """ super(MigrateMISyncCompleteCommandProperties, self).__init__(**kwargs) self.command_type = 'Migrate.SqlServer.AzureDbSqlMi.Complete' # type: str self.input = input @@ -4401,8 +6431,25 @@ class MigrateMongoDbTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -4411,10 +6458,10 @@ class MigrateMongoDbTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Describes how a MongoDB data migration should be performed. - :type input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Describes how a MongoDB data migration should be performed. + :vartype input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings :ivar output: :vartype output: list[~azure.mgmt.datamigration.models.MongoDbProgress] """ @@ -4444,6 +6491,12 @@ def __init__( input: Optional["MongoDbMigrationSettings"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Describes how a MongoDB data migration should be performed. + :paramtype input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings + """ super(MigrateMongoDbTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Migrate.MongoDb' # type: str self.input = input @@ -4453,13 +6506,13 @@ def __init__( class MigrateMySqlAzureDbForMySqlOfflineDatabaseInput(msrest.serialization.Model): """Database specific information for offline MySQL to Azure Database for MySQL migration task inputs. - :param name: Name of the database. - :type name: str - :param target_database_name: Name of target database. Note: Target database will be truncated + :ivar name: Name of the database. + :vartype name: str + :ivar target_database_name: Name of target database. Note: Target database will be truncated before starting migration. - :type target_database_name: str - :param table_map: Mapping of source to target tables. - :type table_map: dict[str, str] + :vartype target_database_name: str + :ivar table_map: Mapping of source to target tables. + :vartype table_map: dict[str, str] """ _attribute_map = { @@ -4476,6 +6529,15 @@ def __init__( table_map: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword name: Name of the database. + :paramtype name: str + :keyword target_database_name: Name of target database. Note: Target database will be truncated + before starting migration. + :paramtype target_database_name: str + :keyword table_map: Mapping of source to target tables. + :paramtype table_map: dict[str, str] + """ super(MigrateMySqlAzureDbForMySqlOfflineDatabaseInput, self).__init__(**kwargs) self.name = name self.target_database_name = target_database_name @@ -4487,21 +6549,23 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Connection information for source MySQL. - :type source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param target_connection_info: Required. Connection information for target Azure Database for + :ivar source_connection_info: Required. Connection information for source MySQL. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :ivar target_connection_info: Required. Connection information for target Azure Database for MySQL. - :type target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :vartype target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineDatabaseInput] - :param make_source_server_read_only: Setting to set the source server read only. - :type make_source_server_read_only: bool - :param started_on: Parameter to specify when the migration started. - :type started_on: ~datetime.datetime - :param optional_agent_settings: Optional parameters for fine tuning the data transfer rate + :ivar make_source_server_read_only: Setting to set the source server read only. + :vartype make_source_server_read_only: bool + :ivar started_on: Parameter to specify when the migration started. + :vartype started_on: ~datetime.datetime + :ivar optional_agent_settings: Optional parameters for fine tuning the data transfer rate during migration. - :type optional_agent_settings: dict[str, str] + :vartype optional_agent_settings: dict[str, str] + :ivar encrypted_key_for_secure_fields: encrypted key for secure fields. + :vartype encrypted_key_for_secure_fields: str """ _validation = { @@ -4517,6 +6581,7 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskInput(msrest.serialization.Model): 'make_source_server_read_only': {'key': 'makeSourceServerReadOnly', 'type': 'bool'}, 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, 'optional_agent_settings': {'key': 'optionalAgentSettings', 'type': '{str}'}, + 'encrypted_key_for_secure_fields': {'key': 'encryptedKeyForSecureFields', 'type': 'str'}, } def __init__( @@ -4528,8 +6593,28 @@ def __init__( make_source_server_read_only: Optional[bool] = False, started_on: Optional[datetime.datetime] = None, optional_agent_settings: Optional[Dict[str, str]] = None, - **kwargs - ): + encrypted_key_for_secure_fields: Optional[str] = None, + **kwargs + ): + """ + :keyword source_connection_info: Required. Connection information for source MySQL. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :keyword target_connection_info: Required. Connection information for target Azure Database for + MySQL. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineDatabaseInput] + :keyword make_source_server_read_only: Setting to set the source server read only. + :paramtype make_source_server_read_only: bool + :keyword started_on: Parameter to specify when the migration started. + :paramtype started_on: ~datetime.datetime + :keyword optional_agent_settings: Optional parameters for fine tuning the data transfer rate + during migration. + :paramtype optional_agent_settings: dict[str, str] + :keyword encrypted_key_for_secure_fields: encrypted key for secure fields. + :paramtype encrypted_key_for_secure_fields: str + """ super(MigrateMySqlAzureDbForMySqlOfflineTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.target_connection_info = target_connection_info @@ -4537,6 +6622,7 @@ def __init__( self.make_source_server_read_only = make_source_server_read_only self.started_on = started_on self.optional_agent_settings = optional_agent_settings + self.encrypted_key_for_secure_fields = encrypted_key_for_secure_fields class MigrateMySqlAzureDbForMySqlOfflineTaskOutput(msrest.serialization.Model): @@ -4551,8 +6637,8 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskOutput(msrest.serialization.Model): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -4573,6 +6659,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateMySqlAzureDbForMySqlOfflineTaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -4587,8 +6675,8 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(MigrateMySqlAzur :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar database_name: Name of the database. :vartype database_name: str :ivar started_on: Migration start time. @@ -4668,6 +6756,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel, self).__init__(**kwargs) self.result_type = 'DatabaseLevelOutput' # type: str self.database_name = None @@ -4696,8 +6786,8 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(MigrateMySqlAzureDbForMy :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar error: Migration error. :vartype error: ~azure.mgmt.datamigration.models.ReportableException """ @@ -4718,6 +6808,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateMySqlAzureDbForMySqlOfflineTaskOutputError, self).__init__(**kwargs) self.result_type = 'ErrorOutput' # type: str self.error = None @@ -4732,8 +6824,8 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(MigrateMySqlAzu :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar started_on: Migration start time. :vartype started_on: ~datetime.datetime :ivar ended_on: Migration end time. @@ -4748,13 +6840,13 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(MigrateMySqlAzu :vartype status_message: str :ivar message: Migration progress message. :vartype message: str - :param databases: Selected databases as a map from database name to database id. - :type databases: str + :ivar databases: Selected databases as a map from database name to database id. + :vartype databases: str :ivar database_summary: Summary of database results in the migration. :vartype database_summary: str - :param migration_report_result: Migration Report Result, provides unique url for downloading + :ivar migration_report_result: Migration Report Result, provides unique url for downloading your migration report. - :type migration_report_result: ~azure.mgmt.datamigration.models.MigrationReportResult + :vartype migration_report_result: ~azure.mgmt.datamigration.models.MigrationReportResult :ivar source_server_version: Source server version. :vartype source_server_version: str :ivar source_server_brand_version: Source server brand version. @@ -4814,6 +6906,13 @@ def __init__( migration_report_result: Optional["MigrationReportResult"] = None, **kwargs ): + """ + :keyword databases: Selected databases as a map from database name to database id. + :paramtype databases: str + :keyword migration_report_result: Migration Report Result, provides unique url for downloading + your migration report. + :paramtype migration_report_result: ~azure.mgmt.datamigration.models.MigrationReportResult + """ super(MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel, self).__init__(**kwargs) self.result_type = 'MigrationLevelOutput' # type: str self.started_on = None @@ -4842,8 +6941,8 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(MigrateMySqlAzureDb :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar object_name: Name of the item. :vartype object_name: str :ivar started_on: Migration start time. @@ -4902,6 +7001,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel, self).__init__(**kwargs) self.result_type = 'TableLevelOutput' # type: str self.object_name = None @@ -4923,8 +7024,25 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -4933,13 +7051,17 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineTaskOutput] + :ivar is_cloneable: whether the task can be cloned or not. + :vartype is_cloneable: bool + :ivar task_id: Task id. + :vartype task_id: str """ _validation = { @@ -4958,6 +7080,8 @@ class MigrateMySqlAzureDbForMySqlOfflineTaskProperties(ProjectTaskProperties): 'client_data': {'key': 'clientData', 'type': '{str}'}, 'input': {'key': 'input', 'type': 'MigrateMySqlAzureDbForMySqlOfflineTaskInput'}, 'output': {'key': 'output', 'type': '[MigrateMySqlAzureDbForMySqlOfflineTaskOutput]'}, + 'is_cloneable': {'key': 'isCloneable', 'type': 'bool'}, + 'task_id': {'key': 'taskId', 'type': 'str'}, } def __init__( @@ -4965,30 +7089,44 @@ def __init__( *, client_data: Optional[Dict[str, str]] = None, input: Optional["MigrateMySqlAzureDbForMySqlOfflineTaskInput"] = None, - **kwargs - ): + is_cloneable: Optional[bool] = None, + task_id: Optional[str] = None, + **kwargs + ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineTaskInput + :keyword is_cloneable: whether the task can be cloned or not. + :paramtype is_cloneable: bool + :keyword task_id: Task id. + :paramtype task_id: str + """ super(MigrateMySqlAzureDbForMySqlOfflineTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Migrate.MySql.AzureDbForMySql' # type: str self.input = input self.output = None + self.is_cloneable = is_cloneable + self.task_id = task_id class MigrateMySqlAzureDbForMySqlSyncDatabaseInput(msrest.serialization.Model): """Database specific information for MySQL to Azure Database for MySQL migration task inputs. - :param name: Name of the database. - :type name: str - :param target_database_name: Name of target database. Note: Target database will be truncated + :ivar name: Name of the database. + :vartype name: str + :ivar target_database_name: Name of target database. Note: Target database will be truncated before starting migration. - :type target_database_name: str - :param migration_setting: Migration settings which tune the migration behavior. - :type migration_setting: dict[str, str] - :param source_setting: Source settings to tune source endpoint migration behavior. - :type source_setting: dict[str, str] - :param target_setting: Target settings to tune target endpoint migration behavior. - :type target_setting: dict[str, str] - :param table_map: Mapping of source to target tables. - :type table_map: dict[str, str] + :vartype target_database_name: str + :ivar migration_setting: Migration settings which tune the migration behavior. + :vartype migration_setting: dict[str, str] + :ivar source_setting: Source settings to tune source endpoint migration behavior. + :vartype source_setting: dict[str, str] + :ivar target_setting: Target settings to tune target endpoint migration behavior. + :vartype target_setting: dict[str, str] + :ivar table_map: Mapping of source to target tables. + :vartype table_map: dict[str, str] """ _attribute_map = { @@ -5011,6 +7149,21 @@ def __init__( table_map: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword name: Name of the database. + :paramtype name: str + :keyword target_database_name: Name of target database. Note: Target database will be truncated + before starting migration. + :paramtype target_database_name: str + :keyword migration_setting: Migration settings which tune the migration behavior. + :paramtype migration_setting: dict[str, str] + :keyword source_setting: Source settings to tune source endpoint migration behavior. + :paramtype source_setting: dict[str, str] + :keyword target_setting: Target settings to tune target endpoint migration behavior. + :paramtype target_setting: dict[str, str] + :keyword table_map: Mapping of source to target tables. + :paramtype table_map: dict[str, str] + """ super(MigrateMySqlAzureDbForMySqlSyncDatabaseInput, self).__init__(**kwargs) self.name = name self.target_database_name = target_database_name @@ -5025,13 +7178,13 @@ class MigrateMySqlAzureDbForMySqlSyncTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Connection information for source MySQL. - :type source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param target_connection_info: Required. Connection information for target Azure Database for + :ivar source_connection_info: Required. Connection information for source MySQL. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :ivar target_connection_info: Required. Connection information for target Azure Database for MySQL. - :type target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :vartype target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncDatabaseInput] """ @@ -5055,6 +7208,16 @@ def __init__( selected_databases: List["MigrateMySqlAzureDbForMySqlSyncDatabaseInput"], **kwargs ): + """ + :keyword source_connection_info: Required. Connection information for source MySQL. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :keyword target_connection_info: Required. Connection information for target Azure Database for + MySQL. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncDatabaseInput] + """ super(MigrateMySqlAzureDbForMySqlSyncTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.target_connection_info = target_connection_info @@ -5073,8 +7236,8 @@ class MigrateMySqlAzureDbForMySqlSyncTaskOutput(msrest.serialization.Model): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -5095,6 +7258,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateMySqlAzureDbForMySqlSyncTaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -5109,12 +7274,12 @@ class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError(MigrateMySqlAzureDb :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :param error_message: Error message. - :type error_message: str - :param events: List of error events. - :type events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str + :ivar error_message: Error message. + :vartype error_message: str + :ivar events: List of error events. + :vartype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] """ _validation = { @@ -5136,6 +7301,12 @@ def __init__( events: Optional[List["SyncMigrationDatabaseErrorEvent"]] = None, **kwargs ): + """ + :keyword error_message: Error message. + :paramtype error_message: str + :keyword events: List of error events. + :paramtype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] + """ super(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError, self).__init__(**kwargs) self.result_type = 'DatabaseLevelErrorOutput' # type: str self.error_message = error_message @@ -5151,8 +7322,8 @@ class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(MigrateMySqlAzureDb :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar database_name: Name of the database. :vartype database_name: str :ivar started_on: Migration start time. @@ -5234,6 +7405,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel, self).__init__(**kwargs) self.result_type = 'DatabaseLevelOutput' # type: str self.database_name = None @@ -5262,8 +7435,8 @@ class MigrateMySqlAzureDbForMySqlSyncTaskOutputError(MigrateMySqlAzureDbForMySql :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar error: Migration error. :vartype error: ~azure.mgmt.datamigration.models.ReportableException """ @@ -5284,6 +7457,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateMySqlAzureDbForMySqlSyncTaskOutputError, self).__init__(**kwargs) self.result_type = 'ErrorOutput' # type: str self.error = None @@ -5298,8 +7473,8 @@ class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(MigrateMySqlAzureD :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar started_on: Migration start time. :vartype started_on: ~datetime.datetime :ivar ended_on: Migration end time. @@ -5340,6 +7515,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel, self).__init__(**kwargs) self.result_type = 'MigrationLevelOutput' # type: str self.started_on = None @@ -5359,8 +7536,8 @@ class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(MigrateMySqlAzureDbFor :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar table_name: Name of the table. :vartype table_name: str :ivar database_name: Name of the database. @@ -5430,6 +7607,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel, self).__init__(**kwargs) self.result_type = 'TableLevelOutput' # type: str self.table_name = None @@ -5454,8 +7633,25 @@ class MigrateMySqlAzureDbForMySqlSyncTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -5464,10 +7660,10 @@ class MigrateMySqlAzureDbForMySqlSyncTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskOutput] @@ -5498,6 +7694,12 @@ def __init__( input: Optional["MigrateMySqlAzureDbForMySqlSyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskInput + """ super(MigrateMySqlAzureDbForMySqlSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Migrate.MySql.AzureDbForMySql.Sync' # type: str self.input = input @@ -5511,8 +7713,25 @@ class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskProperties) All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -5521,10 +7740,10 @@ class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskProperties) :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskOutput] @@ -5555,6 +7774,12 @@ def __init__( input: Optional["MigrateOracleAzureDbPostgreSqlSyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskInput + """ super(MigrateOracleAzureDbForPostgreSqlSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Migrate.Oracle.AzureDbForPostgreSql.Sync' # type: str self.input = input @@ -5564,23 +7789,23 @@ def __init__( class MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(msrest.serialization.Model): """Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs. - :param case_manipulation: How to handle object name casing: either Preserve or ToLower. - :type case_manipulation: str - :param name: Name of the migration pipeline. - :type name: str - :param schema_name: Name of the source schema. - :type schema_name: str - :param table_map: Mapping of source to target tables. - :type table_map: dict[str, str] - :param target_database_name: Name of target database. Note: Target database will be truncated + :ivar case_manipulation: How to handle object name casing: either Preserve or ToLower. + :vartype case_manipulation: str + :ivar name: Name of the migration pipeline. + :vartype name: str + :ivar schema_name: Name of the source schema. + :vartype schema_name: str + :ivar table_map: Mapping of source to target tables. + :vartype table_map: dict[str, str] + :ivar target_database_name: Name of target database. Note: Target database will be truncated before starting migration. - :type target_database_name: str - :param migration_setting: Migration settings which tune the migration behavior. - :type migration_setting: dict[str, str] - :param source_setting: Source settings to tune source endpoint migration behavior. - :type source_setting: dict[str, str] - :param target_setting: Target settings to tune target endpoint migration behavior. - :type target_setting: dict[str, str] + :vartype target_database_name: str + :ivar migration_setting: Migration settings which tune the migration behavior. + :vartype migration_setting: dict[str, str] + :ivar source_setting: Source settings to tune source endpoint migration behavior. + :vartype source_setting: dict[str, str] + :ivar target_setting: Target settings to tune target endpoint migration behavior. + :vartype target_setting: dict[str, str] """ _attribute_map = { @@ -5607,6 +7832,25 @@ def __init__( target_setting: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword case_manipulation: How to handle object name casing: either Preserve or ToLower. + :paramtype case_manipulation: str + :keyword name: Name of the migration pipeline. + :paramtype name: str + :keyword schema_name: Name of the source schema. + :paramtype schema_name: str + :keyword table_map: Mapping of source to target tables. + :paramtype table_map: dict[str, str] + :keyword target_database_name: Name of target database. Note: Target database will be truncated + before starting migration. + :paramtype target_database_name: str + :keyword migration_setting: Migration settings which tune the migration behavior. + :paramtype migration_setting: dict[str, str] + :keyword source_setting: Source settings to tune source endpoint migration behavior. + :paramtype source_setting: dict[str, str] + :keyword target_setting: Target settings to tune target endpoint migration behavior. + :paramtype target_setting: dict[str, str] + """ super(MigrateOracleAzureDbPostgreSqlSyncDatabaseInput, self).__init__(**kwargs) self.case_manipulation = case_manipulation self.name = name @@ -5623,14 +7867,14 @@ class MigrateOracleAzureDbPostgreSqlSyncTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncDatabaseInput] - :param target_connection_info: Required. Connection information for target Azure Database for + :ivar target_connection_info: Required. Connection information for target Azure Database for PostgreSQL. - :type target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - :param source_connection_info: Required. Connection information for source Oracle. - :type source_connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo + :vartype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :ivar source_connection_info: Required. Connection information for source Oracle. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo """ _validation = { @@ -5653,6 +7897,16 @@ def __init__( source_connection_info: "OracleConnectionInfo", **kwargs ): + """ + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncDatabaseInput] + :keyword target_connection_info: Required. Connection information for target Azure Database for + PostgreSQL. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :keyword source_connection_info: Required. Connection information for source Oracle. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo + """ super(MigrateOracleAzureDbPostgreSqlSyncTaskInput, self).__init__(**kwargs) self.selected_databases = selected_databases self.target_connection_info = target_connection_info @@ -5671,8 +7925,8 @@ class MigrateOracleAzureDbPostgreSqlSyncTaskOutput(msrest.serialization.Model): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -5693,6 +7947,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateOracleAzureDbPostgreSqlSyncTaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -5707,12 +7963,12 @@ class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(MigrateOracleAzu :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :param error_message: Error message. - :type error_message: str - :param events: List of error events. - :type events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str + :ivar error_message: Error message. + :vartype error_message: str + :ivar events: List of error events. + :vartype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] """ _validation = { @@ -5734,6 +7990,12 @@ def __init__( events: Optional[List["SyncMigrationDatabaseErrorEvent"]] = None, **kwargs ): + """ + :keyword error_message: Error message. + :paramtype error_message: str + :keyword events: List of error events. + :paramtype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] + """ super(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError, self).__init__(**kwargs) self.result_type = 'DatabaseLevelErrorOutput' # type: str self.error_message = error_message @@ -5749,8 +8011,8 @@ class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(MigrateOracleAzu :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar database_name: Name of the database. :vartype database_name: str :ivar started_on: Migration start time. @@ -5832,6 +8094,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel, self).__init__(**kwargs) self.result_type = 'DatabaseLevelOutput' # type: str self.database_name = None @@ -5860,8 +8124,8 @@ class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(MigrateOracleAzureDbPost :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar error: Migration error. :vartype error: ~azure.mgmt.datamigration.models.ReportableException """ @@ -5882,6 +8146,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateOracleAzureDbPostgreSqlSyncTaskOutputError, self).__init__(**kwargs) self.result_type = 'ErrorOutput' # type: str self.error = None @@ -5896,8 +8162,8 @@ class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(MigrateOracleAz :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar started_on: Migration start time. :vartype started_on: ~datetime.datetime :ivar ended_on: Migration end time. @@ -5938,6 +8204,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel, self).__init__(**kwargs) self.result_type = 'MigrationLevelOutput' # type: str self.started_on = None @@ -5957,8 +8225,8 @@ class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(MigrateOracleAzureD :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar table_name: Name of the table. :vartype table_name: str :ivar database_name: Name of the database. @@ -6028,6 +8296,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel, self).__init__(**kwargs) self.result_type = 'TableLevelOutput' # type: str self.table_name = None @@ -6048,26 +8318,35 @@ def __init__( class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput(msrest.serialization.Model): """Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs. - :param name: Name of the database. - :type name: str - :param target_database_name: Name of target database. Note: Target database will be truncated + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the database. + :vartype name: str + :ivar id: Result identifier. + :vartype id: str + :ivar target_database_name: Name of target database. Note: Target database will be truncated before starting migration. - :type target_database_name: str - :param migration_setting: Migration settings which tune the migration behavior. - :type migration_setting: dict[str, str] - :param source_setting: Source settings to tune source endpoint migration behavior. - :type source_setting: dict[str, str] - :param target_setting: Target settings to tune target endpoint migration behavior. - :type target_setting: dict[str, str] - :param selected_tables: Tables selected for migration. - :type selected_tables: + :vartype target_database_name: str + :ivar migration_setting: Migration settings which tune the migration behavior. + :vartype migration_setting: dict[str, any] + :ivar source_setting: Source settings to tune source endpoint migration behavior. + :vartype source_setting: dict[str, str] + :ivar target_setting: Target settings to tune target endpoint migration behavior. + :vartype target_setting: dict[str, str] + :ivar selected_tables: Tables selected for migration. + :vartype selected_tables: list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput] """ + _validation = { + 'id': {'readonly': True}, + } + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, - 'migration_setting': {'key': 'migrationSetting', 'type': '{str}'}, + 'migration_setting': {'key': 'migrationSetting', 'type': '{object}'}, 'source_setting': {'key': 'sourceSetting', 'type': '{str}'}, 'target_setting': {'key': 'targetSetting', 'type': '{str}'}, 'selected_tables': {'key': 'selectedTables', 'type': '[MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput]'}, @@ -6078,14 +8357,31 @@ def __init__( *, name: Optional[str] = None, target_database_name: Optional[str] = None, - migration_setting: Optional[Dict[str, str]] = None, + migration_setting: Optional[Dict[str, Any]] = None, source_setting: Optional[Dict[str, str]] = None, target_setting: Optional[Dict[str, str]] = None, selected_tables: Optional[List["MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput"]] = None, **kwargs ): + """ + :keyword name: Name of the database. + :paramtype name: str + :keyword target_database_name: Name of target database. Note: Target database will be truncated + before starting migration. + :paramtype target_database_name: str + :keyword migration_setting: Migration settings which tune the migration behavior. + :paramtype migration_setting: dict[str, any] + :keyword source_setting: Source settings to tune source endpoint migration behavior. + :paramtype source_setting: dict[str, str] + :keyword target_setting: Target settings to tune target endpoint migration behavior. + :paramtype target_setting: dict[str, str] + :keyword selected_tables: Tables selected for migration. + :paramtype selected_tables: + list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput] + """ super(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput, self).__init__(**kwargs) self.name = name + self.id = None self.target_database_name = target_database_name self.migration_setting = migration_setting self.source_setting = source_setting @@ -6096,8 +8392,8 @@ def __init__( class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput(msrest.serialization.Model): """Selected tables for the migration. - :param name: Name of the table to migrate. - :type name: str + :ivar name: Name of the table to migrate. + :vartype name: str """ _attribute_map = { @@ -6110,6 +8406,10 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword name: Name of the table to migrate. + :paramtype name: str + """ super(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput, self).__init__(**kwargs) self.name = name @@ -6117,28 +8417,37 @@ def __init__( class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput(msrest.serialization.Model): """Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput] - :param target_connection_info: Required. Connection information for target Azure Database for + :ivar target_connection_info: Required. Connection information for target Azure Database for PostgreSQL. - :type target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo - :param source_connection_info: Required. Connection information for source PostgreSQL. - :type source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :vartype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :ivar source_connection_info: Required. Connection information for source PostgreSQL. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :ivar encrypted_key_for_secure_fields: encrypted key for secure fields. + :vartype encrypted_key_for_secure_fields: str + :ivar started_on: Migration start time. + :vartype started_on: ~datetime.datetime """ _validation = { 'selected_databases': {'required': True}, 'target_connection_info': {'required': True}, 'source_connection_info': {'required': True}, + 'started_on': {'readonly': True}, } _attribute_map = { 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput]'}, 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'PostgreSqlConnectionInfo'}, 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'PostgreSqlConnectionInfo'}, + 'encrypted_key_for_secure_fields': {'key': 'encryptedKeyForSecureFields', 'type': 'str'}, + 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, } def __init__( @@ -6147,12 +8456,27 @@ def __init__( selected_databases: List["MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput"], target_connection_info: "PostgreSqlConnectionInfo", source_connection_info: "PostgreSqlConnectionInfo", - **kwargs - ): + encrypted_key_for_secure_fields: Optional[str] = None, + **kwargs + ): + """ + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput] + :keyword target_connection_info: Required. Connection information for target Azure Database for + PostgreSQL. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :keyword source_connection_info: Required. Connection information for source PostgreSQL. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo + :keyword encrypted_key_for_secure_fields: encrypted key for secure fields. + :paramtype encrypted_key_for_secure_fields: str + """ super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput, self).__init__(**kwargs) self.selected_databases = selected_databases self.target_connection_info = target_connection_info self.source_connection_info = source_connection_info + self.encrypted_key_for_secure_fields = encrypted_key_for_secure_fields + self.started_on = None class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(msrest.serialization.Model): @@ -6167,8 +8491,8 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(msrest.serialization.M :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -6189,6 +8513,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -6203,12 +8529,12 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError(MigratePo :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :param error_message: Error message. - :type error_message: str - :param events: List of error events. - :type events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str + :ivar error_message: Error message. + :vartype error_message: str + :ivar events: List of error events. + :vartype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] """ _validation = { @@ -6230,6 +8556,12 @@ def __init__( events: Optional[List["SyncMigrationDatabaseErrorEvent"]] = None, **kwargs ): + """ + :keyword error_message: Error message. + :paramtype error_message: str + :keyword events: List of error events. + :paramtype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] + """ super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError, self).__init__(**kwargs) self.result_type = 'DatabaseLevelErrorOutput' # type: str self.error_message = error_message @@ -6245,8 +8577,8 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(MigratePo :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar database_name: Name of the database. :vartype database_name: str :ivar started_on: Migration start time. @@ -6328,6 +8660,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel, self).__init__(**kwargs) self.result_type = 'DatabaseLevelOutput' # type: str self.database_name = None @@ -6356,10 +8690,12 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(MigratePostgreSql :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar error: Migration error. :vartype error: ~azure.mgmt.datamigration.models.ReportableException + :ivar events: List of error events. + :vartype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] """ _validation = { @@ -6372,15 +8708,23 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(MigratePostgreSql 'id': {'key': 'id', 'type': 'str'}, 'result_type': {'key': 'resultType', 'type': 'str'}, 'error': {'key': 'error', 'type': 'ReportableException'}, + 'events': {'key': 'events', 'type': '[SyncMigrationDatabaseErrorEvent]'}, } def __init__( self, + *, + events: Optional[List["SyncMigrationDatabaseErrorEvent"]] = None, **kwargs ): + """ + :keyword events: List of error events. + :paramtype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] + """ super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError, self).__init__(**kwargs) self.result_type = 'ErrorOutput' # type: str self.error = None + self.events = events class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput): @@ -6392,8 +8736,8 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(MigrateP :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar started_on: Migration start time. :vartype started_on: ~datetime.datetime :ivar ended_on: Migration end time. @@ -6416,6 +8760,8 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(MigrateP :ivar state: Migration status. Possible values include: "UNDEFINED", "VALIDATING", "PENDING", "COMPLETE", "ACTION_REQUIRED", "FAILED". :vartype state: str or ~azure.mgmt.datamigration.models.ReplicateMigrationState + :ivar database_count: Number of databases to include. + :vartype database_count: float """ _validation = { @@ -6444,12 +8790,19 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(MigrateP 'source_server_type': {'key': 'sourceServerType', 'type': 'str'}, 'target_server_type': {'key': 'targetServerType', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, + 'database_count': {'key': 'databaseCount', 'type': 'float'}, } def __init__( self, + *, + database_count: Optional[float] = None, **kwargs ): + """ + :keyword database_count: Number of databases to include. + :paramtype database_count: float + """ super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel, self).__init__(**kwargs) self.result_type = 'MigrationLevelOutput' # type: str self.started_on = None @@ -6461,6 +8814,7 @@ def __init__( self.source_server_type = None self.target_server_type = None self.state = None + self.database_count = database_count class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput): @@ -6472,8 +8826,8 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(MigratePostg :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar table_name: Name of the table. :vartype table_name: str :ivar database_name: Name of the database. @@ -6543,6 +8897,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel, self).__init__(**kwargs) self.result_type = 'TableLevelOutput' # type: str self.table_name = None @@ -6567,8 +8923,25 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskPropert All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -6577,14 +8950,20 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskPropert :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput] + :ivar task_id: task id. + :vartype task_id: str + :ivar created_on: DateTime in UTC when the task was created. + :vartype created_on: str + :ivar is_cloneable: whether the task can be cloned or not. + :vartype is_cloneable: bool """ _validation = { @@ -6603,6 +8982,9 @@ class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskPropert 'client_data': {'key': 'clientData', 'type': '{str}'}, 'input': {'key': 'input', 'type': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput'}, 'output': {'key': 'output', 'type': '[MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput]'}, + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'created_on': {'key': 'createdOn', 'type': 'str'}, + 'is_cloneable': {'key': 'isCloneable', 'type': 'bool'}, } def __init__( @@ -6610,27 +8992,49 @@ def __init__( *, client_data: Optional[Dict[str, str]] = None, input: Optional["MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput"] = None, - **kwargs - ): + task_id: Optional[str] = None, + created_on: Optional[str] = None, + is_cloneable: Optional[bool] = None, + **kwargs + ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: + ~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput + :keyword task_id: task id. + :paramtype task_id: str + :keyword created_on: DateTime in UTC when the task was created. + :paramtype created_on: str + :keyword is_cloneable: whether the task can be cloned or not. + :paramtype is_cloneable: bool + """ super(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2' # type: str self.input = input self.output = None + self.task_id = task_id + self.created_on = created_on + self.is_cloneable = is_cloneable class MigrateSchemaSqlServerSqlDbDatabaseInput(msrest.serialization.Model): """Database input for migrate schema Sql Server to Azure SQL Server scenario. - :param name: Name of source database. - :type name: str - :param target_database_name: Name of target database. - :type target_database_name: str - :param schema_setting: Database schema migration settings. - :type schema_setting: ~azure.mgmt.datamigration.models.SchemaMigrationSetting + :ivar name: Name of source database. + :vartype name: str + :ivar id: Id of the source database. + :vartype id: str + :ivar target_database_name: Name of target database. + :vartype target_database_name: str + :ivar schema_setting: Database schema migration settings. + :vartype schema_setting: ~azure.mgmt.datamigration.models.SchemaMigrationSetting """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, 'schema_setting': {'key': 'schemaSetting', 'type': 'SchemaMigrationSetting'}, } @@ -6639,12 +9043,24 @@ def __init__( self, *, name: Optional[str] = None, + id: Optional[str] = None, target_database_name: Optional[str] = None, schema_setting: Optional["SchemaMigrationSetting"] = None, **kwargs ): + """ + :keyword name: Name of source database. + :paramtype name: str + :keyword id: Id of the source database. + :paramtype id: str + :keyword target_database_name: Name of target database. + :paramtype target_database_name: str + :keyword schema_setting: Database schema migration settings. + :paramtype schema_setting: ~azure.mgmt.datamigration.models.SchemaMigrationSetting + """ super(MigrateSchemaSqlServerSqlDbDatabaseInput, self).__init__(**kwargs) self.name = name + self.id = id self.target_database_name = target_database_name self.schema_setting = schema_setting @@ -6654,10 +9070,10 @@ class SqlMigrationTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar source_connection_info: Required. Information for connecting to source. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Information for connecting to target. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo """ _validation = { @@ -6677,6 +9093,12 @@ def __init__( target_connection_info: "SqlConnectionInfo", **kwargs ): + """ + :keyword source_connection_info: Required. Information for connecting to source. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Information for connecting to target. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + """ super(SqlMigrationTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.target_connection_info = target_connection_info @@ -6687,13 +9109,17 @@ class MigrateSchemaSqlServerSqlDbTaskInput(SqlMigrationTaskInput): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar source_connection_info: Required. Information for connecting to source. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Information for connecting to target. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbDatabaseInput] + :ivar encrypted_key_for_secure_fields: encrypted key for secure fields. + :vartype encrypted_key_for_secure_fields: str + :ivar started_on: Migration start time. + :vartype started_on: str """ _validation = { @@ -6706,6 +9132,8 @@ class MigrateSchemaSqlServerSqlDbTaskInput(SqlMigrationTaskInput): 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSchemaSqlServerSqlDbDatabaseInput]'}, + 'encrypted_key_for_secure_fields': {'key': 'encryptedKeyForSecureFields', 'type': 'str'}, + 'started_on': {'key': 'startedOn', 'type': 'str'}, } def __init__( @@ -6714,10 +9142,27 @@ def __init__( source_connection_info: "SqlConnectionInfo", target_connection_info: "SqlConnectionInfo", selected_databases: List["MigrateSchemaSqlServerSqlDbDatabaseInput"], - **kwargs - ): + encrypted_key_for_secure_fields: Optional[str] = None, + started_on: Optional[str] = None, + **kwargs + ): + """ + :keyword source_connection_info: Required. Information for connecting to source. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Information for connecting to target. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbDatabaseInput] + :keyword encrypted_key_for_secure_fields: encrypted key for secure fields. + :paramtype encrypted_key_for_secure_fields: str + :keyword started_on: Migration start time. + :paramtype started_on: str + """ super(MigrateSchemaSqlServerSqlDbTaskInput, self).__init__(source_connection_info=source_connection_info, target_connection_info=target_connection_info, **kwargs) self.selected_databases = selected_databases + self.encrypted_key_for_secure_fields = encrypted_key_for_secure_fields + self.started_on = started_on class MigrateSchemaSqlServerSqlDbTaskOutput(msrest.serialization.Model): @@ -6732,8 +9177,8 @@ class MigrateSchemaSqlServerSqlDbTaskOutput(msrest.serialization.Model): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -6754,6 +9199,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSchemaSqlServerSqlDbTaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -6768,8 +9215,8 @@ class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(MigrateSchemaSqlServerS :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar database_name: The name of the database. :vartype database_name: str :ivar state: State of the schema migration for this database. Possible values include: "None", @@ -6830,6 +9277,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel, self).__init__(**kwargs) self.result_type = 'DatabaseLevelOutput' # type: str self.database_name = None @@ -6853,8 +9302,8 @@ class MigrateSchemaSqlServerSqlDbTaskOutputError(MigrateSchemaSqlServerSqlDbTask :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar command_text: Schema command which failed. :vartype command_text: str :ivar error_text: Reason of failure. @@ -6879,6 +9328,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSchemaSqlServerSqlDbTaskOutputError, self).__init__(**kwargs) self.result_type = 'SchemaErrorOutput' # type: str self.command_text = None @@ -6894,8 +9345,8 @@ class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(MigrateSchemaSqlServer :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar state: Overall state of the schema migration. Possible values include: "None", "InProgress", "Failed", "Warning", "Completed", "Skipped", "Stopped". :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState @@ -6941,6 +9392,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel, self).__init__(**kwargs) self.result_type = 'MigrationLevelOutput' # type: str self.state = None @@ -6959,8 +9412,25 @@ class MigrateSchemaSqlServerSqlDbTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -6969,12 +9439,18 @@ class MigrateSchemaSqlServerSqlDbTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbTaskOutput] + :ivar created_on: DateTime in UTC when the task was created. + :vartype created_on: str + :ivar task_id: Task id. + :vartype task_id: str + :ivar is_cloneable: whether the task can be cloned or not. + :vartype is_cloneable: bool """ _validation = { @@ -6993,6 +9469,9 @@ class MigrateSchemaSqlServerSqlDbTaskProperties(ProjectTaskProperties): 'client_data': {'key': 'clientData', 'type': '{str}'}, 'input': {'key': 'input', 'type': 'MigrateSchemaSqlServerSqlDbTaskInput'}, 'output': {'key': 'output', 'type': '[MigrateSchemaSqlServerSqlDbTaskOutput]'}, + 'created_on': {'key': 'createdOn', 'type': 'str'}, + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'is_cloneable': {'key': 'isCloneable', 'type': 'bool'}, } def __init__( @@ -7000,12 +9479,30 @@ def __init__( *, client_data: Optional[Dict[str, str]] = None, input: Optional["MigrateSchemaSqlServerSqlDbTaskInput"] = None, - **kwargs - ): + created_on: Optional[str] = None, + task_id: Optional[str] = None, + is_cloneable: Optional[bool] = None, + **kwargs + ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbTaskInput + :keyword created_on: DateTime in UTC when the task was created. + :paramtype created_on: str + :keyword task_id: Task id. + :paramtype task_id: str + :keyword is_cloneable: whether the task can be cloned or not. + :paramtype is_cloneable: bool + """ super(MigrateSchemaSqlServerSqlDbTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'MigrateSchemaSqlServerSqlDb' # type: str self.input = input self.output = None + self.created_on = created_on + self.task_id = task_id + self.is_cloneable = is_cloneable class MigrateSchemaSqlTaskOutputError(MigrateSchemaSqlServerSqlDbTaskOutput): @@ -7017,8 +9514,8 @@ class MigrateSchemaSqlTaskOutputError(MigrateSchemaSqlServerSqlDbTaskOutput): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar error: Migration error. :vartype error: ~azure.mgmt.datamigration.models.ReportableException """ @@ -7039,6 +9536,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSchemaSqlTaskOutputError, self).__init__(**kwargs) self.result_type = 'ErrorOutput' # type: str self.error = None @@ -7047,14 +9546,14 @@ def __init__( class MigrateSqlServerDatabaseInput(msrest.serialization.Model): """Database specific information for SQL to SQL migration task inputs. - :param name: Name of the database. - :type name: str - :param restore_database_name: Name of the database at destination. - :type restore_database_name: str - :param backup_and_restore_folder: The backup and restore folder. - :type backup_and_restore_folder: str - :param database_files: The list of database files. - :type database_files: list[~azure.mgmt.datamigration.models.DatabaseFileInput] + :ivar name: Name of the database. + :vartype name: str + :ivar restore_database_name: Name of the database at destination. + :vartype restore_database_name: str + :ivar backup_and_restore_folder: The backup and restore folder. + :vartype backup_and_restore_folder: str + :ivar database_files: The list of database files. + :vartype database_files: list[~azure.mgmt.datamigration.models.DatabaseFileInput] """ _attribute_map = { @@ -7073,6 +9572,16 @@ def __init__( database_files: Optional[List["DatabaseFileInput"]] = None, **kwargs ): + """ + :keyword name: Name of the database. + :paramtype name: str + :keyword restore_database_name: Name of the database at destination. + :paramtype restore_database_name: str + :keyword backup_and_restore_folder: The backup and restore folder. + :paramtype backup_and_restore_folder: str + :keyword database_files: The list of database files. + :paramtype database_files: list[~azure.mgmt.datamigration.models.DatabaseFileInput] + """ super(MigrateSqlServerDatabaseInput, self).__init__(**kwargs) self.name = name self.restore_database_name = restore_database_name @@ -7083,15 +9592,19 @@ def __init__( class MigrateSqlServerSqlDbDatabaseInput(msrest.serialization.Model): """Database specific information for SQL to Azure SQL DB migration task inputs. - :param name: Name of the database. - :type name: str - :param target_database_name: Name of target database. Note: Target database will be truncated + :ivar name: Name of the database. + :vartype name: str + :ivar target_database_name: Name of target database. Note: Target database will be truncated before starting migration. - :type target_database_name: str - :param make_source_db_read_only: Whether to set database read only before migration. - :type make_source_db_read_only: bool - :param table_map: Mapping of source to target tables. - :type table_map: dict[str, str] + :vartype target_database_name: str + :ivar make_source_db_read_only: Whether to set database read only before migration. + :vartype make_source_db_read_only: bool + :ivar table_map: Mapping of source to target tables. + :vartype table_map: dict[str, str] + :ivar schema_setting: Settings selected for DB schema migration. + :vartype schema_setting: any + :ivar id: id of the database. + :vartype id: str """ _attribute_map = { @@ -7099,6 +9612,8 @@ class MigrateSqlServerSqlDbDatabaseInput(msrest.serialization.Model): 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, 'make_source_db_read_only': {'key': 'makeSourceDbReadOnly', 'type': 'bool'}, 'table_map': {'key': 'tableMap', 'type': '{str}'}, + 'schema_setting': {'key': 'schemaSetting', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( @@ -7108,34 +9623,53 @@ def __init__( target_database_name: Optional[str] = None, make_source_db_read_only: Optional[bool] = None, table_map: Optional[Dict[str, str]] = None, + schema_setting: Optional[Any] = None, + id: Optional[str] = None, **kwargs ): + """ + :keyword name: Name of the database. + :paramtype name: str + :keyword target_database_name: Name of target database. Note: Target database will be truncated + before starting migration. + :paramtype target_database_name: str + :keyword make_source_db_read_only: Whether to set database read only before migration. + :paramtype make_source_db_read_only: bool + :keyword table_map: Mapping of source to target tables. + :paramtype table_map: dict[str, str] + :keyword schema_setting: Settings selected for DB schema migration. + :paramtype schema_setting: any + :keyword id: id of the database. + :paramtype id: str + """ super(MigrateSqlServerSqlDbDatabaseInput, self).__init__(**kwargs) self.name = name self.target_database_name = target_database_name self.make_source_db_read_only = make_source_db_read_only self.table_map = table_map + self.schema_setting = schema_setting + self.id = id class MigrateSqlServerSqlDbSyncDatabaseInput(msrest.serialization.Model): """Database specific information for SQL to Azure SQL DB sync migration task inputs. - :param id: Unique identifier for database. - :type id: str - :param name: Name of database. - :type name: str - :param target_database_name: Target database name. - :type target_database_name: str - :param schema_name: Schema name to be migrated. - :type schema_name: str - :param table_map: Mapping of source to target tables. - :type table_map: dict[str, str] - :param migration_setting: Migration settings which tune the migration behavior. - :type migration_setting: dict[str, str] - :param source_setting: Source settings to tune source endpoint migration behavior. - :type source_setting: dict[str, str] - :param target_setting: Target settings to tune target endpoint migration behavior. - :type target_setting: dict[str, str] + :ivar id: Unique identifier for database. + :vartype id: str + :ivar name: Name of database. + :vartype name: str + :ivar target_database_name: Target database name. + :vartype target_database_name: str + :ivar schema_name: Schema name to be migrated. + :vartype schema_name: str + :ivar table_map: Mapping of source to target tables. + :vartype table_map: dict[str, str] + :ivar migration_setting: Migration settings which tune the migration behavior. + :vartype migration_setting: dict[str, str] + :ivar source_setting: Source settings to tune source endpoint migration behavior. + :vartype source_setting: dict[str, str] + :ivar target_setting: Target settings to tune target endpoint migration behavior. + :vartype target_setting: dict[str, str] """ _attribute_map = { @@ -7162,6 +9696,24 @@ def __init__( target_setting: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword id: Unique identifier for database. + :paramtype id: str + :keyword name: Name of database. + :paramtype name: str + :keyword target_database_name: Target database name. + :paramtype target_database_name: str + :keyword schema_name: Schema name to be migrated. + :paramtype schema_name: str + :keyword table_map: Mapping of source to target tables. + :paramtype table_map: dict[str, str] + :keyword migration_setting: Migration settings which tune the migration behavior. + :paramtype migration_setting: dict[str, str] + :keyword source_setting: Source settings to tune source endpoint migration behavior. + :paramtype source_setting: dict[str, str] + :keyword target_setting: Target settings to tune target endpoint migration behavior. + :paramtype target_setting: dict[str, str] + """ super(MigrateSqlServerSqlDbSyncDatabaseInput, self).__init__(**kwargs) self.id = id self.name = name @@ -7178,15 +9730,15 @@ class MigrateSqlServerSqlDbSyncTaskInput(SqlMigrationTaskInput): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar source_connection_info: Required. Information for connecting to source. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Information for connecting to target. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncDatabaseInput] - :param validation_options: Validation options. - :type validation_options: ~azure.mgmt.datamigration.models.MigrationValidationOptions + :ivar validation_options: Validation options. + :vartype validation_options: ~azure.mgmt.datamigration.models.MigrationValidationOptions """ _validation = { @@ -7211,6 +9763,17 @@ def __init__( validation_options: Optional["MigrationValidationOptions"] = None, **kwargs ): + """ + :keyword source_connection_info: Required. Information for connecting to source. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Information for connecting to target. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncDatabaseInput] + :keyword validation_options: Validation options. + :paramtype validation_options: ~azure.mgmt.datamigration.models.MigrationValidationOptions + """ super(MigrateSqlServerSqlDbSyncTaskInput, self).__init__(source_connection_info=source_connection_info, target_connection_info=target_connection_info, **kwargs) self.selected_databases = selected_databases self.validation_options = validation_options @@ -7228,8 +9791,8 @@ class MigrateSqlServerSqlDbSyncTaskOutput(msrest.serialization.Model): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -7250,6 +9813,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlDbSyncTaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -7264,12 +9829,12 @@ class MigrateSqlServerSqlDbSyncTaskOutputDatabaseError(MigrateSqlServerSqlDbSync :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str - :param error_message: Error message. - :type error_message: str - :param events: List of error events. - :type events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str + :ivar error_message: Error message. + :vartype error_message: str + :ivar events: List of error events. + :vartype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] """ _validation = { @@ -7291,6 +9856,12 @@ def __init__( events: Optional[List["SyncMigrationDatabaseErrorEvent"]] = None, **kwargs ): + """ + :keyword error_message: Error message. + :paramtype error_message: str + :keyword events: List of error events. + :paramtype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent] + """ super(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError, self).__init__(**kwargs) self.result_type = 'DatabaseLevelErrorOutput' # type: str self.error_message = error_message @@ -7306,8 +9877,8 @@ class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(MigrateSqlServerSqlDbSync :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar database_name: Name of the database. :vartype database_name: str :ivar started_on: Migration start time. @@ -7389,6 +9960,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel, self).__init__(**kwargs) self.result_type = 'DatabaseLevelOutput' # type: str self.database_name = None @@ -7417,8 +9990,8 @@ class MigrateSqlServerSqlDbSyncTaskOutputError(MigrateSqlServerSqlDbSyncTaskOutp :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar error: Migration error. :vartype error: ~azure.mgmt.datamigration.models.ReportableException """ @@ -7439,6 +10012,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlDbSyncTaskOutputError, self).__init__(**kwargs) self.result_type = 'ErrorOutput' # type: str self.error = None @@ -7453,8 +10028,8 @@ class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(MigrateSqlServerSqlDbSyn :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar started_on: Migration start time. :vartype started_on: ~datetime.datetime :ivar ended_on: Migration end time. @@ -7499,6 +10074,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel, self).__init__(**kwargs) self.result_type = 'MigrationLevelOutput' # type: str self.started_on = None @@ -7519,8 +10096,8 @@ class MigrateSqlServerSqlDbSyncTaskOutputTableLevel(MigrateSqlServerSqlDbSyncTas :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar table_name: Name of the table. :vartype table_name: str :ivar database_name: Name of the database. @@ -7590,6 +10167,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlDbSyncTaskOutputTableLevel, self).__init__(**kwargs) self.result_type = 'TableLevelOutput' # type: str self.table_name = None @@ -7614,8 +10193,25 @@ class MigrateSqlServerSqlDbSyncTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -7624,10 +10220,10 @@ class MigrateSqlServerSqlDbSyncTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncTaskOutput] """ @@ -7657,6 +10253,12 @@ def __init__( input: Optional["MigrateSqlServerSqlDbSyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncTaskInput + """ super(MigrateSqlServerSqlDbSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Migrate.SqlServer.AzureSqlDb.Sync' # type: str self.input = input @@ -7668,14 +10270,14 @@ class MigrateSqlServerSqlDbTaskInput(SqlMigrationTaskInput): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar source_connection_info: Required. Information for connecting to source. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Information for connecting to target. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbDatabaseInput] - :param validation_options: Options for enabling various post migration validations. Available + :ivar validation_options: Options for enabling various post migration validations. Available options, 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to ensure the correctness of the data. @@ -7684,7 +10286,11 @@ class MigrateSqlServerSqlDbTaskInput(SqlMigrationTaskInput): Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or Query Store and execute them and compares the execution time between the source and target database. - :type validation_options: ~azure.mgmt.datamigration.models.MigrationValidationOptions + :vartype validation_options: ~azure.mgmt.datamigration.models.MigrationValidationOptions + :ivar started_on: Date and time relative to UTC when the migration was started on. + :vartype started_on: str + :ivar encrypted_key_for_secure_fields: encrypted key for secure fields. + :vartype encrypted_key_for_secure_fields: str """ _validation = { @@ -7698,6 +10304,8 @@ class MigrateSqlServerSqlDbTaskInput(SqlMigrationTaskInput): 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSqlServerSqlDbDatabaseInput]'}, 'validation_options': {'key': 'validationOptions', 'type': 'MigrationValidationOptions'}, + 'started_on': {'key': 'startedOn', 'type': 'str'}, + 'encrypted_key_for_secure_fields': {'key': 'encryptedKeyForSecureFields', 'type': 'str'}, } def __init__( @@ -7707,11 +10315,38 @@ def __init__( target_connection_info: "SqlConnectionInfo", selected_databases: List["MigrateSqlServerSqlDbDatabaseInput"], validation_options: Optional["MigrationValidationOptions"] = None, - **kwargs - ): + started_on: Optional[str] = None, + encrypted_key_for_secure_fields: Optional[str] = None, + **kwargs + ): + """ + :keyword source_connection_info: Required. Information for connecting to source. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Information for connecting to target. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbDatabaseInput] + :keyword validation_options: Options for enabling various post migration validations. Available + options, + 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables + after the migration to ensure the correctness of the data. + 2.) Schema Validation: Performs a thorough schema comparison between the source and target + tables and provides a list of differences between the source and target database, 3.) Query + Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or + Query Store and execute them and compares the execution time between the source and target + database. + :paramtype validation_options: ~azure.mgmt.datamigration.models.MigrationValidationOptions + :keyword started_on: Date and time relative to UTC when the migration was started on. + :paramtype started_on: str + :keyword encrypted_key_for_secure_fields: encrypted key for secure fields. + :paramtype encrypted_key_for_secure_fields: str + """ super(MigrateSqlServerSqlDbTaskInput, self).__init__(source_connection_info=source_connection_info, target_connection_info=target_connection_info, **kwargs) self.selected_databases = selected_databases self.validation_options = validation_options + self.started_on = started_on + self.encrypted_key_for_secure_fields = encrypted_key_for_secure_fields class MigrateSqlServerSqlDbTaskOutput(msrest.serialization.Model): @@ -7726,8 +10361,8 @@ class MigrateSqlServerSqlDbTaskOutput(msrest.serialization.Model): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -7748,6 +10383,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlDbTaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -7762,8 +10399,8 @@ class MigrateSqlServerSqlDbTaskOutputDatabaseLevel(MigrateSqlServerSqlDbTaskOutp :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar database_name: Name of the item. :vartype database_name: str :ivar started_on: Migration start time. @@ -7839,6 +10476,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlDbTaskOutputDatabaseLevel, self).__init__(**kwargs) self.result_type = 'DatabaseLevelOutput' # type: str self.database_name = None @@ -7922,6 +10561,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrationValidationDatabaseLevelResult, self).__init__(**kwargs) self.id = None self.migration_id = None @@ -7970,8 +10611,8 @@ class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(MigrateSqlSer :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -8006,6 +10647,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult, self).__init__(**kwargs) self.migration_id = None self.source_database_name = None @@ -8030,8 +10673,8 @@ class MigrateSqlServerSqlDbTaskOutputError(MigrateSqlServerSqlDbTaskOutput): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar error: Migration error. :vartype error: ~azure.mgmt.datamigration.models.ReportableException """ @@ -8052,6 +10695,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlDbTaskOutputError, self).__init__(**kwargs) self.result_type = 'ErrorOutput' # type: str self.error = None @@ -8066,8 +10711,8 @@ class MigrateSqlServerSqlDbTaskOutputMigrationLevel(MigrateSqlServerSqlDbTaskOut :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar started_on: Migration start time. :vartype started_on: ~datetime.datetime :ivar ended_on: Migration end time. @@ -8086,11 +10731,12 @@ class MigrateSqlServerSqlDbTaskOutputMigrationLevel(MigrateSqlServerSqlDbTaskOut :vartype databases: str :ivar database_summary: Summary of database results in the migration. :vartype database_summary: str - :param migration_validation_result: Migration Validation Results. - :type migration_validation_result: ~azure.mgmt.datamigration.models.MigrationValidationResult - :param migration_report_result: Migration Report Result, provides unique url for downloading + :ivar migration_validation_result: Migration Validation Results. + :vartype migration_validation_result: + ~azure.mgmt.datamigration.models.MigrationValidationResult + :ivar migration_report_result: Migration Report Result, provides unique url for downloading your migration report. - :type migration_report_result: ~azure.mgmt.datamigration.models.MigrationReportResult + :vartype migration_report_result: ~azure.mgmt.datamigration.models.MigrationReportResult :ivar source_server_version: Source server version. :vartype source_server_version: str :ivar source_server_brand_version: Source server brand version. @@ -8148,6 +10794,14 @@ def __init__( migration_report_result: Optional["MigrationReportResult"] = None, **kwargs ): + """ + :keyword migration_validation_result: Migration Validation Results. + :paramtype migration_validation_result: + ~azure.mgmt.datamigration.models.MigrationValidationResult + :keyword migration_report_result: Migration Report Result, provides unique url for downloading + your migration report. + :paramtype migration_report_result: ~azure.mgmt.datamigration.models.MigrationReportResult + """ super(MigrateSqlServerSqlDbTaskOutputMigrationLevel, self).__init__(**kwargs) self.result_type = 'MigrationLevelOutput' # type: str self.started_on = None @@ -8176,8 +10830,8 @@ class MigrateSqlServerSqlDbTaskOutputTableLevel(MigrateSqlServerSqlDbTaskOutput) :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar object_name: Name of the item. :vartype object_name: str :ivar started_on: Migration start time. @@ -8232,6 +10886,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlDbTaskOutputTableLevel, self).__init__(**kwargs) self.result_type = 'TableLevelOutput' # type: str self.object_name = None @@ -8254,8 +10910,8 @@ class MigrationValidationResult(msrest.serialization.Model): :vartype id: str :ivar migration_id: Migration Identifier. :vartype migration_id: str - :param summary_results: Validation summary results for each database. - :type summary_results: dict[str, + :ivar summary_results: Validation summary results for each database. + :vartype summary_results: dict[str, ~azure.mgmt.datamigration.models.MigrationValidationDatabaseSummaryResult] :ivar status: Current status of validation at the migration level. Status from the database validation result status will be aggregated here. Possible values include: "Default", @@ -8283,6 +10939,11 @@ def __init__( summary_results: Optional[Dict[str, "MigrationValidationDatabaseSummaryResult"]] = None, **kwargs ): + """ + :keyword summary_results: Validation summary results for each database. + :paramtype summary_results: dict[str, + ~azure.mgmt.datamigration.models.MigrationValidationDatabaseSummaryResult] + """ super(MigrationValidationResult, self).__init__(**kwargs) self.id = None self.migration_id = None @@ -8299,8 +10960,8 @@ class MigrateSqlServerSqlDbTaskOutputValidationResult(MigrateSqlServerSqlDbTaskO :ivar migration_id: Migration Identifier. :vartype migration_id: str - :param summary_results: Validation summary results for each database. - :type summary_results: dict[str, + :ivar summary_results: Validation summary results for each database. + :vartype summary_results: dict[str, ~azure.mgmt.datamigration.models.MigrationValidationDatabaseSummaryResult] :ivar status: Current status of validation at the migration level. Status from the database validation result status will be aggregated here. Possible values include: "Default", @@ -8309,8 +10970,8 @@ class MigrateSqlServerSqlDbTaskOutputValidationResult(MigrateSqlServerSqlDbTaskO :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -8334,6 +10995,11 @@ def __init__( summary_results: Optional[Dict[str, "MigrationValidationDatabaseSummaryResult"]] = None, **kwargs ): + """ + :keyword summary_results: Validation summary results for each database. + :paramtype summary_results: dict[str, + ~azure.mgmt.datamigration.models.MigrationValidationDatabaseSummaryResult] + """ super(MigrateSqlServerSqlDbTaskOutputValidationResult, self).__init__(summary_results=summary_results, **kwargs) self.migration_id = None self.summary_results = summary_results @@ -8350,8 +11016,25 @@ class MigrateSqlServerSqlDbTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -8360,12 +11043,18 @@ class MigrateSqlServerSqlDbTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbTaskOutput] + :ivar task_id: task id. + :vartype task_id: str + :ivar is_cloneable: whether the task can be cloned or not. + :vartype is_cloneable: bool + :ivar created_on: DateTime in UTC when the task was created. + :vartype created_on: str """ _validation = { @@ -8384,6 +11073,9 @@ class MigrateSqlServerSqlDbTaskProperties(ProjectTaskProperties): 'client_data': {'key': 'clientData', 'type': '{str}'}, 'input': {'key': 'input', 'type': 'MigrateSqlServerSqlDbTaskInput'}, 'output': {'key': 'output', 'type': '[MigrateSqlServerSqlDbTaskOutput]'}, + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'is_cloneable': {'key': 'isCloneable', 'type': 'bool'}, + 'created_on': {'key': 'createdOn', 'type': 'str'}, } def __init__( @@ -8391,12 +11083,30 @@ def __init__( *, client_data: Optional[Dict[str, str]] = None, input: Optional["MigrateSqlServerSqlDbTaskInput"] = None, - **kwargs - ): + task_id: Optional[str] = None, + is_cloneable: Optional[bool] = None, + created_on: Optional[str] = None, + **kwargs + ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbTaskInput + :keyword task_id: task id. + :paramtype task_id: str + :keyword is_cloneable: whether the task can be cloned or not. + :paramtype is_cloneable: bool + :keyword created_on: DateTime in UTC when the task was created. + :paramtype created_on: str + """ super(MigrateSqlServerSqlDbTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Migrate.SqlServer.SqlDb' # type: str self.input = input self.output = None + self.task_id = task_id + self.is_cloneable = is_cloneable + self.created_on = created_on class MigrateSqlServerSqlMIDatabaseInput(msrest.serialization.Model): @@ -8404,14 +11114,16 @@ class MigrateSqlServerSqlMIDatabaseInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the database. - :type name: str - :param restore_database_name: Required. Name of the database at destination. - :type restore_database_name: str - :param backup_file_share: Backup file share information for backing up this database. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param backup_file_paths: The list of backup files to be used in case of existing backups. - :type backup_file_paths: list[str] + :ivar name: Required. Name of the database. + :vartype name: str + :ivar restore_database_name: Required. Name of the database at destination. + :vartype restore_database_name: str + :ivar backup_file_share: Backup file share information for backing up this database. + :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :ivar backup_file_paths: The list of backup files to be used in case of existing backups. + :vartype backup_file_paths: list[str] + :ivar id: id of the database. + :vartype id: str """ _validation = { @@ -8424,6 +11136,7 @@ class MigrateSqlServerSqlMIDatabaseInput(msrest.serialization.Model): 'restore_database_name': {'key': 'restoreDatabaseName', 'type': 'str'}, 'backup_file_share': {'key': 'backupFileShare', 'type': 'FileShare'}, 'backup_file_paths': {'key': 'backupFilePaths', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( @@ -8433,13 +11146,27 @@ def __init__( restore_database_name: str, backup_file_share: Optional["FileShare"] = None, backup_file_paths: Optional[List[str]] = None, + id: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. Name of the database. + :paramtype name: str + :keyword restore_database_name: Required. Name of the database at destination. + :paramtype restore_database_name: str + :keyword backup_file_share: Backup file share information for backing up this database. + :paramtype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :keyword backup_file_paths: The list of backup files to be used in case of existing backups. + :paramtype backup_file_paths: list[str] + :keyword id: id of the database. + :paramtype id: str + """ super(MigrateSqlServerSqlMIDatabaseInput, self).__init__(**kwargs) self.name = name self.restore_database_name = restore_database_name self.backup_file_share = backup_file_share self.backup_file_paths = backup_file_paths + self.id = id class SqlServerSqlMISyncTaskInput(msrest.serialization.Model): @@ -8447,22 +11174,22 @@ class SqlServerSqlMISyncTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] - :param backup_file_share: Backup file share information for all selected databases. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param storage_resource_id: Required. Fully qualified resourceId of storage. - :type storage_resource_id: str - :param source_connection_info: Required. Connection information for source SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Connection information for Azure SQL Database Managed + :ivar backup_file_share: Backup file share information for all selected databases. + :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :ivar storage_resource_id: Required. Fully qualified resourceId of storage. + :vartype storage_resource_id: str + :ivar source_connection_info: Required. Connection information for source SQL Server. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Connection information for Azure SQL Database Managed Instance. - :type target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo - :param azure_app: Required. Azure Active Directory Application the DMS instance will use to + :vartype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo + :ivar azure_app: Required. Azure Active Directory Application the DMS instance will use to connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage Account. - :type azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + :vartype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp """ _validation = { @@ -8493,6 +11220,24 @@ def __init__( backup_file_share: Optional["FileShare"] = None, **kwargs ): + """ + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] + :keyword backup_file_share: Backup file share information for all selected databases. + :paramtype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :keyword storage_resource_id: Required. Fully qualified resourceId of storage. + :paramtype storage_resource_id: str + :keyword source_connection_info: Required. Connection information for source SQL Server. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Connection information for Azure SQL Database + Managed Instance. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo + :keyword azure_app: Required. Azure Active Directory Application the DMS instance will use to + connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage + Account. + :paramtype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + """ super(SqlServerSqlMISyncTaskInput, self).__init__(**kwargs) self.selected_databases = selected_databases self.backup_file_share = backup_file_share @@ -8507,22 +11252,25 @@ class MigrateSqlServerSqlMISyncTaskInput(SqlServerSqlMISyncTaskInput): All required parameters must be populated in order to send to Azure. - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] - :param backup_file_share: Backup file share information for all selected databases. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param storage_resource_id: Required. Fully qualified resourceId of storage. - :type storage_resource_id: str - :param source_connection_info: Required. Connection information for source SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Connection information for Azure SQL Database Managed + :ivar backup_file_share: Backup file share information for all selected databases. + :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :ivar storage_resource_id: Required. Fully qualified resourceId of storage. + :vartype storage_resource_id: str + :ivar source_connection_info: Required. Connection information for source SQL Server. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Connection information for Azure SQL Database Managed Instance. - :type target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo - :param azure_app: Required. Azure Active Directory Application the DMS instance will use to + :vartype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo + :ivar azure_app: Required. Azure Active Directory Application the DMS instance will use to connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage Account. - :type azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + :vartype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + :ivar number_of_parallel_database_migrations: Number of database migrations to start in + parallel. + :vartype number_of_parallel_database_migrations: float """ _validation = { @@ -8540,6 +11288,7 @@ class MigrateSqlServerSqlMISyncTaskInput(SqlServerSqlMISyncTaskInput): 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'MiSqlConnectionInfo'}, 'azure_app': {'key': 'azureApp', 'type': 'AzureActiveDirectoryApp'}, + 'number_of_parallel_database_migrations': {'key': 'numberOfParallelDatabaseMigrations', 'type': 'float'}, } def __init__( @@ -8551,9 +11300,32 @@ def __init__( target_connection_info: "MiSqlConnectionInfo", azure_app: "AzureActiveDirectoryApp", backup_file_share: Optional["FileShare"] = None, - **kwargs - ): + number_of_parallel_database_migrations: Optional[float] = None, + **kwargs + ): + """ + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] + :keyword backup_file_share: Backup file share information for all selected databases. + :paramtype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :keyword storage_resource_id: Required. Fully qualified resourceId of storage. + :paramtype storage_resource_id: str + :keyword source_connection_info: Required. Connection information for source SQL Server. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Connection information for Azure SQL Database + Managed Instance. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo + :keyword azure_app: Required. Azure Active Directory Application the DMS instance will use to + connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage + Account. + :paramtype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + :keyword number_of_parallel_database_migrations: Number of database migrations to start in + parallel. + :paramtype number_of_parallel_database_migrations: float + """ super(MigrateSqlServerSqlMISyncTaskInput, self).__init__(selected_databases=selected_databases, backup_file_share=backup_file_share, storage_resource_id=storage_resource_id, source_connection_info=source_connection_info, target_connection_info=target_connection_info, azure_app=azure_app, **kwargs) + self.number_of_parallel_database_migrations = number_of_parallel_database_migrations class MigrateSqlServerSqlMISyncTaskOutput(msrest.serialization.Model): @@ -8568,8 +11340,8 @@ class MigrateSqlServerSqlMISyncTaskOutput(msrest.serialization.Model): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -8590,6 +11362,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlMISyncTaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -8604,8 +11378,8 @@ class MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel(MigrateSqlServerSqlMISync :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar source_database_name: Name of the database. :vartype source_database_name: str :ivar migration_state: Current state of database. Possible values include: "UNDEFINED", @@ -8671,6 +11445,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel, self).__init__(**kwargs) self.result_type = 'DatabaseLevelOutput' # type: str self.source_database_name = None @@ -8695,8 +11471,8 @@ class MigrateSqlServerSqlMISyncTaskOutputError(MigrateSqlServerSqlMISyncTaskOutp :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar error: Migration error. :vartype error: ~azure.mgmt.datamigration.models.ReportableException """ @@ -8717,6 +11493,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlMISyncTaskOutputError, self).__init__(**kwargs) self.result_type = 'ErrorOutput' # type: str self.error = None @@ -8731,8 +11509,8 @@ class MigrateSqlServerSqlMISyncTaskOutputMigrationLevel(MigrateSqlServerSqlMISyn :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar database_count: Count of databases. :vartype database_count: int :ivar state: Current state of migration. Possible values include: "None", "InProgress", @@ -8794,6 +11572,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlMISyncTaskOutputMigrationLevel, self).__init__(**kwargs) self.result_type = 'MigrationLevelOutput' # type: str self.database_count = None @@ -8816,8 +11596,25 @@ class MigrateSqlServerSqlMISyncTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -8826,12 +11623,14 @@ class MigrateSqlServerSqlMISyncTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlMISyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlMISyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMISyncTaskOutput] + :ivar created_on: DateTime in UTC when the task was created. + :vartype created_on: str """ _validation = { @@ -8850,6 +11649,7 @@ class MigrateSqlServerSqlMISyncTaskProperties(ProjectTaskProperties): 'client_data': {'key': 'clientData', 'type': '{str}'}, 'input': {'key': 'input', 'type': 'MigrateSqlServerSqlMISyncTaskInput'}, 'output': {'key': 'output', 'type': '[MigrateSqlServerSqlMISyncTaskOutput]'}, + 'created_on': {'key': 'createdOn', 'type': 'str'}, } def __init__( @@ -8857,12 +11657,22 @@ def __init__( *, client_data: Optional[Dict[str, str]] = None, input: Optional["MigrateSqlServerSqlMISyncTaskInput"] = None, + created_on: Optional[str] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlMISyncTaskInput + :keyword created_on: DateTime in UTC when the task was created. + :paramtype created_on: str + """ super(MigrateSqlServerSqlMISyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Migrate.SqlServer.AzureSqlDbMI.Sync.LRS' # type: str self.input = input self.output = None + self.created_on = created_on class MigrateSqlServerSqlMITaskInput(SqlMigrationTaskInput): @@ -8870,30 +11680,34 @@ class MigrateSqlServerSqlMITaskInput(SqlMigrationTaskInput): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar source_connection_info: Required. Information for connecting to source. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Information for connecting to target. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] - :param selected_logins: Logins to migrate. - :type selected_logins: list[str] - :param selected_agent_jobs: Agent Jobs to migrate. - :type selected_agent_jobs: list[str] - :param backup_file_share: Backup file share information for all selected databases. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param backup_blob_share: Required. SAS URI of Azure Storage Account Container to be used for + :ivar started_on: Date and time relative to UTC when the migration was started on. + :vartype started_on: str + :ivar selected_logins: Logins to migrate. + :vartype selected_logins: list[str] + :ivar selected_agent_jobs: Agent Jobs to migrate. + :vartype selected_agent_jobs: list[str] + :ivar backup_file_share: Backup file share information for all selected databases. + :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :ivar backup_blob_share: Required. SAS URI of Azure Storage Account Container to be used for storing backup files. - :type backup_blob_share: ~azure.mgmt.datamigration.models.BlobShare - :param backup_mode: Backup Mode to specify whether to use existing backup or create new backup. + :vartype backup_blob_share: ~azure.mgmt.datamigration.models.BlobShare + :ivar backup_mode: Backup Mode to specify whether to use existing backup or create new backup. If using existing backups, backup file paths are required to be provided in selectedDatabases. Possible values include: "CreateBackup", "ExistingBackup". - :type backup_mode: str or ~azure.mgmt.datamigration.models.BackupMode - :param aad_domain_name: Azure Active Directory domain name in the format of 'contoso.com' for + :vartype backup_mode: str or ~azure.mgmt.datamigration.models.BackupMode + :ivar aad_domain_name: Azure Active Directory domain name in the format of 'contoso.com' for federated Azure AD or 'contoso.onmicrosoft.com' for managed domain, required if and only if Windows logins are selected. - :type aad_domain_name: str + :vartype aad_domain_name: str + :ivar encrypted_key_for_secure_fields: encrypted key for secure fields. + :vartype encrypted_key_for_secure_fields: str """ _validation = { @@ -8907,12 +11721,14 @@ class MigrateSqlServerSqlMITaskInput(SqlMigrationTaskInput): 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, 'target_connection_info': {'key': 'targetConnectionInfo', 'type': 'SqlConnectionInfo'}, 'selected_databases': {'key': 'selectedDatabases', 'type': '[MigrateSqlServerSqlMIDatabaseInput]'}, + 'started_on': {'key': 'startedOn', 'type': 'str'}, 'selected_logins': {'key': 'selectedLogins', 'type': '[str]'}, 'selected_agent_jobs': {'key': 'selectedAgentJobs', 'type': '[str]'}, 'backup_file_share': {'key': 'backupFileShare', 'type': 'FileShare'}, 'backup_blob_share': {'key': 'backupBlobShare', 'type': 'BlobShare'}, 'backup_mode': {'key': 'backupMode', 'type': 'str'}, 'aad_domain_name': {'key': 'aadDomainName', 'type': 'str'}, + 'encrypted_key_for_secure_fields': {'key': 'encryptedKeyForSecureFields', 'type': 'str'}, } def __init__( @@ -8922,21 +11738,55 @@ def __init__( target_connection_info: "SqlConnectionInfo", selected_databases: List["MigrateSqlServerSqlMIDatabaseInput"], backup_blob_share: "BlobShare", + started_on: Optional[str] = None, selected_logins: Optional[List[str]] = None, selected_agent_jobs: Optional[List[str]] = None, backup_file_share: Optional["FileShare"] = None, backup_mode: Optional[Union[str, "BackupMode"]] = None, aad_domain_name: Optional[str] = None, - **kwargs - ): + encrypted_key_for_secure_fields: Optional[str] = None, + **kwargs + ): + """ + :keyword source_connection_info: Required. Information for connecting to source. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Information for connecting to target. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] + :keyword started_on: Date and time relative to UTC when the migration was started on. + :paramtype started_on: str + :keyword selected_logins: Logins to migrate. + :paramtype selected_logins: list[str] + :keyword selected_agent_jobs: Agent Jobs to migrate. + :paramtype selected_agent_jobs: list[str] + :keyword backup_file_share: Backup file share information for all selected databases. + :paramtype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :keyword backup_blob_share: Required. SAS URI of Azure Storage Account Container to be used for + storing backup files. + :paramtype backup_blob_share: ~azure.mgmt.datamigration.models.BlobShare + :keyword backup_mode: Backup Mode to specify whether to use existing backup or create new + backup. If using existing backups, backup file paths are required to be provided in + selectedDatabases. Possible values include: "CreateBackup", "ExistingBackup". + :paramtype backup_mode: str or ~azure.mgmt.datamigration.models.BackupMode + :keyword aad_domain_name: Azure Active Directory domain name in the format of 'contoso.com' for + federated Azure AD or 'contoso.onmicrosoft.com' for managed domain, required if and only if + Windows logins are selected. + :paramtype aad_domain_name: str + :keyword encrypted_key_for_secure_fields: encrypted key for secure fields. + :paramtype encrypted_key_for_secure_fields: str + """ super(MigrateSqlServerSqlMITaskInput, self).__init__(source_connection_info=source_connection_info, target_connection_info=target_connection_info, **kwargs) self.selected_databases = selected_databases + self.started_on = started_on self.selected_logins = selected_logins self.selected_agent_jobs = selected_agent_jobs self.backup_file_share = backup_file_share self.backup_blob_share = backup_blob_share self.backup_mode = backup_mode self.aad_domain_name = aad_domain_name + self.encrypted_key_for_secure_fields = encrypted_key_for_secure_fields class MigrateSqlServerSqlMITaskOutput(msrest.serialization.Model): @@ -8951,8 +11801,8 @@ class MigrateSqlServerSqlMITaskOutput(msrest.serialization.Model): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -8973,6 +11823,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlMITaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -8987,8 +11839,8 @@ class MigrateSqlServerSqlMITaskOutputAgentJobLevel(MigrateSqlServerSqlMITaskOutp :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar name: Agent Job name. :vartype name: str :ivar is_enabled: The state of the original Agent Job. @@ -9034,6 +11886,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlMITaskOutputAgentJobLevel, self).__init__(**kwargs) self.result_type = 'AgentJobLevelOutput' # type: str self.name = None @@ -9054,8 +11908,8 @@ class MigrateSqlServerSqlMITaskOutputDatabaseLevel(MigrateSqlServerSqlMITaskOutp :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar database_name: Name of the database. :vartype database_name: str :ivar size_mb: Size of the database in megabytes. @@ -9106,6 +11960,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlMITaskOutputDatabaseLevel, self).__init__(**kwargs) self.result_type = 'DatabaseLevelOutput' # type: str self.database_name = None @@ -9127,8 +11983,8 @@ class MigrateSqlServerSqlMITaskOutputError(MigrateSqlServerSqlMITaskOutput): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar error: Migration error. :vartype error: ~azure.mgmt.datamigration.models.ReportableException """ @@ -9149,6 +12005,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlMITaskOutputError, self).__init__(**kwargs) self.result_type = 'ErrorOutput' # type: str self.error = None @@ -9163,8 +12021,8 @@ class MigrateSqlServerSqlMITaskOutputLoginLevel(MigrateSqlServerSqlMITaskOutput) :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar login_name: Login name. :vartype login_name: str :ivar state: Current state of login. Possible values include: "None", "InProgress", "Failed", @@ -9212,6 +12070,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlMITaskOutputLoginLevel, self).__init__(**kwargs) self.result_type = 'LoginLevelOutput' # type: str self.login_name = None @@ -9232,8 +12092,8 @@ class MigrateSqlServerSqlMITaskOutputMigrationLevel(MigrateSqlServerSqlMITaskOut :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar started_on: Migration start time. :vartype started_on: ~datetime.datetime :ivar ended_on: Migration end time. @@ -9313,6 +12173,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSqlServerSqlMITaskOutputMigrationLevel, self).__init__(**kwargs) self.result_type = 'MigrationLevelOutput' # type: str self.started_on = None @@ -9339,8 +12201,25 @@ class MigrateSqlServerSqlMITaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -9349,12 +12228,20 @@ class MigrateSqlServerSqlMITaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlMITaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlMITaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMITaskOutput] + :ivar task_id: task id. + :vartype task_id: str + :ivar created_on: DateTime in UTC when the task was created. + :vartype created_on: str + :ivar parent_task_id: parent task id. + :vartype parent_task_id: str + :ivar is_cloneable: whether the task can be cloned or not. + :vartype is_cloneable: bool """ _validation = { @@ -9373,6 +12260,10 @@ class MigrateSqlServerSqlMITaskProperties(ProjectTaskProperties): 'client_data': {'key': 'clientData', 'type': '{str}'}, 'input': {'key': 'input', 'type': 'MigrateSqlServerSqlMITaskInput'}, 'output': {'key': 'output', 'type': '[MigrateSqlServerSqlMITaskOutput]'}, + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'created_on': {'key': 'createdOn', 'type': 'str'}, + 'parent_task_id': {'key': 'parentTaskId', 'type': 'str'}, + 'is_cloneable': {'key': 'isCloneable', 'type': 'bool'}, } def __init__( @@ -9380,12 +12271,34 @@ def __init__( *, client_data: Optional[Dict[str, str]] = None, input: Optional["MigrateSqlServerSqlMITaskInput"] = None, - **kwargs - ): + task_id: Optional[str] = None, + created_on: Optional[str] = None, + parent_task_id: Optional[str] = None, + is_cloneable: Optional[bool] = None, + **kwargs + ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlMITaskInput + :keyword task_id: task id. + :paramtype task_id: str + :keyword created_on: DateTime in UTC when the task was created. + :paramtype created_on: str + :keyword parent_task_id: parent task id. + :paramtype parent_task_id: str + :keyword is_cloneable: whether the task can be cloned or not. + :paramtype is_cloneable: bool + """ super(MigrateSqlServerSqlMITaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Migrate.SqlServer.AzureSqlDbMI' # type: str self.input = input self.output = None + self.task_id = task_id + self.created_on = created_on + self.parent_task_id = parent_task_id + self.is_cloneable = is_cloneable class MigrateSsisTaskInput(SqlMigrationTaskInput): @@ -9393,12 +12306,12 @@ class MigrateSsisTaskInput(SqlMigrationTaskInput): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param ssis_migration_info: Required. SSIS package migration information. - :type ssis_migration_info: ~azure.mgmt.datamigration.models.SsisMigrationInfo + :ivar source_connection_info: Required. Information for connecting to source. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Information for connecting to target. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar ssis_migration_info: Required. SSIS package migration information. + :vartype ssis_migration_info: ~azure.mgmt.datamigration.models.SsisMigrationInfo """ _validation = { @@ -9421,6 +12334,14 @@ def __init__( ssis_migration_info: "SsisMigrationInfo", **kwargs ): + """ + :keyword source_connection_info: Required. Information for connecting to source. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Information for connecting to target. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword ssis_migration_info: Required. SSIS package migration information. + :paramtype ssis_migration_info: ~azure.mgmt.datamigration.models.SsisMigrationInfo + """ super(MigrateSsisTaskInput, self).__init__(source_connection_info=source_connection_info, target_connection_info=target_connection_info, **kwargs) self.ssis_migration_info = ssis_migration_info @@ -9437,8 +12358,8 @@ class MigrateSsisTaskOutput(msrest.serialization.Model): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str """ _validation = { @@ -9459,6 +12380,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSsisTaskOutput, self).__init__(**kwargs) self.id = None self.result_type = None # type: Optional[str] @@ -9473,8 +12396,8 @@ class MigrateSsisTaskOutputMigrationLevel(MigrateSsisTaskOutput): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar started_on: Migration start time. :vartype started_on: ~datetime.datetime :ivar ended_on: Migration end time. @@ -9534,6 +12457,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSsisTaskOutputMigrationLevel, self).__init__(**kwargs) self.result_type = 'MigrationLevelOutput' # type: str self.started_on = None @@ -9557,8 +12482,8 @@ class MigrateSsisTaskOutputProjectLevel(MigrateSsisTaskOutput): :ivar id: Result identifier. :vartype id: str - :param result_type: Required. Result type.Constant filled by server. - :type result_type: str + :ivar result_type: Required. Result type.Constant filled by server. + :vartype result_type: str :ivar folder_name: Name of the folder. :vartype folder_name: str :ivar project_name: Name of the project. @@ -9609,6 +12534,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSsisTaskOutputProjectLevel, self).__init__(**kwargs) self.result_type = 'SsisProjectLevelOutput' # type: str self.folder_name = None @@ -9628,8 +12555,25 @@ class MigrateSsisTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -9638,10 +12582,10 @@ class MigrateSsisTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.MigrateSsisTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateSsisTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.MigrateSsisTaskOutput] """ @@ -9671,6 +12615,12 @@ def __init__( input: Optional["MigrateSsisTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateSsisTaskInput + """ super(MigrateSsisTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Migrate.Ssis' # type: str self.input = input @@ -9682,10 +12632,10 @@ class MigrateSyncCompleteCommandInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param database_name: Required. Name of database. - :type database_name: str - :param commit_time_stamp: Time stamp to complete. - :type commit_time_stamp: ~datetime.datetime + :ivar database_name: Required. Name of database. + :vartype database_name: str + :ivar commit_time_stamp: Time stamp to complete. + :vartype commit_time_stamp: ~datetime.datetime """ _validation = { @@ -9704,6 +12654,12 @@ def __init__( commit_time_stamp: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword database_name: Required. Name of database. + :paramtype database_name: str + :keyword commit_time_stamp: Time stamp to complete. + :paramtype commit_time_stamp: ~datetime.datetime + """ super(MigrateSyncCompleteCommandInput, self).__init__(**kwargs) self.database_name = database_name self.commit_time_stamp = commit_time_stamp @@ -9734,6 +12690,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateSyncCompleteCommandOutput, self).__init__(**kwargs) self.id = None self.errors = None @@ -9746,17 +12704,21 @@ class MigrateSyncCompleteCommandProperties(CommandProperties): All required parameters must be populated in order to send to Azure. - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str + :ivar command_type: Required. Command type.Constant filled by server. Possible values include: + "Migrate.Sync.Complete.Database", "Migrate.SqlServer.AzureDbSqlMi.Complete", "cancel", + "finish", "restart". + :vartype command_type: str or ~azure.mgmt.datamigration.models.CommandType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the command. This is ignored if submitted. Possible values include: "Unknown", "Accepted", "Running", "Succeeded", "Failed". :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - :param input: Command input. - :type input: ~azure.mgmt.datamigration.models.MigrateSyncCompleteCommandInput + :ivar input: Command input. + :vartype input: ~azure.mgmt.datamigration.models.MigrateSyncCompleteCommandInput :ivar output: Command output. This is ignored if submitted. :vartype output: ~azure.mgmt.datamigration.models.MigrateSyncCompleteCommandOutput + :ivar command_id: Command id. + :vartype command_id: str """ _validation = { @@ -9772,18 +12734,27 @@ class MigrateSyncCompleteCommandProperties(CommandProperties): 'state': {'key': 'state', 'type': 'str'}, 'input': {'key': 'input', 'type': 'MigrateSyncCompleteCommandInput'}, 'output': {'key': 'output', 'type': 'MigrateSyncCompleteCommandOutput'}, + 'command_id': {'key': 'commandId', 'type': 'str'}, } def __init__( self, *, input: Optional["MigrateSyncCompleteCommandInput"] = None, + command_id: Optional[str] = None, **kwargs ): + """ + :keyword input: Command input. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateSyncCompleteCommandInput + :keyword command_id: Command id. + :paramtype command_id: str + """ super(MigrateSyncCompleteCommandProperties, self).__init__(**kwargs) self.command_type = 'Migrate.Sync.Complete.Database' # type: str self.input = input self.output = None + self.command_id = command_id class MigrationEligibilityInfo(msrest.serialization.Model): @@ -9811,18 +12782,45 @@ def __init__( self, **kwargs ): + """ + """ super(MigrationEligibilityInfo, self).__init__(**kwargs) self.is_eligible_for_migration = None self.validation_messages = None +class MigrationOperationInput(msrest.serialization.Model): + """Migration Operation Input. + + :ivar migration_operation_id: ID tracking migration operation. + :vartype migration_operation_id: str + """ + + _attribute_map = { + 'migration_operation_id': {'key': 'migrationOperationId', 'type': 'str'}, + } + + def __init__( + self, + *, + migration_operation_id: Optional[str] = None, + **kwargs + ): + """ + :keyword migration_operation_id: ID tracking migration operation. + :paramtype migration_operation_id: str + """ + super(MigrationOperationInput, self).__init__(**kwargs) + self.migration_operation_id = migration_operation_id + + class MigrationReportResult(msrest.serialization.Model): """Migration validation report result, contains the url for downloading the generated report. - :param id: Migration validation result identifier. - :type id: str - :param report_url: The url of the report. - :type report_url: str + :ivar id: Migration validation result identifier. + :vartype id: str + :ivar report_url: The url of the report. + :vartype report_url: str """ _attribute_map = { @@ -9837,11 +12835,105 @@ def __init__( report_url: Optional[str] = None, **kwargs ): + """ + :keyword id: Migration validation result identifier. + :paramtype id: str + :keyword report_url: The url of the report. + :paramtype report_url: str + """ super(MigrationReportResult, self).__init__(**kwargs) self.id = id self.report_url = report_url +class MigrationStatusDetails(msrest.serialization.Model): + """Detailed status of current migration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar migration_state: Current State of Migration. + :vartype migration_state: str + :ivar full_backup_set_info: Details of full backup set. + :vartype full_backup_set_info: ~azure.mgmt.datamigration.models.SqlBackupSetInfo + :ivar last_restored_backup_set_info: Last applied backup set information. + :vartype last_restored_backup_set_info: ~azure.mgmt.datamigration.models.SqlBackupSetInfo + :ivar active_backup_sets: Backup sets that are currently active. + :vartype active_backup_sets: list[~azure.mgmt.datamigration.models.SqlBackupSetInfo] + :ivar invalid_files: Files that are not valid backup files. + :vartype invalid_files: list[str] + :ivar blob_container_name: Name of blob container. + :vartype blob_container_name: str + :ivar is_full_backup_restored: Whether full backup has been applied to the target database or + not. + :vartype is_full_backup_restored: bool + :ivar restore_blocking_reason: Restore blocking reason, if any. + :vartype restore_blocking_reason: str + :ivar complete_restore_error_message: Complete restore error message, if any. + :vartype complete_restore_error_message: str + :ivar file_upload_blocking_errors: File upload blocking errors, if any. + :vartype file_upload_blocking_errors: list[str] + :ivar current_restoring_filename: File name that is currently being restored. + :vartype current_restoring_filename: str + :ivar last_restored_filename: Last restored file name. + :vartype last_restored_filename: str + :ivar pending_log_backups_count: Total pending log backups. + :vartype pending_log_backups_count: int + """ + + _validation = { + 'migration_state': {'readonly': True}, + 'full_backup_set_info': {'readonly': True}, + 'last_restored_backup_set_info': {'readonly': True}, + 'active_backup_sets': {'readonly': True}, + 'invalid_files': {'readonly': True}, + 'blob_container_name': {'readonly': True}, + 'is_full_backup_restored': {'readonly': True}, + 'restore_blocking_reason': {'readonly': True}, + 'complete_restore_error_message': {'readonly': True}, + 'file_upload_blocking_errors': {'readonly': True}, + 'current_restoring_filename': {'readonly': True}, + 'last_restored_filename': {'readonly': True}, + 'pending_log_backups_count': {'readonly': True}, + } + + _attribute_map = { + 'migration_state': {'key': 'migrationState', 'type': 'str'}, + 'full_backup_set_info': {'key': 'fullBackupSetInfo', 'type': 'SqlBackupSetInfo'}, + 'last_restored_backup_set_info': {'key': 'lastRestoredBackupSetInfo', 'type': 'SqlBackupSetInfo'}, + 'active_backup_sets': {'key': 'activeBackupSets', 'type': '[SqlBackupSetInfo]'}, + 'invalid_files': {'key': 'invalidFiles', 'type': '[str]'}, + 'blob_container_name': {'key': 'blobContainerName', 'type': 'str'}, + 'is_full_backup_restored': {'key': 'isFullBackupRestored', 'type': 'bool'}, + 'restore_blocking_reason': {'key': 'restoreBlockingReason', 'type': 'str'}, + 'complete_restore_error_message': {'key': 'completeRestoreErrorMessage', 'type': 'str'}, + 'file_upload_blocking_errors': {'key': 'fileUploadBlockingErrors', 'type': '[str]'}, + 'current_restoring_filename': {'key': 'currentRestoringFilename', 'type': 'str'}, + 'last_restored_filename': {'key': 'lastRestoredFilename', 'type': 'str'}, + 'pending_log_backups_count': {'key': 'pendingLogBackupsCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(MigrationStatusDetails, self).__init__(**kwargs) + self.migration_state = None + self.full_backup_set_info = None + self.last_restored_backup_set_info = None + self.active_backup_sets = None + self.invalid_files = None + self.blob_container_name = None + self.is_full_backup_restored = None + self.restore_blocking_reason = None + self.complete_restore_error_message = None + self.file_upload_blocking_errors = None + self.current_restoring_filename = None + self.last_restored_filename = None + self.pending_log_backups_count = None + + class MigrationTableMetadata(msrest.serialization.Model): """Metadata for tables selected in migration project. @@ -9867,6 +12959,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrationTableMetadata, self).__init__(**kwargs) self.source_table_name = None self.target_table_name = None @@ -9919,6 +13013,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrationValidationDatabaseSummaryResult, self).__init__(**kwargs) self.id = None self.migration_id = None @@ -9932,17 +13028,17 @@ def __init__( class MigrationValidationOptions(msrest.serialization.Model): """Types of validations to run after the migration. - :param enable_schema_validation: Allows to compare the schema information between source and + :ivar enable_schema_validation: Allows to compare the schema information between source and target. - :type enable_schema_validation: bool - :param enable_data_integrity_validation: Allows to perform a checksum based data integrity + :vartype enable_schema_validation: bool + :ivar enable_data_integrity_validation: Allows to perform a checksum based data integrity validation between source and target for the selected database / tables . - :type enable_data_integrity_validation: bool - :param enable_query_analysis_validation: Allows to perform a quick and intelligent query + :vartype enable_data_integrity_validation: bool + :ivar enable_query_analysis_validation: Allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them in the target. The result will have execution statistics for executions in source and target databases for the extracted queries. - :type enable_query_analysis_validation: bool + :vartype enable_query_analysis_validation: bool """ _attribute_map = { @@ -9959,6 +13055,19 @@ def __init__( enable_query_analysis_validation: Optional[bool] = None, **kwargs ): + """ + :keyword enable_schema_validation: Allows to compare the schema information between source and + target. + :paramtype enable_schema_validation: bool + :keyword enable_data_integrity_validation: Allows to perform a checksum based data integrity + validation between source and target for the selected database / tables . + :paramtype enable_data_integrity_validation: bool + :keyword enable_query_analysis_validation: Allows to perform a quick and intelligent query + analysis by retrieving queries from the source database and executes them in the target. The + result will have execution statistics for executions in source and target databases for the + extracted queries. + :paramtype enable_query_analysis_validation: bool + """ super(MigrationValidationOptions, self).__init__(**kwargs) self.enable_schema_validation = enable_schema_validation self.enable_data_integrity_validation = enable_data_integrity_validation @@ -9970,15 +13079,15 @@ class MiSqlConnectionInfo(ConnectionInfo): All required parameters must be populated in order to send to Azure. - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param managed_instance_resource_id: Required. Resource id for Azure SQL database Managed + :ivar type: Required. Type of connection info.Constant filled by server. + :vartype type: str + :ivar user_name: User name. + :vartype user_name: str + :ivar password: Password credential. + :vartype password: str + :ivar managed_instance_resource_id: Required. Resource id for Azure SQL database Managed instance. - :type managed_instance_resource_id: str + :vartype managed_instance_resource_id: str """ _validation = { @@ -10001,6 +13110,15 @@ def __init__( password: Optional[str] = None, **kwargs ): + """ + :keyword user_name: User name. + :paramtype user_name: str + :keyword password: Password credential. + :paramtype password: str + :keyword managed_instance_resource_id: Required. Resource id for Azure SQL database Managed + instance. + :paramtype managed_instance_resource_id: str + """ super(MiSqlConnectionInfo, self).__init__(user_name=user_name, password=password, **kwargs) self.type = 'MiSqlConnectionInfo' # type: str self.managed_instance_resource_id = managed_instance_resource_id @@ -10013,15 +13131,17 @@ class MongoDbCancelCommand(CommandProperties): All required parameters must be populated in order to send to Azure. - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str + :ivar command_type: Required. Command type.Constant filled by server. Possible values include: + "Migrate.Sync.Complete.Database", "Migrate.SqlServer.AzureDbSqlMi.Complete", "cancel", + "finish", "restart". + :vartype command_type: str or ~azure.mgmt.datamigration.models.CommandType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the command. This is ignored if submitted. Possible values include: "Unknown", "Accepted", "Running", "Succeeded", "Failed". :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - :param input: Command input. - :type input: ~azure.mgmt.datamigration.models.MongoDbCommandInput + :ivar input: Command input. + :vartype input: ~azure.mgmt.datamigration.models.MongoDbCommandInput """ _validation = { @@ -10043,6 +13163,10 @@ def __init__( input: Optional["MongoDbCommandInput"] = None, **kwargs ): + """ + :keyword input: Command input. + :paramtype input: ~azure.mgmt.datamigration.models.MongoDbCommandInput + """ super(MongoDbCancelCommand, self).__init__(**kwargs) self.command_type = 'cancel' # type: str self.input = input @@ -10053,16 +13177,16 @@ class MongoDbClusterInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param databases: Required. A list of non-system databases in the cluster. - :type databases: list[~azure.mgmt.datamigration.models.MongoDbDatabaseInfo] - :param supports_sharding: Required. Whether the cluster supports sharded collections. - :type supports_sharding: bool - :param type: Required. The type of data source. Possible values include: "BlobContainer", + :ivar databases: Required. A list of non-system databases in the cluster. + :vartype databases: list[~azure.mgmt.datamigration.models.MongoDbDatabaseInfo] + :ivar supports_sharding: Required. Whether the cluster supports sharded collections. + :vartype supports_sharding: bool + :ivar type: Required. The type of data source. Possible values include: "BlobContainer", "CosmosDb", "MongoDb". - :type type: str or ~azure.mgmt.datamigration.models.MongoDbClusterType - :param version: Required. The version of the data source in the form x.y.z (e.g. 3.6.7). Not + :vartype type: str or ~azure.mgmt.datamigration.models.MongoDbClusterType + :ivar version: Required. The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is BlobContainer. - :type version: str + :vartype version: str """ _validation = { @@ -10088,6 +13212,18 @@ def __init__( version: str, **kwargs ): + """ + :keyword databases: Required. A list of non-system databases in the cluster. + :paramtype databases: list[~azure.mgmt.datamigration.models.MongoDbDatabaseInfo] + :keyword supports_sharding: Required. Whether the cluster supports sharded collections. + :paramtype supports_sharding: bool + :keyword type: Required. The type of data source. Possible values include: "BlobContainer", + "CosmosDb", "MongoDb". + :paramtype type: str or ~azure.mgmt.datamigration.models.MongoDbClusterType + :keyword version: Required. The version of the data source in the form x.y.z (e.g. 3.6.7). Not + used if Type is BlobContainer. + :paramtype version: str + """ super(MongoDbClusterInfo, self).__init__(**kwargs) self.databases = databases self.supports_sharding = supports_sharding @@ -10100,20 +13236,20 @@ class MongoDbObjectInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param average_document_size: Required. The average document size, or -1 if the average size is + :ivar average_document_size: Required. The average document size, or -1 if the average size is unknown. - :type average_document_size: long - :param data_size: Required. The estimated total data size, in bytes, or -1 if the size is + :vartype average_document_size: long + :ivar data_size: Required. The estimated total data size, in bytes, or -1 if the size is unknown. - :type data_size: long - :param document_count: Required. The estimated total number of documents, or -1 if the document + :vartype data_size: long + :ivar document_count: Required. The estimated total number of documents, or -1 if the document count is unknown. - :type document_count: long - :param name: Required. The unqualified name of the database or collection. - :type name: str - :param qualified_name: Required. The qualified name of the database or collection. For a + :vartype document_count: long + :ivar name: Required. The unqualified name of the database or collection. + :vartype name: str + :ivar qualified_name: Required. The qualified name of the database or collection. For a collection, this is the database-qualified name. - :type qualified_name: str + :vartype qualified_name: str """ _validation = { @@ -10142,6 +13278,22 @@ def __init__( qualified_name: str, **kwargs ): + """ + :keyword average_document_size: Required. The average document size, or -1 if the average size + is unknown. + :paramtype average_document_size: long + :keyword data_size: Required. The estimated total data size, in bytes, or -1 if the size is + unknown. + :paramtype data_size: long + :keyword document_count: Required. The estimated total number of documents, or -1 if the + document count is unknown. + :paramtype document_count: long + :keyword name: Required. The unqualified name of the database or collection. + :paramtype name: str + :keyword qualified_name: Required. The qualified name of the database or collection. For a + collection, this is the database-qualified name. + :paramtype qualified_name: str + """ super(MongoDbObjectInfo, self).__init__(**kwargs) self.average_document_size = average_document_size self.data_size = data_size @@ -10155,36 +13307,36 @@ class MongoDbCollectionInfo(MongoDbObjectInfo): All required parameters must be populated in order to send to Azure. - :param average_document_size: Required. The average document size, or -1 if the average size is + :ivar average_document_size: Required. The average document size, or -1 if the average size is unknown. - :type average_document_size: long - :param data_size: Required. The estimated total data size, in bytes, or -1 if the size is + :vartype average_document_size: long + :ivar data_size: Required. The estimated total data size, in bytes, or -1 if the size is unknown. - :type data_size: long - :param document_count: Required. The estimated total number of documents, or -1 if the document + :vartype data_size: long + :ivar document_count: Required. The estimated total number of documents, or -1 if the document count is unknown. - :type document_count: long - :param name: Required. The unqualified name of the database or collection. - :type name: str - :param qualified_name: Required. The qualified name of the database or collection. For a + :vartype document_count: long + :ivar name: Required. The unqualified name of the database or collection. + :vartype name: str + :ivar qualified_name: Required. The qualified name of the database or collection. For a collection, this is the database-qualified name. - :type qualified_name: str - :param database_name: Required. The name of the database containing the collection. - :type database_name: str - :param is_capped: Required. Whether the collection is a capped collection (i.e. whether it has - a fixed size and acts like a circular buffer). - :type is_capped: bool - :param is_system_collection: Required. Whether the collection is system collection. - :type is_system_collection: bool - :param is_view: Required. Whether the collection is a view of another collection. - :type is_view: bool - :param shard_key: The shard key on the collection, or null if the collection is not sharded. - :type shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeyInfo - :param supports_sharding: Required. Whether the database has sharding enabled. Note that the + :vartype qualified_name: str + :ivar database_name: Required. The name of the database containing the collection. + :vartype database_name: str + :ivar is_capped: Required. Whether the collection is a capped collection (i.e. whether it has a + fixed size and acts like a circular buffer). + :vartype is_capped: bool + :ivar is_system_collection: Required. Whether the collection is system collection. + :vartype is_system_collection: bool + :ivar is_view: Required. Whether the collection is a view of another collection. + :vartype is_view: bool + :ivar shard_key: The shard key on the collection, or null if the collection is not sharded. + :vartype shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeyInfo + :ivar supports_sharding: Required. Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. - :type supports_sharding: bool - :param view_of: The name of the collection that this is a view of, if IsView is true. - :type view_of: str + :vartype supports_sharding: bool + :ivar view_of: The name of the collection that this is a view of, if IsView is true. + :vartype view_of: str """ _validation = { @@ -10232,6 +13384,38 @@ def __init__( view_of: Optional[str] = None, **kwargs ): + """ + :keyword average_document_size: Required. The average document size, or -1 if the average size + is unknown. + :paramtype average_document_size: long + :keyword data_size: Required. The estimated total data size, in bytes, or -1 if the size is + unknown. + :paramtype data_size: long + :keyword document_count: Required. The estimated total number of documents, or -1 if the + document count is unknown. + :paramtype document_count: long + :keyword name: Required. The unqualified name of the database or collection. + :paramtype name: str + :keyword qualified_name: Required. The qualified name of the database or collection. For a + collection, this is the database-qualified name. + :paramtype qualified_name: str + :keyword database_name: Required. The name of the database containing the collection. + :paramtype database_name: str + :keyword is_capped: Required. Whether the collection is a capped collection (i.e. whether it + has a fixed size and acts like a circular buffer). + :paramtype is_capped: bool + :keyword is_system_collection: Required. Whether the collection is system collection. + :paramtype is_system_collection: bool + :keyword is_view: Required. Whether the collection is a view of another collection. + :paramtype is_view: bool + :keyword shard_key: The shard key on the collection, or null if the collection is not sharded. + :paramtype shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeyInfo + :keyword supports_sharding: Required. Whether the database has sharding enabled. Note that the + migration task will enable sharding on the target if necessary. + :paramtype supports_sharding: bool + :keyword view_of: The name of the collection that this is a view of, if IsView is true. + :paramtype view_of: str + """ super(MongoDbCollectionInfo, self).__init__(average_document_size=average_document_size, data_size=data_size, document_count=document_count, name=name, qualified_name=qualified_name, **kwargs) self.database_name = database_name self.is_capped = is_capped @@ -10250,47 +13434,47 @@ class MongoDbProgress(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param bytes_copied: Required. The number of document bytes copied during the Copying stage. - :type bytes_copied: long - :param documents_copied: Required. The number of documents copied during the Copying stage. - :type documents_copied: long - :param elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. + :ivar bytes_copied: Required. The number of document bytes copied during the Copying stage. + :vartype bytes_copied: long + :ivar documents_copied: Required. The number of documents copied during the Copying stage. + :vartype documents_copied: long + :ivar elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). - :type elapsed_time: str - :param errors: Required. The errors and warnings that have occurred for the current object. The + :vartype elapsed_time: str + :ivar errors: Required. The errors and warnings that have occurred for the current object. The keys are the error codes. - :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] - :param events_pending: Required. The number of oplog events awaiting replay. - :type events_pending: long - :param events_replayed: Required. The number of oplog events replayed so far. - :type events_replayed: long - :param last_event_time: The timestamp of the last oplog event received, or null if no oplog + :vartype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :ivar events_pending: Required. The number of oplog events awaiting replay. + :vartype events_pending: long + :ivar events_replayed: Required. The number of oplog events replayed so far. + :vartype events_replayed: long + :ivar last_event_time: The timestamp of the last oplog event received, or null if no oplog event has been received yet. - :type last_event_time: ~datetime.datetime - :param last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog + :vartype last_event_time: ~datetime.datetime + :ivar last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet. - :type last_replay_time: ~datetime.datetime - :param name: The name of the progress object. For a collection, this is the unqualified + :vartype last_replay_time: ~datetime.datetime + :ivar name: The name of the progress object. For a collection, this is the unqualified collection name. For a database, this is the database name. For the overall migration, this is null. - :type name: str - :param qualified_name: The qualified name of the progress object. For a collection, this is the + :vartype name: str + :ivar qualified_name: The qualified name of the progress object. For a collection, this is the database-qualified name. For a database, this is the database name. For the overall migration, this is null. - :type qualified_name: str - :param result_type: Required. The type of progress object.Constant filled by server. Possible + :vartype qualified_name: str + :ivar result_type: Required. The type of progress object.Constant filled by server. Possible values include: "Migration", "Database", "Collection". - :type result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType - :param state: Required. Possible values include: "NotStarted", "ValidatingInput", + :vartype result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType + :ivar state: Required. Possible values include: "NotStarted", "ValidatingInput", "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", "Complete", "Canceled", "Failed". - :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState - :param total_bytes: Required. The total number of document bytes on the source at the beginning + :vartype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :ivar total_bytes: Required. The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown. - :type total_bytes: long - :param total_documents: Required. The total number of documents on the source at the beginning + :vartype total_bytes: long + :ivar total_documents: Required. The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown. - :type total_documents: long + :vartype total_documents: long """ _validation = { @@ -10345,6 +13529,46 @@ def __init__( qualified_name: Optional[str] = None, **kwargs ): + """ + :keyword bytes_copied: Required. The number of document bytes copied during the Copying stage. + :paramtype bytes_copied: long + :keyword documents_copied: Required. The number of documents copied during the Copying stage. + :paramtype documents_copied: long + :keyword elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. + TimeSpan format). + :paramtype elapsed_time: str + :keyword errors: Required. The errors and warnings that have occurred for the current object. + The keys are the error codes. + :paramtype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :keyword events_pending: Required. The number of oplog events awaiting replay. + :paramtype events_pending: long + :keyword events_replayed: Required. The number of oplog events replayed so far. + :paramtype events_replayed: long + :keyword last_event_time: The timestamp of the last oplog event received, or null if no oplog + event has been received yet. + :paramtype last_event_time: ~datetime.datetime + :keyword last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog + event has been replayed yet. + :paramtype last_replay_time: ~datetime.datetime + :keyword name: The name of the progress object. For a collection, this is the unqualified + collection name. For a database, this is the database name. For the overall migration, this is + null. + :paramtype name: str + :keyword qualified_name: The qualified name of the progress object. For a collection, this is + the database-qualified name. For a database, this is the database name. For the overall + migration, this is null. + :paramtype qualified_name: str + :keyword state: Required. Possible values include: "NotStarted", "ValidatingInput", + "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", + "Complete", "Canceled", "Failed". + :paramtype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :keyword total_bytes: Required. The total number of document bytes on the source at the + beginning of the Copying stage, or -1 if the total size was unknown. + :paramtype total_bytes: long + :keyword total_documents: Required. The total number of documents on the source at the + beginning of the Copying stage, or -1 if the total count was unknown. + :paramtype total_documents: long + """ super(MongoDbProgress, self).__init__(**kwargs) self.bytes_copied = bytes_copied self.documents_copied = documents_copied @@ -10367,47 +13591,47 @@ class MongoDbCollectionProgress(MongoDbProgress): All required parameters must be populated in order to send to Azure. - :param bytes_copied: Required. The number of document bytes copied during the Copying stage. - :type bytes_copied: long - :param documents_copied: Required. The number of documents copied during the Copying stage. - :type documents_copied: long - :param elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. + :ivar bytes_copied: Required. The number of document bytes copied during the Copying stage. + :vartype bytes_copied: long + :ivar documents_copied: Required. The number of documents copied during the Copying stage. + :vartype documents_copied: long + :ivar elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). - :type elapsed_time: str - :param errors: Required. The errors and warnings that have occurred for the current object. The + :vartype elapsed_time: str + :ivar errors: Required. The errors and warnings that have occurred for the current object. The keys are the error codes. - :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] - :param events_pending: Required. The number of oplog events awaiting replay. - :type events_pending: long - :param events_replayed: Required. The number of oplog events replayed so far. - :type events_replayed: long - :param last_event_time: The timestamp of the last oplog event received, or null if no oplog + :vartype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :ivar events_pending: Required. The number of oplog events awaiting replay. + :vartype events_pending: long + :ivar events_replayed: Required. The number of oplog events replayed so far. + :vartype events_replayed: long + :ivar last_event_time: The timestamp of the last oplog event received, or null if no oplog event has been received yet. - :type last_event_time: ~datetime.datetime - :param last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog + :vartype last_event_time: ~datetime.datetime + :ivar last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet. - :type last_replay_time: ~datetime.datetime - :param name: The name of the progress object. For a collection, this is the unqualified + :vartype last_replay_time: ~datetime.datetime + :ivar name: The name of the progress object. For a collection, this is the unqualified collection name. For a database, this is the database name. For the overall migration, this is null. - :type name: str - :param qualified_name: The qualified name of the progress object. For a collection, this is the + :vartype name: str + :ivar qualified_name: The qualified name of the progress object. For a collection, this is the database-qualified name. For a database, this is the database name. For the overall migration, this is null. - :type qualified_name: str - :param result_type: Required. The type of progress object.Constant filled by server. Possible + :vartype qualified_name: str + :ivar result_type: Required. The type of progress object.Constant filled by server. Possible values include: "Migration", "Database", "Collection". - :type result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType - :param state: Required. Possible values include: "NotStarted", "ValidatingInput", + :vartype result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType + :ivar state: Required. Possible values include: "NotStarted", "ValidatingInput", "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", "Complete", "Canceled", "Failed". - :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState - :param total_bytes: Required. The total number of document bytes on the source at the beginning + :vartype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :ivar total_bytes: Required. The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown. - :type total_bytes: long - :param total_documents: Required. The total number of documents on the source at the beginning + :vartype total_bytes: long + :ivar total_documents: Required. The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown. - :type total_documents: long + :vartype total_documents: long """ _validation = { @@ -10458,6 +13682,46 @@ def __init__( qualified_name: Optional[str] = None, **kwargs ): + """ + :keyword bytes_copied: Required. The number of document bytes copied during the Copying stage. + :paramtype bytes_copied: long + :keyword documents_copied: Required. The number of documents copied during the Copying stage. + :paramtype documents_copied: long + :keyword elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. + TimeSpan format). + :paramtype elapsed_time: str + :keyword errors: Required. The errors and warnings that have occurred for the current object. + The keys are the error codes. + :paramtype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :keyword events_pending: Required. The number of oplog events awaiting replay. + :paramtype events_pending: long + :keyword events_replayed: Required. The number of oplog events replayed so far. + :paramtype events_replayed: long + :keyword last_event_time: The timestamp of the last oplog event received, or null if no oplog + event has been received yet. + :paramtype last_event_time: ~datetime.datetime + :keyword last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog + event has been replayed yet. + :paramtype last_replay_time: ~datetime.datetime + :keyword name: The name of the progress object. For a collection, this is the unqualified + collection name. For a database, this is the database name. For the overall migration, this is + null. + :paramtype name: str + :keyword qualified_name: The qualified name of the progress object. For a collection, this is + the database-qualified name. For a database, this is the database name. For the overall + migration, this is null. + :paramtype qualified_name: str + :keyword state: Required. Possible values include: "NotStarted", "ValidatingInput", + "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", + "Complete", "Canceled", "Failed". + :paramtype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :keyword total_bytes: Required. The total number of document bytes on the source at the + beginning of the Copying stage, or -1 if the total size was unknown. + :paramtype total_bytes: long + :keyword total_documents: Required. The total number of documents on the source at the + beginning of the Copying stage, or -1 if the total count was unknown. + :paramtype total_documents: long + """ super(MongoDbCollectionProgress, self).__init__(bytes_copied=bytes_copied, documents_copied=documents_copied, elapsed_time=elapsed_time, errors=errors, events_pending=events_pending, events_replayed=events_replayed, last_event_time=last_event_time, last_replay_time=last_replay_time, name=name, qualified_name=qualified_name, state=state, total_bytes=total_bytes, total_documents=total_documents, **kwargs) self.result_type = 'Collection' # type: str @@ -10465,14 +13729,14 @@ def __init__( class MongoDbCollectionSettings(msrest.serialization.Model): """Describes how an individual MongoDB collection should be migrated. - :param can_delete: Whether the migrator is allowed to drop the target collection in the course + :ivar can_delete: Whether the migrator is allowed to drop the target collection in the course of performing a migration. The default is true. - :type can_delete: bool - :param shard_key: Describes a MongoDB shard key. - :type shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeySetting - :param target_r_us: The RUs that should be configured on a CosmosDB target, or null to use the + :vartype can_delete: bool + :ivar shard_key: Describes a MongoDB shard key. + :vartype shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeySetting + :ivar target_r_us: The RUs that should be configured on a CosmosDB target, or null to use the default. This has no effect on non-CosmosDB targets. - :type target_r_us: int + :vartype target_r_us: int """ _attribute_map = { @@ -10489,6 +13753,16 @@ def __init__( target_r_us: Optional[int] = None, **kwargs ): + """ + :keyword can_delete: Whether the migrator is allowed to drop the target collection in the + course of performing a migration. The default is true. + :paramtype can_delete: bool + :keyword shard_key: Describes a MongoDB shard key. + :paramtype shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeySetting + :keyword target_r_us: The RUs that should be configured on a CosmosDB target, or null to use + the default. This has no effect on non-CosmosDB targets. + :paramtype target_r_us: int + """ super(MongoDbCollectionSettings, self).__init__(**kwargs) self.can_delete = can_delete self.shard_key = shard_key @@ -10498,9 +13772,9 @@ def __init__( class MongoDbCommandInput(msrest.serialization.Model): """Describes the input to the 'cancel' and 'restart' MongoDB migration commands. - :param object_name: The qualified name of a database or collection to act upon, or null to act + :ivar object_name: The qualified name of a database or collection to act upon, or null to act upon the entire migration. - :type object_name: str + :vartype object_name: str """ _attribute_map = { @@ -10513,6 +13787,11 @@ def __init__( object_name: Optional[str] = None, **kwargs ): + """ + :keyword object_name: The qualified name of a database or collection to act upon, or null to + act upon the entire migration. + :paramtype object_name: str + """ super(MongoDbCommandInput, self).__init__(**kwargs) self.object_name = object_name @@ -10522,15 +13801,37 @@ class MongoDbConnectionInfo(ConnectionInfo): All required parameters must be populated in order to send to Azure. - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param connection_string: Required. A MongoDB connection string or blob container URL. The user + :ivar type: Required. Type of connection info.Constant filled by server. + :vartype type: str + :ivar user_name: User name. + :vartype user_name: str + :ivar password: Password credential. + :vartype password: str + :ivar connection_string: Required. A MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName and password properties. - :type connection_string: str + :vartype connection_string: str + :ivar data_source: Data source. + :vartype data_source: str + :ivar encrypt_connection: Whether to encrypt the connection. + :vartype encrypt_connection: bool + :ivar server_brand_version: server brand version. + :vartype server_brand_version: str + :ivar server_version: server version. + :vartype server_version: str + :ivar server_name: name of the server. + :vartype server_name: str + :ivar trust_server_certificate: Whether to trust the server certificate. + :vartype trust_server_certificate: bool + :ivar enforce_ssl: + :vartype enforce_ssl: bool + :ivar port: port for server. + :vartype port: int + :ivar additional_settings: Additional connection settings. + :vartype additional_settings: str + :ivar authentication: Authentication type to use for connection. Possible values include: + "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", + "ActiveDirectoryPassword". + :vartype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType """ _validation = { @@ -10543,6 +13844,16 @@ class MongoDbConnectionInfo(ConnectionInfo): 'user_name': {'key': 'userName', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'encrypt_connection': {'key': 'encryptConnection', 'type': 'bool'}, + 'server_brand_version': {'key': 'serverBrandVersion', 'type': 'str'}, + 'server_version': {'key': 'serverVersion', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'trust_server_certificate': {'key': 'trustServerCertificate', 'type': 'bool'}, + 'enforce_ssl': {'key': 'enforceSSL', 'type': 'bool'}, + 'port': {'key': 'port', 'type': 'int'}, + 'additional_settings': {'key': 'additionalSettings', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'str'}, } def __init__( @@ -10551,11 +13862,62 @@ def __init__( connection_string: str, user_name: Optional[str] = None, password: Optional[str] = None, + data_source: Optional[str] = None, + encrypt_connection: Optional[bool] = None, + server_brand_version: Optional[str] = None, + server_version: Optional[str] = None, + server_name: Optional[str] = None, + trust_server_certificate: Optional[bool] = False, + enforce_ssl: Optional[bool] = None, + port: Optional[int] = None, + additional_settings: Optional[str] = None, + authentication: Optional[Union[str, "AuthenticationType"]] = None, **kwargs ): + """ + :keyword user_name: User name. + :paramtype user_name: str + :keyword password: Password credential. + :paramtype password: str + :keyword connection_string: Required. A MongoDB connection string or blob container URL. The + user name and password can be specified here or in the userName and password properties. + :paramtype connection_string: str + :keyword data_source: Data source. + :paramtype data_source: str + :keyword encrypt_connection: Whether to encrypt the connection. + :paramtype encrypt_connection: bool + :keyword server_brand_version: server brand version. + :paramtype server_brand_version: str + :keyword server_version: server version. + :paramtype server_version: str + :keyword server_name: name of the server. + :paramtype server_name: str + :keyword trust_server_certificate: Whether to trust the server certificate. + :paramtype trust_server_certificate: bool + :keyword enforce_ssl: + :paramtype enforce_ssl: bool + :keyword port: port for server. + :paramtype port: int + :keyword additional_settings: Additional connection settings. + :paramtype additional_settings: str + :keyword authentication: Authentication type to use for connection. Possible values include: + "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", + "ActiveDirectoryPassword". + :paramtype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType + """ super(MongoDbConnectionInfo, self).__init__(user_name=user_name, password=password, **kwargs) self.type = 'MongoDbConnectionInfo' # type: str self.connection_string = connection_string + self.data_source = data_source + self.encrypt_connection = encrypt_connection + self.server_brand_version = server_brand_version + self.server_version = server_version + self.server_name = server_name + self.trust_server_certificate = trust_server_certificate + self.enforce_ssl = enforce_ssl + self.port = port + self.additional_settings = additional_settings + self.authentication = authentication class MongoDbDatabaseInfo(MongoDbObjectInfo): @@ -10563,25 +13925,25 @@ class MongoDbDatabaseInfo(MongoDbObjectInfo): All required parameters must be populated in order to send to Azure. - :param average_document_size: Required. The average document size, or -1 if the average size is + :ivar average_document_size: Required. The average document size, or -1 if the average size is unknown. - :type average_document_size: long - :param data_size: Required. The estimated total data size, in bytes, or -1 if the size is + :vartype average_document_size: long + :ivar data_size: Required. The estimated total data size, in bytes, or -1 if the size is unknown. - :type data_size: long - :param document_count: Required. The estimated total number of documents, or -1 if the document + :vartype data_size: long + :ivar document_count: Required. The estimated total number of documents, or -1 if the document count is unknown. - :type document_count: long - :param name: Required. The unqualified name of the database or collection. - :type name: str - :param qualified_name: Required. The qualified name of the database or collection. For a + :vartype document_count: long + :ivar name: Required. The unqualified name of the database or collection. + :vartype name: str + :ivar qualified_name: Required. The qualified name of the database or collection. For a collection, this is the database-qualified name. - :type qualified_name: str - :param collections: Required. A list of supported collections in a MongoDB database. - :type collections: list[~azure.mgmt.datamigration.models.MongoDbCollectionInfo] - :param supports_sharding: Required. Whether the database has sharding enabled. Note that the + :vartype qualified_name: str + :ivar collections: Required. A list of supported collections in a MongoDB database. + :vartype collections: list[~azure.mgmt.datamigration.models.MongoDbCollectionInfo] + :ivar supports_sharding: Required. Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. - :type supports_sharding: bool + :vartype supports_sharding: bool """ _validation = { @@ -10616,6 +13978,27 @@ def __init__( supports_sharding: bool, **kwargs ): + """ + :keyword average_document_size: Required. The average document size, or -1 if the average size + is unknown. + :paramtype average_document_size: long + :keyword data_size: Required. The estimated total data size, in bytes, or -1 if the size is + unknown. + :paramtype data_size: long + :keyword document_count: Required. The estimated total number of documents, or -1 if the + document count is unknown. + :paramtype document_count: long + :keyword name: Required. The unqualified name of the database or collection. + :paramtype name: str + :keyword qualified_name: Required. The qualified name of the database or collection. For a + collection, this is the database-qualified name. + :paramtype qualified_name: str + :keyword collections: Required. A list of supported collections in a MongoDB database. + :paramtype collections: list[~azure.mgmt.datamigration.models.MongoDbCollectionInfo] + :keyword supports_sharding: Required. Whether the database has sharding enabled. Note that the + migration task will enable sharding on the target if necessary. + :paramtype supports_sharding: bool + """ super(MongoDbDatabaseInfo, self).__init__(average_document_size=average_document_size, data_size=data_size, document_count=document_count, name=name, qualified_name=qualified_name, **kwargs) self.collections = collections self.supports_sharding = supports_sharding @@ -10626,50 +14009,50 @@ class MongoDbDatabaseProgress(MongoDbProgress): All required parameters must be populated in order to send to Azure. - :param bytes_copied: Required. The number of document bytes copied during the Copying stage. - :type bytes_copied: long - :param documents_copied: Required. The number of documents copied during the Copying stage. - :type documents_copied: long - :param elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. + :ivar bytes_copied: Required. The number of document bytes copied during the Copying stage. + :vartype bytes_copied: long + :ivar documents_copied: Required. The number of documents copied during the Copying stage. + :vartype documents_copied: long + :ivar elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). - :type elapsed_time: str - :param errors: Required. The errors and warnings that have occurred for the current object. The + :vartype elapsed_time: str + :ivar errors: Required. The errors and warnings that have occurred for the current object. The keys are the error codes. - :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] - :param events_pending: Required. The number of oplog events awaiting replay. - :type events_pending: long - :param events_replayed: Required. The number of oplog events replayed so far. - :type events_replayed: long - :param last_event_time: The timestamp of the last oplog event received, or null if no oplog + :vartype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :ivar events_pending: Required. The number of oplog events awaiting replay. + :vartype events_pending: long + :ivar events_replayed: Required. The number of oplog events replayed so far. + :vartype events_replayed: long + :ivar last_event_time: The timestamp of the last oplog event received, or null if no oplog event has been received yet. - :type last_event_time: ~datetime.datetime - :param last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog + :vartype last_event_time: ~datetime.datetime + :ivar last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet. - :type last_replay_time: ~datetime.datetime - :param name: The name of the progress object. For a collection, this is the unqualified + :vartype last_replay_time: ~datetime.datetime + :ivar name: The name of the progress object. For a collection, this is the unqualified collection name. For a database, this is the database name. For the overall migration, this is null. - :type name: str - :param qualified_name: The qualified name of the progress object. For a collection, this is the + :vartype name: str + :ivar qualified_name: The qualified name of the progress object. For a collection, this is the database-qualified name. For a database, this is the database name. For the overall migration, this is null. - :type qualified_name: str - :param result_type: Required. The type of progress object.Constant filled by server. Possible + :vartype qualified_name: str + :ivar result_type: Required. The type of progress object.Constant filled by server. Possible values include: "Migration", "Database", "Collection". - :type result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType - :param state: Required. Possible values include: "NotStarted", "ValidatingInput", + :vartype result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType + :ivar state: Required. Possible values include: "NotStarted", "ValidatingInput", "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", "Complete", "Canceled", "Failed". - :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState - :param total_bytes: Required. The total number of document bytes on the source at the beginning + :vartype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :ivar total_bytes: Required. The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown. - :type total_bytes: long - :param total_documents: Required. The total number of documents on the source at the beginning + :vartype total_bytes: long + :ivar total_documents: Required. The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown. - :type total_documents: long - :param collections: The progress of the collections in the database. The keys are the + :vartype total_documents: long + :ivar collections: The progress of the collections in the database. The keys are the unqualified names of the collections. - :type collections: dict[str, ~azure.mgmt.datamigration.models.MongoDbCollectionProgress] + :vartype collections: dict[str, ~azure.mgmt.datamigration.models.MongoDbCollectionProgress] """ _validation = { @@ -10722,6 +14105,49 @@ def __init__( collections: Optional[Dict[str, "MongoDbCollectionProgress"]] = None, **kwargs ): + """ + :keyword bytes_copied: Required. The number of document bytes copied during the Copying stage. + :paramtype bytes_copied: long + :keyword documents_copied: Required. The number of documents copied during the Copying stage. + :paramtype documents_copied: long + :keyword elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. + TimeSpan format). + :paramtype elapsed_time: str + :keyword errors: Required. The errors and warnings that have occurred for the current object. + The keys are the error codes. + :paramtype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :keyword events_pending: Required. The number of oplog events awaiting replay. + :paramtype events_pending: long + :keyword events_replayed: Required. The number of oplog events replayed so far. + :paramtype events_replayed: long + :keyword last_event_time: The timestamp of the last oplog event received, or null if no oplog + event has been received yet. + :paramtype last_event_time: ~datetime.datetime + :keyword last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog + event has been replayed yet. + :paramtype last_replay_time: ~datetime.datetime + :keyword name: The name of the progress object. For a collection, this is the unqualified + collection name. For a database, this is the database name. For the overall migration, this is + null. + :paramtype name: str + :keyword qualified_name: The qualified name of the progress object. For a collection, this is + the database-qualified name. For a database, this is the database name. For the overall + migration, this is null. + :paramtype qualified_name: str + :keyword state: Required. Possible values include: "NotStarted", "ValidatingInput", + "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", + "Complete", "Canceled", "Failed". + :paramtype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :keyword total_bytes: Required. The total number of document bytes on the source at the + beginning of the Copying stage, or -1 if the total size was unknown. + :paramtype total_bytes: long + :keyword total_documents: Required. The total number of documents on the source at the + beginning of the Copying stage, or -1 if the total count was unknown. + :paramtype total_documents: long + :keyword collections: The progress of the collections in the database. The keys are the + unqualified names of the collections. + :paramtype collections: dict[str, ~azure.mgmt.datamigration.models.MongoDbCollectionProgress] + """ super(MongoDbDatabaseProgress, self).__init__(bytes_copied=bytes_copied, documents_copied=documents_copied, elapsed_time=elapsed_time, errors=errors, events_pending=events_pending, events_replayed=events_replayed, last_event_time=last_event_time, last_replay_time=last_replay_time, name=name, qualified_name=qualified_name, state=state, total_bytes=total_bytes, total_documents=total_documents, **kwargs) self.result_type = 'Database' # type: str self.collections = collections @@ -10732,13 +14158,13 @@ class MongoDbDatabaseSettings(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param collections: Required. The collections on the source database to migrate to the target. + :ivar collections: Required. The collections on the source database to migrate to the target. The keys are the unqualified names of the collections. - :type collections: dict[str, ~azure.mgmt.datamigration.models.MongoDbCollectionSettings] - :param target_r_us: The RUs that should be configured on a CosmosDB target, or null to use the + :vartype collections: dict[str, ~azure.mgmt.datamigration.models.MongoDbCollectionSettings] + :ivar target_r_us: The RUs that should be configured on a CosmosDB target, or null to use the default, or 0 if throughput should not be provisioned for the database. This has no effect on non-CosmosDB targets. - :type target_r_us: int + :vartype target_r_us: int """ _validation = { @@ -10757,6 +14183,15 @@ def __init__( target_r_us: Optional[int] = None, **kwargs ): + """ + :keyword collections: Required. The collections on the source database to migrate to the + target. The keys are the unqualified names of the collections. + :paramtype collections: dict[str, ~azure.mgmt.datamigration.models.MongoDbCollectionSettings] + :keyword target_r_us: The RUs that should be configured on a CosmosDB target, or null to use + the default, or 0 if throughput should not be provisioned for the database. This has no effect + on non-CosmosDB targets. + :paramtype target_r_us: int + """ super(MongoDbDatabaseSettings, self).__init__(**kwargs) self.collections = collections self.target_r_us = target_r_us @@ -10765,15 +14200,15 @@ def __init__( class MongoDbError(msrest.serialization.Model): """Describes an error or warning that occurred during a MongoDB migration. - :param code: The non-localized, machine-readable code that describes the error or warning. - :type code: str - :param count: The number of times the error or warning has occurred. - :type count: int - :param message: The localized, human-readable message that describes the error or warning. - :type message: str - :param type: The type of error or warning. Possible values include: "Error", "ValidationError", + :ivar code: The non-localized, machine-readable code that describes the error or warning. + :vartype code: str + :ivar count: The number of times the error or warning has occurred. + :vartype count: int + :ivar message: The localized, human-readable message that describes the error or warning. + :vartype message: str + :ivar type: The type of error or warning. Possible values include: "Error", "ValidationError", "Warning". - :type type: str or ~azure.mgmt.datamigration.models.MongoDbErrorType + :vartype type: str or ~azure.mgmt.datamigration.models.MongoDbErrorType """ _attribute_map = { @@ -10792,6 +14227,17 @@ def __init__( type: Optional[Union[str, "MongoDbErrorType"]] = None, **kwargs ): + """ + :keyword code: The non-localized, machine-readable code that describes the error or warning. + :paramtype code: str + :keyword count: The number of times the error or warning has occurred. + :paramtype count: int + :keyword message: The localized, human-readable message that describes the error or warning. + :paramtype message: str + :keyword type: The type of error or warning. Possible values include: "Error", + "ValidationError", "Warning". + :paramtype type: str or ~azure.mgmt.datamigration.models.MongoDbErrorType + """ super(MongoDbError, self).__init__(**kwargs) self.code = code self.count = count @@ -10806,15 +14252,17 @@ class MongoDbFinishCommand(CommandProperties): All required parameters must be populated in order to send to Azure. - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str + :ivar command_type: Required. Command type.Constant filled by server. Possible values include: + "Migrate.Sync.Complete.Database", "Migrate.SqlServer.AzureDbSqlMi.Complete", "cancel", + "finish", "restart". + :vartype command_type: str or ~azure.mgmt.datamigration.models.CommandType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the command. This is ignored if submitted. Possible values include: "Unknown", "Accepted", "Running", "Succeeded", "Failed". :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - :param input: Command input. - :type input: ~azure.mgmt.datamigration.models.MongoDbFinishCommandInput + :ivar input: Command input. + :vartype input: ~azure.mgmt.datamigration.models.MongoDbFinishCommandInput """ _validation = { @@ -10836,6 +14284,10 @@ def __init__( input: Optional["MongoDbFinishCommandInput"] = None, **kwargs ): + """ + :keyword input: Command input. + :paramtype input: ~azure.mgmt.datamigration.models.MongoDbFinishCommandInput + """ super(MongoDbFinishCommand, self).__init__(**kwargs) self.command_type = 'finish' # type: str self.input = input @@ -10846,13 +14298,13 @@ class MongoDbFinishCommandInput(MongoDbCommandInput): All required parameters must be populated in order to send to Azure. - :param object_name: The qualified name of a database or collection to act upon, or null to act + :ivar object_name: The qualified name of a database or collection to act upon, or null to act upon the entire migration. - :type object_name: str - :param immediate: Required. If true, replication for the affected objects will be stopped + :vartype object_name: str + :ivar immediate: Required. If true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying queued events before finishing the replication. - :type immediate: bool + :vartype immediate: bool """ _validation = { @@ -10871,6 +14323,15 @@ def __init__( object_name: Optional[str] = None, **kwargs ): + """ + :keyword object_name: The qualified name of a database or collection to act upon, or null to + act upon the entire migration. + :paramtype object_name: str + :keyword immediate: Required. If true, replication for the affected objects will be stopped + immediately. If false, the migrator will finish replaying queued events before finishing the + replication. + :paramtype immediate: bool + """ super(MongoDbFinishCommandInput, self).__init__(object_name=object_name, **kwargs) self.immediate = immediate @@ -10880,50 +14341,50 @@ class MongoDbMigrationProgress(MongoDbProgress): All required parameters must be populated in order to send to Azure. - :param bytes_copied: Required. The number of document bytes copied during the Copying stage. - :type bytes_copied: long - :param documents_copied: Required. The number of documents copied during the Copying stage. - :type documents_copied: long - :param elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. + :ivar bytes_copied: Required. The number of document bytes copied during the Copying stage. + :vartype bytes_copied: long + :ivar documents_copied: Required. The number of documents copied during the Copying stage. + :vartype documents_copied: long + :ivar elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). - :type elapsed_time: str - :param errors: Required. The errors and warnings that have occurred for the current object. The + :vartype elapsed_time: str + :ivar errors: Required. The errors and warnings that have occurred for the current object. The keys are the error codes. - :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] - :param events_pending: Required. The number of oplog events awaiting replay. - :type events_pending: long - :param events_replayed: Required. The number of oplog events replayed so far. - :type events_replayed: long - :param last_event_time: The timestamp of the last oplog event received, or null if no oplog + :vartype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :ivar events_pending: Required. The number of oplog events awaiting replay. + :vartype events_pending: long + :ivar events_replayed: Required. The number of oplog events replayed so far. + :vartype events_replayed: long + :ivar last_event_time: The timestamp of the last oplog event received, or null if no oplog event has been received yet. - :type last_event_time: ~datetime.datetime - :param last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog + :vartype last_event_time: ~datetime.datetime + :ivar last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet. - :type last_replay_time: ~datetime.datetime - :param name: The name of the progress object. For a collection, this is the unqualified + :vartype last_replay_time: ~datetime.datetime + :ivar name: The name of the progress object. For a collection, this is the unqualified collection name. For a database, this is the database name. For the overall migration, this is null. - :type name: str - :param qualified_name: The qualified name of the progress object. For a collection, this is the + :vartype name: str + :ivar qualified_name: The qualified name of the progress object. For a collection, this is the database-qualified name. For a database, this is the database name. For the overall migration, this is null. - :type qualified_name: str - :param result_type: Required. The type of progress object.Constant filled by server. Possible + :vartype qualified_name: str + :ivar result_type: Required. The type of progress object.Constant filled by server. Possible values include: "Migration", "Database", "Collection". - :type result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType - :param state: Required. Possible values include: "NotStarted", "ValidatingInput", + :vartype result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType + :ivar state: Required. Possible values include: "NotStarted", "ValidatingInput", "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", "Complete", "Canceled", "Failed". - :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState - :param total_bytes: Required. The total number of document bytes on the source at the beginning + :vartype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :ivar total_bytes: Required. The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown. - :type total_bytes: long - :param total_documents: Required. The total number of documents on the source at the beginning + :vartype total_bytes: long + :ivar total_documents: Required. The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown. - :type total_documents: long - :param databases: The progress of the databases in the migration. The keys are the names of the + :vartype total_documents: long + :ivar databases: The progress of the databases in the migration. The keys are the names of the databases. - :type databases: dict[str, ~azure.mgmt.datamigration.models.MongoDbDatabaseProgress] + :vartype databases: dict[str, ~azure.mgmt.datamigration.models.MongoDbDatabaseProgress] """ _validation = { @@ -10976,6 +14437,49 @@ def __init__( databases: Optional[Dict[str, "MongoDbDatabaseProgress"]] = None, **kwargs ): + """ + :keyword bytes_copied: Required. The number of document bytes copied during the Copying stage. + :paramtype bytes_copied: long + :keyword documents_copied: Required. The number of documents copied during the Copying stage. + :paramtype documents_copied: long + :keyword elapsed_time: Required. The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. + TimeSpan format). + :paramtype elapsed_time: str + :keyword errors: Required. The errors and warnings that have occurred for the current object. + The keys are the error codes. + :paramtype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :keyword events_pending: Required. The number of oplog events awaiting replay. + :paramtype events_pending: long + :keyword events_replayed: Required. The number of oplog events replayed so far. + :paramtype events_replayed: long + :keyword last_event_time: The timestamp of the last oplog event received, or null if no oplog + event has been received yet. + :paramtype last_event_time: ~datetime.datetime + :keyword last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog + event has been replayed yet. + :paramtype last_replay_time: ~datetime.datetime + :keyword name: The name of the progress object. For a collection, this is the unqualified + collection name. For a database, this is the database name. For the overall migration, this is + null. + :paramtype name: str + :keyword qualified_name: The qualified name of the progress object. For a collection, this is + the database-qualified name. For a database, this is the database name. For the overall + migration, this is null. + :paramtype qualified_name: str + :keyword state: Required. Possible values include: "NotStarted", "ValidatingInput", + "Initializing", "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", + "Complete", "Canceled", "Failed". + :paramtype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :keyword total_bytes: Required. The total number of document bytes on the source at the + beginning of the Copying stage, or -1 if the total size was unknown. + :paramtype total_bytes: long + :keyword total_documents: Required. The total number of documents on the source at the + beginning of the Copying stage, or -1 if the total count was unknown. + :paramtype total_documents: long + :keyword databases: The progress of the databases in the migration. The keys are the names of + the databases. + :paramtype databases: dict[str, ~azure.mgmt.datamigration.models.MongoDbDatabaseProgress] + """ super(MongoDbMigrationProgress, self).__init__(bytes_copied=bytes_copied, documents_copied=documents_copied, elapsed_time=elapsed_time, errors=errors, events_pending=events_pending, events_replayed=events_replayed, last_event_time=last_event_time, last_replay_time=last_replay_time, name=name, qualified_name=qualified_name, state=state, total_bytes=total_bytes, total_documents=total_documents, **kwargs) self.result_type = 'Migration' # type: str self.databases = databases @@ -10986,23 +14490,23 @@ class MongoDbMigrationSettings(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param boost_r_us: The RU limit on a CosmosDB target that collections will be temporarily + :ivar boost_r_us: The RU limit on a CosmosDB target that collections will be temporarily increased to (if lower) during the initial copy of a migration, from 10,000 to 1,000,000, or 0 to use the default boost (which is generally the maximum), or null to not boost the RUs. This setting has no effect on non-CosmosDB targets. - :type boost_r_us: int - :param databases: Required. The databases on the source cluster to migrate to the target. The + :vartype boost_r_us: int + :ivar databases: Required. The databases on the source cluster to migrate to the target. The keys are the names of the databases. - :type databases: dict[str, ~azure.mgmt.datamigration.models.MongoDbDatabaseSettings] - :param replication: Describes how changes will be replicated from the source to the target. The + :vartype databases: dict[str, ~azure.mgmt.datamigration.models.MongoDbDatabaseSettings] + :ivar replication: Describes how changes will be replicated from the source to the target. The default is OneTime. Possible values include: "Disabled", "OneTime", "Continuous". - :type replication: str or ~azure.mgmt.datamigration.models.MongoDbReplication - :param source: Required. Settings used to connect to the source cluster. - :type source: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo - :param target: Required. Settings used to connect to the target cluster. - :type target: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo - :param throttling: Settings used to limit the resource usage of the migration. - :type throttling: ~azure.mgmt.datamigration.models.MongoDbThrottlingSettings + :vartype replication: str or ~azure.mgmt.datamigration.models.MongoDbReplication + :ivar source: Required. Settings used to connect to the source cluster. + :vartype source: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :ivar target: Required. Settings used to connect to the target cluster. + :vartype target: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :ivar throttling: Settings used to limit the resource usage of the migration. + :vartype throttling: ~azure.mgmt.datamigration.models.MongoDbThrottlingSettings """ _validation = { @@ -11031,6 +14535,25 @@ def __init__( throttling: Optional["MongoDbThrottlingSettings"] = None, **kwargs ): + """ + :keyword boost_r_us: The RU limit on a CosmosDB target that collections will be temporarily + increased to (if lower) during the initial copy of a migration, from 10,000 to 1,000,000, or 0 + to use the default boost (which is generally the maximum), or null to not boost the RUs. This + setting has no effect on non-CosmosDB targets. + :paramtype boost_r_us: int + :keyword databases: Required. The databases on the source cluster to migrate to the target. The + keys are the names of the databases. + :paramtype databases: dict[str, ~azure.mgmt.datamigration.models.MongoDbDatabaseSettings] + :keyword replication: Describes how changes will be replicated from the source to the target. + The default is OneTime. Possible values include: "Disabled", "OneTime", "Continuous". + :paramtype replication: str or ~azure.mgmt.datamigration.models.MongoDbReplication + :keyword source: Required. Settings used to connect to the source cluster. + :paramtype source: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :keyword target: Required. Settings used to connect to the target cluster. + :paramtype target: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :keyword throttling: Settings used to limit the resource usage of the migration. + :paramtype throttling: ~azure.mgmt.datamigration.models.MongoDbThrottlingSettings + """ super(MongoDbMigrationSettings, self).__init__(**kwargs) self.boost_r_us = boost_r_us self.databases = databases @@ -11047,15 +14570,17 @@ class MongoDbRestartCommand(CommandProperties): All required parameters must be populated in order to send to Azure. - :param command_type: Required. Command type.Constant filled by server. - :type command_type: str + :ivar command_type: Required. Command type.Constant filled by server. Possible values include: + "Migrate.Sync.Complete.Database", "Migrate.SqlServer.AzureDbSqlMi.Complete", "cancel", + "finish", "restart". + :vartype command_type: str or ~azure.mgmt.datamigration.models.CommandType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the command. This is ignored if submitted. Possible values include: "Unknown", "Accepted", "Running", "Succeeded", "Failed". :vartype state: str or ~azure.mgmt.datamigration.models.CommandState - :param input: Command input. - :type input: ~azure.mgmt.datamigration.models.MongoDbCommandInput + :ivar input: Command input. + :vartype input: ~azure.mgmt.datamigration.models.MongoDbCommandInput """ _validation = { @@ -11077,6 +14602,10 @@ def __init__( input: Optional["MongoDbCommandInput"] = None, **kwargs ): + """ + :keyword input: Command input. + :paramtype input: ~azure.mgmt.datamigration.models.MongoDbCommandInput + """ super(MongoDbRestartCommand, self).__init__(**kwargs) self.command_type = 'restart' # type: str self.input = input @@ -11087,11 +14616,11 @@ class MongoDbShardKeyField(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the field. - :type name: str - :param order: Required. The field ordering. Possible values include: "Forward", "Reverse", + :ivar name: Required. The name of the field. + :vartype name: str + :ivar order: Required. The field ordering. Possible values include: "Forward", "Reverse", "Hashed". - :type order: str or ~azure.mgmt.datamigration.models.MongoDbShardKeyOrder + :vartype order: str or ~azure.mgmt.datamigration.models.MongoDbShardKeyOrder """ _validation = { @@ -11111,6 +14640,13 @@ def __init__( order: Union[str, "MongoDbShardKeyOrder"], **kwargs ): + """ + :keyword name: Required. The name of the field. + :paramtype name: str + :keyword order: Required. The field ordering. Possible values include: "Forward", "Reverse", + "Hashed". + :paramtype order: str or ~azure.mgmt.datamigration.models.MongoDbShardKeyOrder + """ super(MongoDbShardKeyField, self).__init__(**kwargs) self.name = name self.order = order @@ -11121,10 +14657,10 @@ class MongoDbShardKeyInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param fields: Required. The fields within the shard key. - :type fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] - :param is_unique: Required. Whether the shard key is unique. - :type is_unique: bool + :ivar fields: Required. The fields within the shard key. + :vartype fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] + :ivar is_unique: Required. Whether the shard key is unique. + :vartype is_unique: bool """ _validation = { @@ -11144,6 +14680,12 @@ def __init__( is_unique: bool, **kwargs ): + """ + :keyword fields: Required. The fields within the shard key. + :paramtype fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] + :keyword is_unique: Required. Whether the shard key is unique. + :paramtype is_unique: bool + """ super(MongoDbShardKeyInfo, self).__init__(**kwargs) self.fields = fields self.is_unique = is_unique @@ -11154,15 +14696,14 @@ class MongoDbShardKeySetting(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param fields: Required. The fields within the shard key. - :type fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] - :param is_unique: Required. Whether the shard key is unique. - :type is_unique: bool + :ivar fields: Required. The fields within the shard key. + :vartype fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] + :ivar is_unique: Whether the shard key is unique. + :vartype is_unique: bool """ _validation = { 'fields': {'required': True}, - 'is_unique': {'required': True}, } _attribute_map = { @@ -11174,9 +14715,15 @@ def __init__( self, *, fields: List["MongoDbShardKeyField"], - is_unique: bool, + is_unique: Optional[bool] = None, **kwargs ): + """ + :keyword fields: Required. The fields within the shard key. + :paramtype fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] + :keyword is_unique: Whether the shard key is unique. + :paramtype is_unique: bool + """ super(MongoDbShardKeySetting, self).__init__(**kwargs) self.fields = fields self.is_unique = is_unique @@ -11185,15 +14732,15 @@ def __init__( class MongoDbThrottlingSettings(msrest.serialization.Model): """Specifies resource limits for the migration. - :param min_free_cpu: The percentage of CPU time that the migrator will try to avoid using, from + :ivar min_free_cpu: The percentage of CPU time that the migrator will try to avoid using, from 0 to 100. - :type min_free_cpu: int - :param min_free_memory_mb: The number of megabytes of RAM that the migrator will try to avoid + :vartype min_free_cpu: int + :ivar min_free_memory_mb: The number of megabytes of RAM that the migrator will try to avoid using. - :type min_free_memory_mb: int - :param max_parallelism: The maximum number of work items (e.g. collection copies) that will be + :vartype min_free_memory_mb: int + :ivar max_parallelism: The maximum number of work items (e.g. collection copies) that will be processed in parallel. - :type max_parallelism: int + :vartype max_parallelism: int """ _attribute_map = { @@ -11210,6 +14757,17 @@ def __init__( max_parallelism: Optional[int] = None, **kwargs ): + """ + :keyword min_free_cpu: The percentage of CPU time that the migrator will try to avoid using, + from 0 to 100. + :paramtype min_free_cpu: int + :keyword min_free_memory_mb: The number of megabytes of RAM that the migrator will try to avoid + using. + :paramtype min_free_memory_mb: int + :keyword max_parallelism: The maximum number of work items (e.g. collection copies) that will + be processed in parallel. + :paramtype max_parallelism: int + """ super(MongoDbThrottlingSettings, self).__init__(**kwargs) self.min_free_cpu = min_free_cpu self.min_free_memory_mb = min_free_memory_mb @@ -11221,18 +14779,26 @@ class MySqlConnectionInfo(ConnectionInfo): All required parameters must be populated in order to send to Azure. - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param server_name: Required. Name of the server. - :type server_name: str - :param port: Required. Port for Server. - :type port: int - :param encrypt_connection: Whether to encrypt the connection. - :type encrypt_connection: bool + :ivar type: Required. Type of connection info.Constant filled by server. + :vartype type: str + :ivar user_name: User name. + :vartype user_name: str + :ivar password: Password credential. + :vartype password: str + :ivar server_name: Required. Name of the server. + :vartype server_name: str + :ivar data_source: Data source. + :vartype data_source: str + :ivar port: Required. Port for Server. + :vartype port: int + :ivar encrypt_connection: Whether to encrypt the connection. + :vartype encrypt_connection: bool + :ivar authentication: Authentication type to use for connection. Possible values include: + "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", + "ActiveDirectoryPassword". + :vartype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType + :ivar additional_settings: Additional connection settings. + :vartype additional_settings: str """ _validation = { @@ -11246,8 +14812,11 @@ class MySqlConnectionInfo(ConnectionInfo): 'user_name': {'key': 'userName', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, 'server_name': {'key': 'serverName', 'type': 'str'}, + 'data_source': {'key': 'dataSource', 'type': 'str'}, 'port': {'key': 'port', 'type': 'int'}, 'encrypt_connection': {'key': 'encryptConnection', 'type': 'bool'}, + 'authentication': {'key': 'authentication', 'type': 'str'}, + 'additional_settings': {'key': 'additionalSettings', 'type': 'str'}, } def __init__( @@ -11257,23 +14826,49 @@ def __init__( port: int, user_name: Optional[str] = None, password: Optional[str] = None, + data_source: Optional[str] = None, encrypt_connection: Optional[bool] = True, + authentication: Optional[Union[str, "AuthenticationType"]] = None, + additional_settings: Optional[str] = None, **kwargs ): + """ + :keyword user_name: User name. + :paramtype user_name: str + :keyword password: Password credential. + :paramtype password: str + :keyword server_name: Required. Name of the server. + :paramtype server_name: str + :keyword data_source: Data source. + :paramtype data_source: str + :keyword port: Required. Port for Server. + :paramtype port: int + :keyword encrypt_connection: Whether to encrypt the connection. + :paramtype encrypt_connection: bool + :keyword authentication: Authentication type to use for connection. Possible values include: + "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", + "ActiveDirectoryPassword". + :paramtype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType + :keyword additional_settings: Additional connection settings. + :paramtype additional_settings: str + """ super(MySqlConnectionInfo, self).__init__(user_name=user_name, password=password, **kwargs) self.type = 'MySqlConnectionInfo' # type: str self.server_name = server_name + self.data_source = data_source self.port = port self.encrypt_connection = encrypt_connection + self.authentication = authentication + self.additional_settings = additional_settings class NameAvailabilityRequest(msrest.serialization.Model): """A resource type and proposed name. - :param name: The proposed resource name. - :type name: str - :param type: The resource type chain (e.g. virtualMachines/extensions). - :type type: str + :ivar name: The proposed resource name. + :vartype name: str + :ivar type: The resource type chain (e.g. virtualMachines/extensions). + :vartype type: str """ _attribute_map = { @@ -11288,6 +14883,12 @@ def __init__( type: Optional[str] = None, **kwargs ): + """ + :keyword name: The proposed resource name. + :paramtype name: str + :keyword type: The resource type chain (e.g. virtualMachines/extensions). + :paramtype type: str + """ super(NameAvailabilityRequest, self).__init__(**kwargs) self.name = name self.type = type @@ -11296,14 +14897,14 @@ def __init__( class NameAvailabilityResponse(msrest.serialization.Model): """Indicates whether a proposed resource name is available. - :param name_available: If true, the name is valid and available. If false, 'reason' describes + :ivar name_available: If true, the name is valid and available. If false, 'reason' describes why not. - :type name_available: bool - :param reason: The reason why the name is not available, if nameAvailable is false. Possible + :vartype name_available: bool + :ivar reason: The reason why the name is not available, if nameAvailable is false. Possible values include: "AlreadyExists", "Invalid". - :type reason: str or ~azure.mgmt.datamigration.models.NameCheckFailureReason - :param message: The localized reason why the name is not available, if nameAvailable is false. - :type message: str + :vartype reason: str or ~azure.mgmt.datamigration.models.NameCheckFailureReason + :ivar message: The localized reason why the name is not available, if nameAvailable is false. + :vartype message: str """ _attribute_map = { @@ -11320,17 +14921,97 @@ def __init__( message: Optional[str] = None, **kwargs ): + """ + :keyword name_available: If true, the name is valid and available. If false, 'reason' describes + why not. + :paramtype name_available: bool + :keyword reason: The reason why the name is not available, if nameAvailable is false. Possible + values include: "AlreadyExists", "Invalid". + :paramtype reason: str or ~azure.mgmt.datamigration.models.NameCheckFailureReason + :keyword message: The localized reason why the name is not available, if nameAvailable is + false. + :paramtype message: str + """ super(NameAvailabilityResponse, self).__init__(**kwargs) self.name_available = name_available self.reason = reason self.message = message +class NodeMonitoringData(msrest.serialization.Model): + """NodeMonitoringData. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar additional_properties: Unmatched properties from the message are deserialized in this + collection. + :vartype additional_properties: dict[str, any] + :ivar node_name: Name of the integration runtime node. + :vartype node_name: str + :ivar available_memory_in_mb: Available memory (MB) on the integration runtime node. + :vartype available_memory_in_mb: int + :ivar cpu_utilization: CPU percentage on the integration runtime node. + :vartype cpu_utilization: int + :ivar concurrent_jobs_limit: Maximum concurrent jobs on the integration runtime node. + :vartype concurrent_jobs_limit: int + :ivar concurrent_jobs_running: The number of jobs currently running on the integration runtime + node. + :vartype concurrent_jobs_running: int + :ivar max_concurrent_jobs: The maximum concurrent jobs in this integration runtime. + :vartype max_concurrent_jobs: int + :ivar sent_bytes: Sent bytes on the integration runtime node. + :vartype sent_bytes: float + :ivar received_bytes: Received bytes on the integration runtime node. + :vartype received_bytes: float + """ + + _validation = { + 'additional_properties': {'readonly': True}, + 'node_name': {'readonly': True}, + 'available_memory_in_mb': {'readonly': True}, + 'cpu_utilization': {'readonly': True}, + 'concurrent_jobs_limit': {'readonly': True}, + 'concurrent_jobs_running': {'readonly': True}, + 'max_concurrent_jobs': {'readonly': True}, + 'sent_bytes': {'readonly': True}, + 'received_bytes': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': 'additionalProperties', 'type': '{object}'}, + 'node_name': {'key': 'nodeName', 'type': 'str'}, + 'available_memory_in_mb': {'key': 'availableMemoryInMB', 'type': 'int'}, + 'cpu_utilization': {'key': 'cpuUtilization', 'type': 'int'}, + 'concurrent_jobs_limit': {'key': 'concurrentJobsLimit', 'type': 'int'}, + 'concurrent_jobs_running': {'key': 'concurrentJobsRunning', 'type': 'int'}, + 'max_concurrent_jobs': {'key': 'maxConcurrentJobs', 'type': 'int'}, + 'sent_bytes': {'key': 'sentBytes', 'type': 'float'}, + 'received_bytes': {'key': 'receivedBytes', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(NodeMonitoringData, self).__init__(**kwargs) + self.additional_properties = None + self.node_name = None + self.available_memory_in_mb = None + self.cpu_utilization = None + self.concurrent_jobs_limit = None + self.concurrent_jobs_running = None + self.max_concurrent_jobs = None + self.sent_bytes = None + self.received_bytes = None + + class NonSqlDataMigrationTable(msrest.serialization.Model): """Defines metadata for table to be migrated. - :param source_name: Source table name. - :type source_name: str + :ivar source_name: Source table name. + :vartype source_name: str """ _attribute_map = { @@ -11343,6 +15024,10 @@ def __init__( source_name: Optional[str] = None, **kwargs ): + """ + :keyword source_name: Source table name. + :paramtype source_name: str + """ super(NonSqlDataMigrationTable, self).__init__(**kwargs) self.source_name = source_name @@ -11394,6 +15079,8 @@ def __init__( self, **kwargs ): + """ + """ super(NonSqlDataMigrationTableResult, self).__init__(**kwargs) self.result_code = None self.source_name = None @@ -11409,17 +15096,17 @@ class NonSqlMigrationTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_database_name: Required. Target database name. - :type target_database_name: str - :param project_name: Required. Name of the migration project. - :type project_name: str - :param project_location: Required. A URL that points to the drop location to access project + :ivar target_connection_info: Required. Information for connecting to target. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_database_name: Required. Target database name. + :vartype target_database_name: str + :ivar project_name: Required. Name of the migration project. + :vartype project_name: str + :ivar project_location: Required. A URL that points to the drop location to access project artifacts. - :type project_location: str - :param selected_tables: Required. Metadata of the tables selected for migration. - :type selected_tables: list[~azure.mgmt.datamigration.models.NonSqlDataMigrationTable] + :vartype project_location: str + :ivar selected_tables: Required. Metadata of the tables selected for migration. + :vartype selected_tables: list[~azure.mgmt.datamigration.models.NonSqlDataMigrationTable] """ _validation = { @@ -11448,6 +15135,19 @@ def __init__( selected_tables: List["NonSqlDataMigrationTable"], **kwargs ): + """ + :keyword target_connection_info: Required. Information for connecting to target. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_database_name: Required. Target database name. + :paramtype target_database_name: str + :keyword project_name: Required. Name of the migration project. + :paramtype project_name: str + :keyword project_location: Required. A URL that points to the drop location to access project + artifacts. + :paramtype project_location: str + :keyword selected_tables: Required. Metadata of the tables selected for migration. + :paramtype selected_tables: list[~azure.mgmt.datamigration.models.NonSqlDataMigrationTable] + """ super(NonSqlMigrationTaskInput, self).__init__(**kwargs) self.target_connection_info = target_connection_info self.target_database_name = target_database_name @@ -11508,6 +15208,8 @@ def __init__( self, **kwargs ): + """ + """ super(NonSqlMigrationTaskOutput, self).__init__(**kwargs) self.id = None self.started_on = None @@ -11522,13 +15224,13 @@ def __init__( class ODataError(msrest.serialization.Model): """Error information in OData format. - :param code: The machine-readable description of the error, such as 'InvalidRequest' or + :ivar code: The machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError'. - :type code: str - :param message: The human-readable description of the error. - :type message: str - :param details: Inner errors that caused this error. - :type details: list[~azure.mgmt.datamigration.models.ODataError] + :vartype code: str + :ivar message: The human-readable description of the error. + :vartype message: str + :ivar details: Inner errors that caused this error. + :vartype details: list[~azure.mgmt.datamigration.models.ODataError] """ _attribute_map = { @@ -11545,25 +15247,204 @@ def __init__( details: Optional[List["ODataError"]] = None, **kwargs ): + """ + :keyword code: The machine-readable description of the error, such as 'InvalidRequest' or + 'InternalServerError'. + :paramtype code: str + :keyword message: The human-readable description of the error. + :paramtype message: str + :keyword details: Inner errors that caused this error. + :paramtype details: list[~azure.mgmt.datamigration.models.ODataError] + """ super(ODataError, self).__init__(**kwargs) self.code = code self.message = message self.details = details +class OfflineConfiguration(msrest.serialization.Model): + """Offline configuration. + + :ivar offline: Offline migration. + :vartype offline: bool + :ivar last_backup_name: Last backup name for offline migration. This is optional for migrations + from file share. If it is not provided, then the service will determine the last backup file + name based on latest backup files present in file share. + :vartype last_backup_name: str + """ + + _attribute_map = { + 'offline': {'key': 'offline', 'type': 'bool'}, + 'last_backup_name': {'key': 'lastBackupName', 'type': 'str'}, + } + + def __init__( + self, + *, + offline: Optional[bool] = None, + last_backup_name: Optional[str] = None, + **kwargs + ): + """ + :keyword offline: Offline migration. + :paramtype offline: bool + :keyword last_backup_name: Last backup name for offline migration. This is optional for + migrations from file share. If it is not provided, then the service will determine the last + backup file name based on latest backup files present in file share. + :paramtype last_backup_name: str + """ + super(OfflineConfiguration, self).__init__(**kwargs) + self.offline = offline + self.last_backup_name = last_backup_name + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list SQL operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: + :vartype value: list[~azure.mgmt.datamigration.models.OperationsDefinition] + :ivar next_link: + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationsDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class OperationsDefinition(msrest.serialization.Model): + """OperationsDefinition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: + :vartype name: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + :ivar display: + :vartype display: ~azure.mgmt.datamigration.models.OperationsDisplayDefinition + :ivar origin: Possible values include: "user", "system". + :vartype origin: str or ~azure.mgmt.datamigration.models.OperationOrigin + :ivar properties: Dictionary of :code:``. + :vartype properties: dict[str, any] + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + 'origin': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationsDisplayDefinition'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__( + self, + *, + is_data_action: Optional[bool] = None, + **kwargs + ): + """ + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + """ + super(OperationsDefinition, self).__init__(**kwargs) + self.name = None + self.is_data_action = is_data_action + self.display = None + self.origin = None + self.properties = None + + +class OperationsDisplayDefinition(msrest.serialization.Model): + """OperationsDisplayDefinition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: + :vartype provider: str + :ivar resource: + :vartype resource: str + :ivar operation: + :vartype operation: str + :ivar description: + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(OperationsDisplayDefinition, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + class OracleConnectionInfo(ConnectionInfo): """Information for connecting to Oracle server. All required parameters must be populated in order to send to Azure. - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param data_source: Required. EZConnect or TNSName connection string. - :type data_source: str + :ivar type: Required. Type of connection info.Constant filled by server. + :vartype type: str + :ivar user_name: User name. + :vartype user_name: str + :ivar password: Password credential. + :vartype password: str + :ivar data_source: Required. EZConnect or TNSName connection string. + :vartype data_source: str + :ivar server_name: name of the server. + :vartype server_name: str + :ivar server_version: server version. + :vartype server_version: str + :ivar port: port for server. + :vartype port: int + :ivar authentication: Authentication type to use for connection. Possible values include: + "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", + "ActiveDirectoryPassword". + :vartype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType """ _validation = { @@ -11576,6 +15457,10 @@ class OracleConnectionInfo(ConnectionInfo): 'user_name': {'key': 'userName', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'server_version': {'key': 'serverVersion', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'authentication': {'key': 'authentication', 'type': 'str'}, } def __init__( @@ -11584,11 +15469,37 @@ def __init__( data_source: str, user_name: Optional[str] = None, password: Optional[str] = None, + server_name: Optional[str] = None, + server_version: Optional[str] = None, + port: Optional[int] = None, + authentication: Optional[Union[str, "AuthenticationType"]] = None, **kwargs ): + """ + :keyword user_name: User name. + :paramtype user_name: str + :keyword password: Password credential. + :paramtype password: str + :keyword data_source: Required. EZConnect or TNSName connection string. + :paramtype data_source: str + :keyword server_name: name of the server. + :paramtype server_name: str + :keyword server_version: server version. + :paramtype server_version: str + :keyword port: port for server. + :paramtype port: int + :keyword authentication: Authentication type to use for connection. Possible values include: + "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", + "ActiveDirectoryPassword". + :paramtype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType + """ super(OracleConnectionInfo, self).__init__(user_name=user_name, password=password, **kwargs) self.type = 'OracleConnectionInfo' # type: str self.data_source = data_source + self.server_name = server_name + self.server_version = server_version + self.port = port + self.authentication = authentication class OracleOCIDriverInfo(msrest.serialization.Model): @@ -11633,6 +15544,8 @@ def __init__( self, **kwargs ): + """ + """ super(OracleOCIDriverInfo, self).__init__(**kwargs) self.driver_name = None self.driver_size = None @@ -11645,10 +15558,10 @@ def __init__( class OrphanedUserInfo(msrest.serialization.Model): """Information of orphaned users on the SQL server database. - :param name: Name of the orphaned user. - :type name: str - :param database_name: Parent database of the user. - :type database_name: str + :ivar name: Name of the orphaned user. + :vartype name: str + :ivar database_name: Parent database of the user. + :vartype database_name: str """ _attribute_map = { @@ -11663,6 +15576,12 @@ def __init__( database_name: Optional[str] = None, **kwargs ): + """ + :keyword name: Name of the orphaned user. + :paramtype name: str + :keyword database_name: Parent database of the user. + :paramtype database_name: str + """ super(OrphanedUserInfo, self).__init__(**kwargs) self.name = name self.database_name = database_name @@ -11673,22 +15592,34 @@ class PostgreSqlConnectionInfo(ConnectionInfo): All required parameters must be populated in order to send to Azure. - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param server_name: Required. Name of the server. - :type server_name: str - :param database_name: Name of the database. - :type database_name: str - :param port: Required. Port for Server. - :type port: int - :param encrypt_connection: Whether to encrypt the connection. - :type encrypt_connection: bool - :param trust_server_certificate: Whether to trust the server certificate. - :type trust_server_certificate: bool + :ivar type: Required. Type of connection info.Constant filled by server. + :vartype type: str + :ivar user_name: User name. + :vartype user_name: str + :ivar password: Password credential. + :vartype password: str + :ivar server_name: Required. Name of the server. + :vartype server_name: str + :ivar data_source: Data source. + :vartype data_source: str + :ivar server_version: server version. + :vartype server_version: str + :ivar database_name: Name of the database. + :vartype database_name: str + :ivar port: Required. Port for Server. + :vartype port: int + :ivar encrypt_connection: Whether to encrypt the connection. + :vartype encrypt_connection: bool + :ivar trust_server_certificate: Whether to trust the server certificate. + :vartype trust_server_certificate: bool + :ivar additional_settings: Additional connection settings. + :vartype additional_settings: str + :ivar server_brand_version: server brand version. + :vartype server_brand_version: str + :ivar authentication: Authentication type to use for connection. Possible values include: + "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", + "ActiveDirectoryPassword". + :vartype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType """ _validation = { @@ -11702,10 +15633,15 @@ class PostgreSqlConnectionInfo(ConnectionInfo): 'user_name': {'key': 'userName', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, 'server_name': {'key': 'serverName', 'type': 'str'}, + 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'server_version': {'key': 'serverVersion', 'type': 'str'}, 'database_name': {'key': 'databaseName', 'type': 'str'}, 'port': {'key': 'port', 'type': 'int'}, 'encrypt_connection': {'key': 'encryptConnection', 'type': 'bool'}, 'trust_server_certificate': {'key': 'trustServerCertificate', 'type': 'bool'}, + 'additional_settings': {'key': 'additionalSettings', 'type': 'str'}, + 'server_brand_version': {'key': 'serverBrandVersion', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'str'}, } def __init__( @@ -11715,18 +15651,56 @@ def __init__( port: int, user_name: Optional[str] = None, password: Optional[str] = None, + data_source: Optional[str] = None, + server_version: Optional[str] = None, database_name: Optional[str] = None, encrypt_connection: Optional[bool] = True, trust_server_certificate: Optional[bool] = False, + additional_settings: Optional[str] = None, + server_brand_version: Optional[str] = None, + authentication: Optional[Union[str, "AuthenticationType"]] = None, **kwargs ): + """ + :keyword user_name: User name. + :paramtype user_name: str + :keyword password: Password credential. + :paramtype password: str + :keyword server_name: Required. Name of the server. + :paramtype server_name: str + :keyword data_source: Data source. + :paramtype data_source: str + :keyword server_version: server version. + :paramtype server_version: str + :keyword database_name: Name of the database. + :paramtype database_name: str + :keyword port: Required. Port for Server. + :paramtype port: int + :keyword encrypt_connection: Whether to encrypt the connection. + :paramtype encrypt_connection: bool + :keyword trust_server_certificate: Whether to trust the server certificate. + :paramtype trust_server_certificate: bool + :keyword additional_settings: Additional connection settings. + :paramtype additional_settings: str + :keyword server_brand_version: server brand version. + :paramtype server_brand_version: str + :keyword authentication: Authentication type to use for connection. Possible values include: + "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", + "ActiveDirectoryPassword". + :paramtype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType + """ super(PostgreSqlConnectionInfo, self).__init__(user_name=user_name, password=password, **kwargs) self.type = 'PostgreSqlConnectionInfo' # type: str self.server_name = server_name + self.data_source = data_source + self.server_version = server_version self.database_name = database_name self.port = port self.encrypt_connection = encrypt_connection self.trust_server_certificate = trust_server_certificate + self.additional_settings = additional_settings + self.server_brand_version = server_brand_version + self.authentication = authentication class Project(TrackedResource): @@ -11734,34 +15708,37 @@ class Project(TrackedResource): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. + :ivar location: + :vartype location: str + :ivar tags: A set of tags. Dictionary of :code:``. + :vartype tags: dict[str, str] + :ivar id: :vartype id: str - :ivar name: Resource name. + :ivar name: :vartype name: str - :ivar type: Resource type. + :ivar type: :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :ivar system_data: :vartype system_data: ~azure.mgmt.datamigration.models.SystemData - :param source_platform: Source platform for the project. Possible values include: "SQL", + :ivar etag: HTTP strong entity tag value. This is ignored if submitted. + :vartype etag: str + :ivar source_platform: Source platform for the project. Possible values include: "SQL", "MySQL", "PostgreSql", "MongoDb", "Unknown". - :type source_platform: str or ~azure.mgmt.datamigration.models.ProjectSourcePlatform - :param target_platform: Target platform for the project. Possible values include: "SQLDB", + :vartype source_platform: str or ~azure.mgmt.datamigration.models.ProjectSourcePlatform + :ivar azure_authentication_info: Field that defines the Azure active directory application + info, used to connect to the target Azure resource. + :vartype azure_authentication_info: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + :ivar target_platform: Target platform for the project. Possible values include: "SQLDB", "SQLMI", "AzureDbForMySql", "AzureDbForPostgreSql", "MongoDb", "Unknown". - :type target_platform: str or ~azure.mgmt.datamigration.models.ProjectTargetPlatform + :vartype target_platform: str or ~azure.mgmt.datamigration.models.ProjectTargetPlatform :ivar creation_time: UTC Date and time when project was created. :vartype creation_time: ~datetime.datetime - :param source_connection_info: Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.ConnectionInfo - :param target_connection_info: Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.ConnectionInfo - :param databases_info: List of DatabaseInfo. - :type databases_info: list[~azure.mgmt.datamigration.models.DatabaseInfo] + :ivar source_connection_info: Information for connecting to source. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.ConnectionInfo + :ivar target_connection_info: Information for connecting to target. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.ConnectionInfo + :ivar databases_info: List of DatabaseInfo. + :vartype databases_info: list[~azure.mgmt.datamigration.models.DatabaseInfo] :ivar provisioning_state: The project's provisioning state. Possible values include: "Deleting", "Succeeded". :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ProjectProvisioningState @@ -11771,20 +15748,21 @@ class Project(TrackedResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, 'system_data': {'readonly': True}, 'creation_time': {'readonly': True}, 'provisioning_state': {'readonly': True}, } _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'source_platform': {'key': 'properties.sourcePlatform', 'type': 'str'}, + 'azure_authentication_info': {'key': 'properties.azureAuthenticationInfo', 'type': 'AzureActiveDirectoryApp'}, 'target_platform': {'key': 'properties.targetPlatform', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, 'source_connection_info': {'key': 'properties.sourceConnectionInfo', 'type': 'ConnectionInfo'}, @@ -11796,17 +15774,44 @@ class Project(TrackedResource): def __init__( self, *, - location: str, + location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + etag: Optional[str] = None, source_platform: Optional[Union[str, "ProjectSourcePlatform"]] = None, + azure_authentication_info: Optional["AzureActiveDirectoryApp"] = None, target_platform: Optional[Union[str, "ProjectTargetPlatform"]] = None, source_connection_info: Optional["ConnectionInfo"] = None, target_connection_info: Optional["ConnectionInfo"] = None, databases_info: Optional[List["DatabaseInfo"]] = None, **kwargs ): - super(Project, self).__init__(tags=tags, location=location, **kwargs) + """ + :keyword location: + :paramtype location: str + :keyword tags: A set of tags. Dictionary of :code:``. + :paramtype tags: dict[str, str] + :keyword etag: HTTP strong entity tag value. This is ignored if submitted. + :paramtype etag: str + :keyword source_platform: Source platform for the project. Possible values include: "SQL", + "MySQL", "PostgreSql", "MongoDb", "Unknown". + :paramtype source_platform: str or ~azure.mgmt.datamigration.models.ProjectSourcePlatform + :keyword azure_authentication_info: Field that defines the Azure active directory application + info, used to connect to the target Azure resource. + :paramtype azure_authentication_info: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + :keyword target_platform: Target platform for the project. Possible values include: "SQLDB", + "SQLMI", "AzureDbForMySql", "AzureDbForPostgreSql", "MongoDb", "Unknown". + :paramtype target_platform: str or ~azure.mgmt.datamigration.models.ProjectTargetPlatform + :keyword source_connection_info: Information for connecting to source. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.ConnectionInfo + :keyword target_connection_info: Information for connecting to target. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.ConnectionInfo + :keyword databases_info: List of DatabaseInfo. + :paramtype databases_info: list[~azure.mgmt.datamigration.models.DatabaseInfo] + """ + super(Project, self).__init__(location=location, tags=tags, **kwargs) + self.etag = etag self.source_platform = source_platform + self.azure_authentication_info = azure_authentication_info self.target_platform = target_platform self.creation_time = None self.source_connection_info = source_connection_info @@ -11815,6 +15820,43 @@ def __init__( self.provisioning_state = None +class Resource(msrest.serialization.Model): + """ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + class ProjectFile(Resource): """A file resource. @@ -11826,10 +15868,10 @@ class ProjectFile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param etag: HTTP strong entity tag value. This is ignored if submitted. - :type etag: str - :param properties: Custom file properties. - :type properties: ~azure.mgmt.datamigration.models.ProjectFileProperties + :ivar etag: HTTP strong entity tag value. This is ignored if submitted. + :vartype etag: str + :ivar properties: Custom file properties. + :vartype properties: ~azure.mgmt.datamigration.models.ProjectFileProperties :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.datamigration.models.SystemData """ @@ -11857,6 +15899,12 @@ def __init__( properties: Optional["ProjectFileProperties"] = None, **kwargs ): + """ + :keyword etag: HTTP strong entity tag value. This is ignored if submitted. + :paramtype etag: str + :keyword properties: Custom file properties. + :paramtype properties: ~azure.mgmt.datamigration.models.ProjectFileProperties + """ super(ProjectFile, self).__init__(**kwargs) self.etag = etag self.properties = properties @@ -11868,17 +15916,17 @@ class ProjectFileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param extension: Optional File extension. If submitted it should not have a leading period and + :ivar extension: Optional File extension. If submitted it should not have a leading period and must match the extension from filePath. - :type extension: str - :param file_path: Relative path of this file resource. This property can be set when creating - or updating the file resource. - :type file_path: str + :vartype extension: str + :ivar file_path: Relative path of this file resource. This property can be set when creating or + updating the file resource. + :vartype file_path: str :ivar last_modified: Modification DateTime. :vartype last_modified: ~datetime.datetime - :param media_type: File content type. This property can be modified to reflect the file content + :ivar media_type: File content type. This property can be modified to reflect the file content type. - :type media_type: str + :vartype media_type: str :ivar size: File size. :vartype size: long """ @@ -11904,6 +15952,17 @@ def __init__( media_type: Optional[str] = None, **kwargs ): + """ + :keyword extension: Optional File extension. If submitted it should not have a leading period + and must match the extension from filePath. + :paramtype extension: str + :keyword file_path: Relative path of this file resource. This property can be set when creating + or updating the file resource. + :paramtype file_path: str + :keyword media_type: File content type. This property can be modified to reflect the file + content type. + :paramtype media_type: str + """ super(ProjectFileProperties, self).__init__(**kwargs) self.extension = extension self.file_path = file_path @@ -11915,10 +15974,10 @@ def __init__( class ProjectList(msrest.serialization.Model): """OData page of project resources. - :param value: List of projects. - :type value: list[~azure.mgmt.datamigration.models.Project] - :param next_link: URL to load the next page of projects. - :type next_link: str + :ivar value: List of projects. + :vartype value: list[~azure.mgmt.datamigration.models.Project] + :ivar next_link: URL to load the next page of projects. + :vartype next_link: str """ _attribute_map = { @@ -11933,6 +15992,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of projects. + :paramtype value: list[~azure.mgmt.datamigration.models.Project] + :keyword next_link: URL to load the next page of projects. + :paramtype next_link: str + """ super(ProjectList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -11949,10 +16014,10 @@ class ProjectTask(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param etag: HTTP strong entity tag value. This is ignored if submitted. - :type etag: str - :param properties: Custom task properties. - :type properties: ~azure.mgmt.datamigration.models.ProjectTaskProperties + :ivar etag: HTTP strong entity tag value. This is ignored if submitted. + :vartype etag: str + :ivar properties: Custom task properties. + :vartype properties: ~azure.mgmt.datamigration.models.ProjectTaskProperties :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.datamigration.models.SystemData """ @@ -11980,6 +16045,12 @@ def __init__( properties: Optional["ProjectTaskProperties"] = None, **kwargs ): + """ + :keyword etag: HTTP strong entity tag value. This is ignored if submitted. + :paramtype etag: str + :keyword properties: Custom task properties. + :paramtype properties: ~azure.mgmt.datamigration.models.ProjectTaskProperties + """ super(ProjectTask, self).__init__(**kwargs) self.etag = etag self.properties = properties @@ -11989,10 +16060,10 @@ def __init__( class QueryAnalysisValidationResult(msrest.serialization.Model): """Results for query analysis comparison between the source and target. - :param query_results: List of queries executed and it's execution results in source and target. - :type query_results: ~azure.mgmt.datamigration.models.QueryExecutionResult - :param validation_errors: Errors that are part of the execution. - :type validation_errors: ~azure.mgmt.datamigration.models.ValidationError + :ivar query_results: List of queries executed and it's execution results in source and target. + :vartype query_results: ~azure.mgmt.datamigration.models.QueryExecutionResult + :ivar validation_errors: Errors that are part of the execution. + :vartype validation_errors: ~azure.mgmt.datamigration.models.ValidationError """ _attribute_map = { @@ -12007,6 +16078,13 @@ def __init__( validation_errors: Optional["ValidationError"] = None, **kwargs ): + """ + :keyword query_results: List of queries executed and it's execution results in source and + target. + :paramtype query_results: ~azure.mgmt.datamigration.models.QueryExecutionResult + :keyword validation_errors: Errors that are part of the execution. + :paramtype validation_errors: ~azure.mgmt.datamigration.models.ValidationError + """ super(QueryAnalysisValidationResult, self).__init__(**kwargs) self.query_results = query_results self.validation_errors = validation_errors @@ -12015,14 +16093,14 @@ def __init__( class QueryExecutionResult(msrest.serialization.Model): """Describes query analysis results for execution in source and target. - :param query_text: Query text retrieved from the source server. - :type query_text: str - :param statements_in_batch: Total no. of statements in the batch. - :type statements_in_batch: long - :param source_result: Query analysis result from the source. - :type source_result: ~azure.mgmt.datamigration.models.ExecutionStatistics - :param target_result: Query analysis result from the target. - :type target_result: ~azure.mgmt.datamigration.models.ExecutionStatistics + :ivar query_text: Query text retrieved from the source server. + :vartype query_text: str + :ivar statements_in_batch: Total no. of statements in the batch. + :vartype statements_in_batch: long + :ivar source_result: Query analysis result from the source. + :vartype source_result: ~azure.mgmt.datamigration.models.ExecutionStatistics + :ivar target_result: Query analysis result from the target. + :vartype target_result: ~azure.mgmt.datamigration.models.ExecutionStatistics """ _attribute_map = { @@ -12041,6 +16119,16 @@ def __init__( target_result: Optional["ExecutionStatistics"] = None, **kwargs ): + """ + :keyword query_text: Query text retrieved from the source server. + :paramtype query_text: str + :keyword statements_in_batch: Total no. of statements in the batch. + :paramtype statements_in_batch: long + :keyword source_result: Query analysis result from the source. + :paramtype source_result: ~azure.mgmt.datamigration.models.ExecutionStatistics + :keyword target_result: Query analysis result from the target. + :paramtype target_result: ~azure.mgmt.datamigration.models.ExecutionStatistics + """ super(QueryExecutionResult, self).__init__(**kwargs) self.query_text = query_text self.statements_in_batch = statements_in_batch @@ -12051,18 +16139,18 @@ def __init__( class Quota(msrest.serialization.Model): """Describes a quota for or usage details about a resource. - :param current_value: The current value of the quota. If null or missing, the current value + :ivar current_value: The current value of the quota. If null or missing, the current value cannot be determined in the context of the request. - :type current_value: float - :param id: The resource ID of the quota object. - :type id: str - :param limit: The maximum value of the quota. If null or missing, the quota has no maximum, in + :vartype current_value: float + :ivar id: The resource ID of the quota object. + :vartype id: str + :ivar limit: The maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage. - :type limit: float - :param name: The name of the quota. - :type name: ~azure.mgmt.datamigration.models.QuotaName - :param unit: The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. - :type unit: str + :vartype limit: float + :ivar name: The name of the quota. + :vartype name: ~azure.mgmt.datamigration.models.QuotaName + :ivar unit: The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + :vartype unit: str """ _attribute_map = { @@ -12083,6 +16171,20 @@ def __init__( unit: Optional[str] = None, **kwargs ): + """ + :keyword current_value: The current value of the quota. If null or missing, the current value + cannot be determined in the context of the request. + :paramtype current_value: float + :keyword id: The resource ID of the quota object. + :paramtype id: str + :keyword limit: The maximum value of the quota. If null or missing, the quota has no maximum, + in which case it merely tracks usage. + :paramtype limit: float + :keyword name: The name of the quota. + :paramtype name: ~azure.mgmt.datamigration.models.QuotaName + :keyword unit: The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + :paramtype unit: str + """ super(Quota, self).__init__(**kwargs) self.current_value = current_value self.id = id @@ -12094,11 +16196,11 @@ def __init__( class QuotaList(msrest.serialization.Model): """OData page of quota objects. - :param value: List of quotas. - :type value: list[~azure.mgmt.datamigration.models.Quota] - :param next_link: URL to load the next page of quotas, or null or missing if this is the last + :ivar value: List of quotas. + :vartype value: list[~azure.mgmt.datamigration.models.Quota] + :ivar next_link: URL to load the next page of quotas, or null or missing if this is the last page. - :type next_link: str + :vartype next_link: str """ _attribute_map = { @@ -12113,6 +16215,13 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of quotas. + :paramtype value: list[~azure.mgmt.datamigration.models.Quota] + :keyword next_link: URL to load the next page of quotas, or null or missing if this is the last + page. + :paramtype next_link: str + """ super(QuotaList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -12121,10 +16230,10 @@ def __init__( class QuotaName(msrest.serialization.Model): """The name of the quota. - :param localized_value: The localized name of the quota. - :type localized_value: str - :param value: The unlocalized name (or ID) of the quota. - :type value: str + :ivar localized_value: The localized name of the quota. + :vartype localized_value: str + :ivar value: The unlocalized name (or ID) of the quota. + :vartype value: str """ _attribute_map = { @@ -12139,26 +16248,71 @@ def __init__( value: Optional[str] = None, **kwargs ): + """ + :keyword localized_value: The localized name of the quota. + :paramtype localized_value: str + :keyword value: The unlocalized name (or ID) of the quota. + :paramtype value: str + """ super(QuotaName, self).__init__(**kwargs) self.localized_value = localized_value self.value = value +class RegenAuthKeys(msrest.serialization.Model): + """An authentication key to regenerate. + + :ivar key_name: The name of authentication key to generate. + :vartype key_name: str + :ivar auth_key1: The first authentication key. + :vartype auth_key1: str + :ivar auth_key2: The second authentication key. + :vartype auth_key2: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'auth_key1': {'key': 'authKey1', 'type': 'str'}, + 'auth_key2': {'key': 'authKey2', 'type': 'str'}, + } + + def __init__( + self, + *, + key_name: Optional[str] = None, + auth_key1: Optional[str] = None, + auth_key2: Optional[str] = None, + **kwargs + ): + """ + :keyword key_name: The name of authentication key to generate. + :paramtype key_name: str + :keyword auth_key1: The first authentication key. + :paramtype auth_key1: str + :keyword auth_key2: The second authentication key. + :paramtype auth_key2: str + """ + super(RegenAuthKeys, self).__init__(**kwargs) + self.key_name = key_name + self.auth_key1 = auth_key1 + self.auth_key2 = auth_key2 + + class ReportableException(msrest.serialization.Model): """Exception object for all custom exceptions. - :param message: Error message. - :type message: str - :param actionable_message: Actionable steps for this exception. - :type actionable_message: str - :param file_path: The path to the file where exception occurred. - :type file_path: str - :param line_number: The line number where exception occurred. - :type line_number: str - :param h_result: Coded numerical value that is assigned to a specific exception. - :type h_result: int - :param stack_trace: Stack trace. - :type stack_trace: str + :ivar message: Error message. + :vartype message: str + :ivar actionable_message: Actionable steps for this exception. + :vartype actionable_message: str + :ivar file_path: The path to the file where exception occurred. + :vartype file_path: str + :ivar line_number: The line number where exception occurred. + :vartype line_number: str + :ivar h_result: Coded numerical value that is assigned to a specific exception. + :vartype h_result: int + :ivar stack_trace: Stack trace. + :vartype stack_trace: str """ _attribute_map = { @@ -12181,6 +16335,20 @@ def __init__( stack_trace: Optional[str] = None, **kwargs ): + """ + :keyword message: Error message. + :paramtype message: str + :keyword actionable_message: Actionable steps for this exception. + :paramtype actionable_message: str + :keyword file_path: The path to the file where exception occurred. + :paramtype file_path: str + :keyword line_number: The line number where exception occurred. + :paramtype line_number: str + :keyword h_result: Coded numerical value that is assigned to a specific exception. + :paramtype h_result: int + :keyword stack_trace: Stack trace. + :paramtype stack_trace: str + """ super(ReportableException, self).__init__(**kwargs) self.message = message self.actionable_message = actionable_message @@ -12256,6 +16424,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResourceSku, self).__init__(**kwargs) self.resource_type = None self.name = None @@ -12296,6 +16466,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResourceSkuCapabilities, self).__init__(**kwargs) self.name = None self.value = None @@ -12335,6 +16507,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResourceSkuCapacity, self).__init__(**kwargs) self.minimum = None self.maximum = None @@ -12371,6 +16545,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResourceSkuCosts, self).__init__(**kwargs) self.meter_id = None self.quantity = None @@ -12408,6 +16584,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResourceSkuRestrictions, self).__init__(**kwargs) self.type = None self.values = None @@ -12419,11 +16597,11 @@ class ResourceSkusResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param value: Required. The list of SKUs available for the subscription. - :type value: list[~azure.mgmt.datamigration.models.ResourceSku] - :param next_link: The uri to fetch the next page of DMS SKUs. Call ListNext() with this to - fetch the next page of DMS SKUs. - :type next_link: str + :ivar value: Required. The list of SKUs available for the subscription. + :vartype value: list[~azure.mgmt.datamigration.models.ResourceSku] + :ivar next_link: The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch + the next page of DMS SKUs. + :vartype next_link: str """ _validation = { @@ -12442,6 +16620,13 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: Required. The list of SKUs available for the subscription. + :paramtype value: list[~azure.mgmt.datamigration.models.ResourceSku] + :keyword next_link: The uri to fetch the next page of DMS SKUs. Call ListNext() with this to + fetch the next page of DMS SKUs. + :paramtype next_link: str + """ super(ResourceSkusResult, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -12450,15 +16635,16 @@ def __init__( class SchemaComparisonValidationResult(msrest.serialization.Model): """Results for schema comparison between the source and target. - :param schema_differences: List of schema differences between the source and target databases. - :type schema_differences: ~azure.mgmt.datamigration.models.SchemaComparisonValidationResultType - :param validation_errors: List of errors that happened while performing schema compare + :ivar schema_differences: List of schema differences between the source and target databases. + :vartype schema_differences: + ~azure.mgmt.datamigration.models.SchemaComparisonValidationResultType + :ivar validation_errors: List of errors that happened while performing schema compare validation. - :type validation_errors: ~azure.mgmt.datamigration.models.ValidationError - :param source_database_object_count: Count of source database objects. - :type source_database_object_count: dict[str, long] - :param target_database_object_count: Count of target database objects. - :type target_database_object_count: dict[str, long] + :vartype validation_errors: ~azure.mgmt.datamigration.models.ValidationError + :ivar source_database_object_count: Count of source database objects. + :vartype source_database_object_count: dict[str, long] + :ivar target_database_object_count: Count of target database objects. + :vartype target_database_object_count: dict[str, long] """ _attribute_map = { @@ -12477,6 +16663,19 @@ def __init__( target_database_object_count: Optional[Dict[str, int]] = None, **kwargs ): + """ + :keyword schema_differences: List of schema differences between the source and target + databases. + :paramtype schema_differences: + ~azure.mgmt.datamigration.models.SchemaComparisonValidationResultType + :keyword validation_errors: List of errors that happened while performing schema compare + validation. + :paramtype validation_errors: ~azure.mgmt.datamigration.models.ValidationError + :keyword source_database_object_count: Count of source database objects. + :paramtype source_database_object_count: dict[str, long] + :keyword target_database_object_count: Count of target database objects. + :paramtype target_database_object_count: dict[str, long] + """ super(SchemaComparisonValidationResult, self).__init__(**kwargs) self.schema_differences = schema_differences self.validation_errors = validation_errors @@ -12487,15 +16686,15 @@ def __init__( class SchemaComparisonValidationResultType(msrest.serialization.Model): """Description about the errors happen while performing migration validation. - :param object_name: Name of the object that has the difference. - :type object_name: str - :param object_type: Type of the object that has the difference. e.g + :ivar object_name: Name of the object that has the difference. + :vartype object_name: str + :ivar object_type: Type of the object that has the difference. e.g (Table/View/StoredProcedure). Possible values include: "StoredProcedures", "Table", "User", "View", "Function". - :type object_type: str or ~azure.mgmt.datamigration.models.ObjectType - :param update_action: Update action type with respect to target. Possible values include: + :vartype object_type: str or ~azure.mgmt.datamigration.models.ObjectType + :ivar update_action: Update action type with respect to target. Possible values include: "DeletedOnTarget", "ChangedOnTarget", "AddedOnTarget". - :type update_action: str or ~azure.mgmt.datamigration.models.UpdateActionType + :vartype update_action: str or ~azure.mgmt.datamigration.models.UpdateActionType """ _attribute_map = { @@ -12512,6 +16711,17 @@ def __init__( update_action: Optional[Union[str, "UpdateActionType"]] = None, **kwargs ): + """ + :keyword object_name: Name of the object that has the difference. + :paramtype object_name: str + :keyword object_type: Type of the object that has the difference. e.g + (Table/View/StoredProcedure). Possible values include: "StoredProcedures", "Table", "User", + "View", "Function". + :paramtype object_type: str or ~azure.mgmt.datamigration.models.ObjectType + :keyword update_action: Update action type with respect to target. Possible values include: + "DeletedOnTarget", "ChangedOnTarget", "AddedOnTarget". + :paramtype update_action: str or ~azure.mgmt.datamigration.models.UpdateActionType + """ super(SchemaComparisonValidationResultType, self).__init__(**kwargs) self.object_name = object_name self.object_type = object_type @@ -12521,16 +16731,19 @@ def __init__( class SchemaMigrationSetting(msrest.serialization.Model): """Settings for migrating schema from source to target. - :param schema_option: Option on how to migrate the schema. Possible values include: "None", + :ivar schema_option: Option on how to migrate the schema. Possible values include: "None", "ExtractFromSource", "UseStorageFile". - :type schema_option: str or ~azure.mgmt.datamigration.models.SchemaMigrationOption - :param file_id: Resource Identifier of a file resource containing the uploaded schema file. - :type file_id: str + :vartype schema_option: str or ~azure.mgmt.datamigration.models.SchemaMigrationOption + :ivar file_id: Resource Identifier of a file resource containing the uploaded schema file. + :vartype file_id: str + :ivar file_name: Name of the file resource containing the uploaded schema file. + :vartype file_name: str """ _attribute_map = { 'schema_option': {'key': 'schemaOption', 'type': 'str'}, 'file_id': {'key': 'fileId', 'type': 'str'}, + 'file_name': {'key': 'fileName', 'type': 'str'}, } def __init__( @@ -12538,11 +16751,22 @@ def __init__( *, schema_option: Optional[Union[str, "SchemaMigrationOption"]] = None, file_id: Optional[str] = None, - **kwargs - ): + file_name: Optional[str] = None, + **kwargs + ): + """ + :keyword schema_option: Option on how to migrate the schema. Possible values include: "None", + "ExtractFromSource", "UseStorageFile". + :paramtype schema_option: str or ~azure.mgmt.datamigration.models.SchemaMigrationOption + :keyword file_id: Resource Identifier of a file resource containing the uploaded schema file. + :paramtype file_id: str + :keyword file_name: Name of the file resource containing the uploaded schema file. + :paramtype file_name: str + """ super(SchemaMigrationSetting, self).__init__(**kwargs) self.schema_option = schema_option self.file_id = file_id + self.file_name = file_name class SelectedCertificateInput(msrest.serialization.Model): @@ -12550,10 +16774,10 @@ class SelectedCertificateInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param certificate_name: Required. Name of certificate to be exported. - :type certificate_name: str - :param password: Required. Password to use for encrypting the exported certificate. - :type password: str + :ivar certificate_name: Required. Name of certificate to be exported. + :vartype certificate_name: str + :ivar password: Required. Password to use for encrypting the exported certificate. + :vartype password: str """ _validation = { @@ -12573,6 +16797,12 @@ def __init__( password: str, **kwargs ): + """ + :keyword certificate_name: Required. Name of certificate to be exported. + :paramtype certificate_name: str + :keyword password: Required. Password to use for encrypting the exported certificate. + :paramtype password: str + """ super(SelectedCertificateInput, self).__init__(**kwargs) self.certificate_name = certificate_name self.password = password @@ -12619,6 +16849,8 @@ def __init__( self, **kwargs ): + """ + """ super(ServerProperties, self).__init__(**kwargs) self.server_platform = None self.server_name = None @@ -12631,10 +16863,10 @@ def __init__( class ServiceOperation(msrest.serialization.Model): """Description of an action supported by the Database Migration Service. - :param name: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. - :type name: str - :param display: Localized display text. - :type display: ~azure.mgmt.datamigration.models.ServiceOperationDisplay + :ivar name: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. + :vartype name: str + :ivar display: Localized display text. + :vartype display: ~azure.mgmt.datamigration.models.ServiceOperationDisplay """ _attribute_map = { @@ -12649,6 +16881,12 @@ def __init__( display: Optional["ServiceOperationDisplay"] = None, **kwargs ): + """ + :keyword name: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. + :paramtype name: str + :keyword display: Localized display text. + :paramtype display: ~azure.mgmt.datamigration.models.ServiceOperationDisplay + """ super(ServiceOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -12657,14 +16895,14 @@ def __init__( class ServiceOperationDisplay(msrest.serialization.Model): """Localized display text. - :param provider: The localized resource provider name. - :type provider: str - :param resource: The localized resource type name. - :type resource: str - :param operation: The localized operation name. - :type operation: str - :param description: The localized operation description. - :type description: str + :ivar provider: The localized resource provider name. + :vartype provider: str + :ivar resource: The localized resource type name. + :vartype resource: str + :ivar operation: The localized operation name. + :vartype operation: str + :ivar description: The localized operation description. + :vartype description: str """ _attribute_map = { @@ -12683,6 +16921,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword provider: The localized resource provider name. + :paramtype provider: str + :keyword resource: The localized resource type name. + :paramtype resource: str + :keyword operation: The localized operation name. + :paramtype operation: str + :keyword description: The localized operation description. + :paramtype description: str + """ super(ServiceOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -12693,10 +16941,10 @@ def __init__( class ServiceOperationList(msrest.serialization.Model): """OData page of action (operation) objects. - :param value: List of actions. - :type value: list[~azure.mgmt.datamigration.models.ServiceOperation] - :param next_link: URL to load the next page of actions. - :type next_link: str + :ivar value: List of actions. + :vartype value: list[~azure.mgmt.datamigration.models.ServiceOperation] + :ivar next_link: URL to load the next page of actions. + :vartype next_link: str """ _attribute_map = { @@ -12711,6 +16959,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of actions. + :paramtype value: list[~azure.mgmt.datamigration.models.ServiceOperation] + :keyword next_link: URL to load the next page of actions. + :paramtype next_link: str + """ super(ServiceOperationList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -12719,18 +16973,18 @@ def __init__( class ServiceSku(msrest.serialization.Model): """An Azure SKU instance. - :param name: The unique name of the SKU, such as 'P3'. - :type name: str - :param tier: The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'. - :type tier: str - :param family: The SKU family, used when the service has multiple performance classes within a + :ivar name: The unique name of the SKU, such as 'P3'. + :vartype name: str + :ivar tier: The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'. + :vartype tier: str + :ivar family: The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines. - :type family: str - :param size: The size of the SKU, used when the name alone does not denote a service size or + :vartype family: str + :ivar size: The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines. - :type size: str - :param capacity: The capacity of the SKU, if it supports scaling. - :type capacity: int + :vartype size: str + :ivar capacity: The capacity of the SKU, if it supports scaling. + :vartype capacity: int """ _attribute_map = { @@ -12751,6 +17005,20 @@ def __init__( capacity: Optional[int] = None, **kwargs ): + """ + :keyword name: The unique name of the SKU, such as 'P3'. + :paramtype name: str + :keyword tier: The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'. + :paramtype tier: str + :keyword family: The SKU family, used when the service has multiple performance classes within + a tier, such as 'A', 'D', etc. for virtual machines. + :paramtype family: str + :keyword size: The size of the SKU, used when the name alone does not denote a service size or + when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines. + :paramtype size: str + :keyword capacity: The capacity of the SKU, if it supports scaling. + :paramtype capacity: int + """ super(ServiceSku, self).__init__(**kwargs) self.name = name self.tier = tier @@ -12762,10 +17030,10 @@ def __init__( class ServiceSkuList(msrest.serialization.Model): """OData page of available SKUs. - :param value: List of service SKUs. - :type value: list[~azure.mgmt.datamigration.models.AvailableServiceSku] - :param next_link: URL to load the next page of service SKUs. - :type next_link: str + :ivar value: List of service SKUs. + :vartype value: list[~azure.mgmt.datamigration.models.AvailableServiceSku] + :ivar next_link: URL to load the next page of service SKUs. + :vartype next_link: str """ _attribute_map = { @@ -12780,37 +17048,236 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of service SKUs. + :paramtype value: list[~azure.mgmt.datamigration.models.AvailableServiceSku] + :keyword next_link: URL to load the next page of service SKUs. + :paramtype next_link: str + """ super(ServiceSkuList, self).__init__(**kwargs) self.value = value self.next_link = next_link +class SourceLocation(msrest.serialization.Model): + """Source Location details of backups. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar file_share: Source File share. + :vartype file_share: ~azure.mgmt.datamigration.models.SqlFileShare + :ivar azure_blob: Source Azure Blob. + :vartype azure_blob: ~azure.mgmt.datamigration.models.AzureBlob + :ivar file_storage_type: Backup storage Type. + :vartype file_storage_type: str + """ + + _validation = { + 'file_storage_type': {'readonly': True}, + } + + _attribute_map = { + 'file_share': {'key': 'fileShare', 'type': 'SqlFileShare'}, + 'azure_blob': {'key': 'azureBlob', 'type': 'AzureBlob'}, + 'file_storage_type': {'key': 'fileStorageType', 'type': 'str'}, + } + + def __init__( + self, + *, + file_share: Optional["SqlFileShare"] = None, + azure_blob: Optional["AzureBlob"] = None, + **kwargs + ): + """ + :keyword file_share: Source File share. + :paramtype file_share: ~azure.mgmt.datamigration.models.SqlFileShare + :keyword azure_blob: Source Azure Blob. + :paramtype azure_blob: ~azure.mgmt.datamigration.models.AzureBlob + """ + super(SourceLocation, self).__init__(**kwargs) + self.file_share = file_share + self.azure_blob = azure_blob + self.file_storage_type = None + + +class SqlBackupFileInfo(msrest.serialization.Model): + """Information of backup file. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar file_name: File name. + :vartype file_name: str + :ivar status: Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or + Skipped). + :vartype status: str + :ivar total_size: File size in bytes. + :vartype total_size: long + :ivar data_read: Bytes read. + :vartype data_read: long + :ivar data_written: Bytes written. + :vartype data_written: long + :ivar copy_throughput: Copy throughput in KBps. + :vartype copy_throughput: float + :ivar copy_duration: Copy Duration in seconds. + :vartype copy_duration: int + :ivar family_sequence_number: Media family sequence number. + :vartype family_sequence_number: int + """ + + _validation = { + 'file_name': {'readonly': True}, + 'status': {'readonly': True}, + 'total_size': {'readonly': True}, + 'data_read': {'readonly': True}, + 'data_written': {'readonly': True}, + 'copy_throughput': {'readonly': True}, + 'copy_duration': {'readonly': True}, + 'family_sequence_number': {'readonly': True}, + } + + _attribute_map = { + 'file_name': {'key': 'fileName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'total_size': {'key': 'totalSize', 'type': 'long'}, + 'data_read': {'key': 'dataRead', 'type': 'long'}, + 'data_written': {'key': 'dataWritten', 'type': 'long'}, + 'copy_throughput': {'key': 'copyThroughput', 'type': 'float'}, + 'copy_duration': {'key': 'copyDuration', 'type': 'int'}, + 'family_sequence_number': {'key': 'familySequenceNumber', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SqlBackupFileInfo, self).__init__(**kwargs) + self.file_name = None + self.status = None + self.total_size = None + self.data_read = None + self.data_written = None + self.copy_throughput = None + self.copy_duration = None + self.family_sequence_number = None + + +class SqlBackupSetInfo(msrest.serialization.Model): + """Information of backup set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar backup_set_id: Backup set id. + :vartype backup_set_id: str + :ivar first_lsn: First LSN of the backup set. + :vartype first_lsn: str + :ivar last_lsn: Last LSN of the backup set. + :vartype last_lsn: str + :ivar backup_type: Backup type. + :vartype backup_type: str + :ivar list_of_backup_files: List of files in the backup set. + :vartype list_of_backup_files: list[~azure.mgmt.datamigration.models.SqlBackupFileInfo] + :ivar backup_start_date: Backup start date. + :vartype backup_start_date: ~datetime.datetime + :ivar backup_finish_date: Backup end time. + :vartype backup_finish_date: ~datetime.datetime + :ivar is_backup_restored: Whether this backup set has been restored or not. + :vartype is_backup_restored: bool + :ivar has_backup_checksums: Has Backup Checksums. + :vartype has_backup_checksums: bool + :ivar family_count: Media family count. + :vartype family_count: int + :ivar ignore_reasons: The reasons why the backup set is ignored. + :vartype ignore_reasons: list[str] + """ + + _validation = { + 'backup_set_id': {'readonly': True}, + 'first_lsn': {'readonly': True}, + 'last_lsn': {'readonly': True}, + 'backup_type': {'readonly': True}, + 'list_of_backup_files': {'readonly': True}, + 'backup_start_date': {'readonly': True}, + 'backup_finish_date': {'readonly': True}, + 'is_backup_restored': {'readonly': True}, + 'has_backup_checksums': {'readonly': True}, + 'family_count': {'readonly': True}, + 'ignore_reasons': {'readonly': True}, + } + + _attribute_map = { + 'backup_set_id': {'key': 'backupSetId', 'type': 'str'}, + 'first_lsn': {'key': 'firstLSN', 'type': 'str'}, + 'last_lsn': {'key': 'lastLSN', 'type': 'str'}, + 'backup_type': {'key': 'backupType', 'type': 'str'}, + 'list_of_backup_files': {'key': 'listOfBackupFiles', 'type': '[SqlBackupFileInfo]'}, + 'backup_start_date': {'key': 'backupStartDate', 'type': 'iso-8601'}, + 'backup_finish_date': {'key': 'backupFinishDate', 'type': 'iso-8601'}, + 'is_backup_restored': {'key': 'isBackupRestored', 'type': 'bool'}, + 'has_backup_checksums': {'key': 'hasBackupChecksums', 'type': 'bool'}, + 'family_count': {'key': 'familyCount', 'type': 'int'}, + 'ignore_reasons': {'key': 'ignoreReasons', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SqlBackupSetInfo, self).__init__(**kwargs) + self.backup_set_id = None + self.first_lsn = None + self.last_lsn = None + self.backup_type = None + self.list_of_backup_files = None + self.backup_start_date = None + self.backup_finish_date = None + self.is_backup_restored = None + self.has_backup_checksums = None + self.family_count = None + self.ignore_reasons = None + + class SqlConnectionInfo(ConnectionInfo): """Information for connecting to SQL database server. All required parameters must be populated in order to send to Azure. - :param type: Required. Type of connection info.Constant filled by server. - :type type: str - :param user_name: User name. - :type user_name: str - :param password: Password credential. - :type password: str - :param data_source: Required. Data source in the format + :ivar type: Required. Type of connection info.Constant filled by server. + :vartype type: str + :ivar user_name: User name. + :vartype user_name: str + :ivar password: Password credential. + :vartype password: str + :ivar data_source: Required. Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber. - :type data_source: str - :param authentication: Authentication type to use for connection. Possible values include: + :vartype data_source: str + :ivar server_name: name of the server. + :vartype server_name: str + :ivar port: Port for Server. + :vartype port: int + :ivar server_version: server version. + :vartype server_version: str + :ivar server_brand_version: server brand version. + :vartype server_brand_version: str + :ivar resource_id: Represents the ID of an HTTP resource represented by an Azure resource + provider. + :vartype resource_id: str + :ivar authentication: Authentication type to use for connection. Possible values include: "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", "ActiveDirectoryPassword". - :type authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType - :param encrypt_connection: Whether to encrypt the connection. - :type encrypt_connection: bool - :param additional_settings: Additional connection settings. - :type additional_settings: str - :param trust_server_certificate: Whether to trust the server certificate. - :type trust_server_certificate: bool - :param platform: Server platform type for connection. Possible values include: "SqlOnPrem". - :type platform: str or ~azure.mgmt.datamigration.models.SqlSourcePlatform + :vartype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType + :ivar encrypt_connection: Whether to encrypt the connection. + :vartype encrypt_connection: bool + :ivar additional_settings: Additional connection settings. + :vartype additional_settings: str + :ivar trust_server_certificate: Whether to trust the server certificate. + :vartype trust_server_certificate: bool + :ivar platform: Server platform type for connection. Possible values include: "SqlOnPrem". + :vartype platform: str or ~azure.mgmt.datamigration.models.SqlSourcePlatform """ _validation = { @@ -12823,6 +17290,11 @@ class SqlConnectionInfo(ConnectionInfo): 'user_name': {'key': 'userName', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'server_version': {'key': 'serverVersion', 'type': 'str'}, + 'server_brand_version': {'key': 'serverBrandVersion', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'authentication': {'key': 'authentication', 'type': 'str'}, 'encrypt_connection': {'key': 'encryptConnection', 'type': 'bool'}, 'additional_settings': {'key': 'additionalSettings', 'type': 'str'}, @@ -12836,6 +17308,11 @@ def __init__( data_source: str, user_name: Optional[str] = None, password: Optional[str] = None, + server_name: Optional[str] = None, + port: Optional[int] = None, + server_version: Optional[str] = None, + server_brand_version: Optional[str] = None, + resource_id: Optional[str] = None, authentication: Optional[Union[str, "AuthenticationType"]] = None, encrypt_connection: Optional[bool] = True, additional_settings: Optional[str] = None, @@ -12843,9 +17320,46 @@ def __init__( platform: Optional[Union[str, "SqlSourcePlatform"]] = None, **kwargs ): + """ + :keyword user_name: User name. + :paramtype user_name: str + :keyword password: Password credential. + :paramtype password: str + :keyword data_source: Required. Data source in the format + Protocol:MachineName\SQLServerInstanceName,PortNumber. + :paramtype data_source: str + :keyword server_name: name of the server. + :paramtype server_name: str + :keyword port: Port for Server. + :paramtype port: int + :keyword server_version: server version. + :paramtype server_version: str + :keyword server_brand_version: server brand version. + :paramtype server_brand_version: str + :keyword resource_id: Represents the ID of an HTTP resource represented by an Azure resource + provider. + :paramtype resource_id: str + :keyword authentication: Authentication type to use for connection. Possible values include: + "None", "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", + "ActiveDirectoryPassword". + :paramtype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType + :keyword encrypt_connection: Whether to encrypt the connection. + :paramtype encrypt_connection: bool + :keyword additional_settings: Additional connection settings. + :paramtype additional_settings: str + :keyword trust_server_certificate: Whether to trust the server certificate. + :paramtype trust_server_certificate: bool + :keyword platform: Server platform type for connection. Possible values include: "SqlOnPrem". + :paramtype platform: str or ~azure.mgmt.datamigration.models.SqlSourcePlatform + """ super(SqlConnectionInfo, self).__init__(user_name=user_name, password=password, **kwargs) self.type = 'SqlConnectionInfo' # type: str self.data_source = data_source + self.server_name = server_name + self.port = port + self.server_version = server_version + self.server_brand_version = server_brand_version + self.resource_id = resource_id self.authentication = authentication self.encrypt_connection = encrypt_connection self.additional_settings = additional_settings @@ -12853,19 +17367,301 @@ def __init__( self.platform = platform +class SqlConnectionInformation(msrest.serialization.Model): + """Source SQL Connection. + + :ivar data_source: Data source. + :vartype data_source: str + :ivar authentication: Authentication type. + :vartype authentication: str + :ivar user_name: User name to connect to source SQL. + :vartype user_name: str + :ivar password: Password to connect to source SQL. + :vartype password: str + :ivar encrypt_connection: Whether to encrypt connection or not. + :vartype encrypt_connection: bool + :ivar trust_server_certificate: Whether to trust server certificate or not. + :vartype trust_server_certificate: bool + """ + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'encrypt_connection': {'key': 'encryptConnection', 'type': 'bool'}, + 'trust_server_certificate': {'key': 'trustServerCertificate', 'type': 'bool'}, + } + + def __init__( + self, + *, + data_source: Optional[str] = None, + authentication: Optional[str] = None, + user_name: Optional[str] = None, + password: Optional[str] = None, + encrypt_connection: Optional[bool] = None, + trust_server_certificate: Optional[bool] = None, + **kwargs + ): + """ + :keyword data_source: Data source. + :paramtype data_source: str + :keyword authentication: Authentication type. + :paramtype authentication: str + :keyword user_name: User name to connect to source SQL. + :paramtype user_name: str + :keyword password: Password to connect to source SQL. + :paramtype password: str + :keyword encrypt_connection: Whether to encrypt connection or not. + :paramtype encrypt_connection: bool + :keyword trust_server_certificate: Whether to trust server certificate or not. + :paramtype trust_server_certificate: bool + """ + super(SqlConnectionInformation, self).__init__(**kwargs) + self.data_source = data_source + self.authentication = authentication + self.user_name = user_name + self.password = password + self.encrypt_connection = encrypt_connection + self.trust_server_certificate = trust_server_certificate + + +class SqlDbMigrationStatusDetails(msrest.serialization.Model): + """Detailed status of current Sql Db migration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar migration_state: Current State of Migration. + :vartype migration_state: str + :ivar sql_data_copy_errors: Sql Data Copy errors, if any. + :vartype sql_data_copy_errors: list[str] + :ivar list_of_copy_progress_details: Details on progress of ADF copy activities. + :vartype list_of_copy_progress_details: + list[~azure.mgmt.datamigration.models.CopyProgressDetails] + """ + + _validation = { + 'migration_state': {'readonly': True}, + 'sql_data_copy_errors': {'readonly': True}, + 'list_of_copy_progress_details': {'readonly': True}, + } + + _attribute_map = { + 'migration_state': {'key': 'migrationState', 'type': 'str'}, + 'sql_data_copy_errors': {'key': 'sqlDataCopyErrors', 'type': '[str]'}, + 'list_of_copy_progress_details': {'key': 'listOfCopyProgressDetails', 'type': '[CopyProgressDetails]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SqlDbMigrationStatusDetails, self).__init__(**kwargs) + self.migration_state = None + self.sql_data_copy_errors = None + self.list_of_copy_progress_details = None + + +class SqlDbOfflineConfiguration(msrest.serialization.Model): + """Offline configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar offline: Offline migration. + :vartype offline: bool + """ + + _validation = { + 'offline': {'readonly': True}, + } + + _attribute_map = { + 'offline': {'key': 'offline', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SqlDbOfflineConfiguration, self).__init__(**kwargs) + self.offline = None + + +class SqlFileShare(msrest.serialization.Model): + """File share. + + :ivar path: Location as SMB share or local drive where backups are placed. + :vartype path: str + :ivar username: Username to access the file share location for backups. + :vartype username: str + :ivar password: Password for username to access file share location. + :vartype password: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + **kwargs + ): + """ + :keyword path: Location as SMB share or local drive where backups are placed. + :paramtype path: str + :keyword username: Username to access the file share location for backups. + :paramtype username: str + :keyword password: Password for username to access file share location. + :paramtype password: str + """ + super(SqlFileShare, self).__init__(**kwargs) + self.path = path + self.username = username + self.password = password + + +class SqlMigrationListResult(msrest.serialization.Model): + """A list of SQL Migration Service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: + :vartype value: list[~azure.mgmt.datamigration.models.SqlMigrationService] + :ivar next_link: + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SqlMigrationService]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SqlMigrationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SqlMigrationService(TrackedResource): + """A SQL Migration Service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: + :vartype location: str + :ivar tags: A set of tags. Dictionary of :code:``. + :vartype tags: dict[str, str] + :ivar id: + :vartype id: str + :ivar name: + :vartype name: str + :ivar type: + :vartype type: str + :ivar system_data: + :vartype system_data: ~azure.mgmt.datamigration.models.SystemData + :ivar provisioning_state: Provisioning state to track the async operation status. + :vartype provisioning_state: str + :ivar integration_runtime_state: Current state of the Integration runtime. + :vartype integration_runtime_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'integration_runtime_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'integration_runtime_state': {'key': 'properties.integrationRuntimeState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword location: + :paramtype location: str + :keyword tags: A set of tags. Dictionary of :code:``. + :paramtype tags: dict[str, str] + """ + super(SqlMigrationService, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.integration_runtime_state = None + + +class SqlMigrationServiceUpdate(msrest.serialization.Model): + """An update to a SQL Migration Service. + + :ivar tags: A set of tags. Dictionary of :code:``. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Dictionary of :code:``. + :paramtype tags: dict[str, str] + """ + super(SqlMigrationServiceUpdate, self).__init__(**kwargs) + self.tags = tags + + class SsisMigrationInfo(msrest.serialization.Model): """SSIS migration info with SSIS store type, overwrite policy. - :param ssis_store_type: The SSIS store type of source, only SSIS catalog is supported now in + :ivar ssis_store_type: The SSIS store type of source, only SSIS catalog is supported now in DMS. Possible values include: "SsisCatalog". - :type ssis_store_type: str or ~azure.mgmt.datamigration.models.SsisStoreType - :param project_overwrite_option: The overwrite option for the SSIS project migration. Possible + :vartype ssis_store_type: str or ~azure.mgmt.datamigration.models.SsisStoreType + :ivar project_overwrite_option: The overwrite option for the SSIS project migration. Possible values include: "Ignore", "Overwrite". - :type project_overwrite_option: str or + :vartype project_overwrite_option: str or ~azure.mgmt.datamigration.models.SsisMigrationOverwriteOption - :param environment_overwrite_option: The overwrite option for the SSIS environment migration. + :ivar environment_overwrite_option: The overwrite option for the SSIS environment migration. Possible values include: "Ignore", "Overwrite". - :type environment_overwrite_option: str or + :vartype environment_overwrite_option: str or ~azure.mgmt.datamigration.models.SsisMigrationOverwriteOption """ @@ -12883,6 +17679,19 @@ def __init__( environment_overwrite_option: Optional[Union[str, "SsisMigrationOverwriteOption"]] = None, **kwargs ): + """ + :keyword ssis_store_type: The SSIS store type of source, only SSIS catalog is supported now in + DMS. Possible values include: "SsisCatalog". + :paramtype ssis_store_type: str or ~azure.mgmt.datamigration.models.SsisStoreType + :keyword project_overwrite_option: The overwrite option for the SSIS project migration. + Possible values include: "Ignore", "Overwrite". + :paramtype project_overwrite_option: str or + ~azure.mgmt.datamigration.models.SsisMigrationOverwriteOption + :keyword environment_overwrite_option: The overwrite option for the SSIS environment migration. + Possible values include: "Ignore", "Overwrite". + :paramtype environment_overwrite_option: str or + ~azure.mgmt.datamigration.models.SsisMigrationOverwriteOption + """ super(SsisMigrationInfo, self).__init__(**kwargs) self.ssis_store_type = ssis_store_type self.project_overwrite_option = project_overwrite_option @@ -12919,6 +17728,8 @@ def __init__( self, **kwargs ): + """ + """ super(StartMigrationScenarioServerRoleResult, self).__init__(**kwargs) self.name = None self.state = None @@ -12954,6 +17765,8 @@ def __init__( self, **kwargs ): + """ + """ super(SyncMigrationDatabaseErrorEvent, self).__init__(**kwargs) self.timestamp_string = None self.event_type_string = None @@ -12961,22 +17774,22 @@ def __init__( class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. + """SystemData. - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.datamigration.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.datamigration.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime + :ivar created_by: + :vartype created_by: str + :ivar created_by_type: Possible values include: "User", "Application", "ManagedIdentity", + "Key". + :vartype created_by_type: str or ~azure.mgmt.datamigration.models.CreatedByType + :ivar created_at: + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: + :vartype last_modified_by: str + :ivar last_modified_by_type: Possible values include: "User", "Application", "ManagedIdentity", + "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.datamigration.models.CreatedByType + :ivar last_modified_at: + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -12999,6 +17812,22 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: + :paramtype created_by: str + :keyword created_by_type: Possible values include: "User", "Application", "ManagedIdentity", + "Key". + :paramtype created_by_type: str or ~azure.mgmt.datamigration.models.CreatedByType + :keyword created_at: + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: + :paramtype last_modified_by: str + :keyword last_modified_by_type: Possible values include: "User", "Application", + "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or ~azure.mgmt.datamigration.models.CreatedByType + :keyword last_modified_at: + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -13008,13 +17837,45 @@ def __init__( self.last_modified_at = last_modified_at +class TargetLocation(msrest.serialization.Model): + """Target Location details for optional copy of backups. + + :ivar storage_account_resource_id: Resource Id of the storage account copying backups. + :vartype storage_account_resource_id: str + :ivar account_key: Storage Account Key. + :vartype account_key: str + """ + + _attribute_map = { + 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, + 'account_key': {'key': 'accountKey', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_resource_id: Optional[str] = None, + account_key: Optional[str] = None, + **kwargs + ): + """ + :keyword storage_account_resource_id: Resource Id of the storage account copying backups. + :paramtype storage_account_resource_id: str + :keyword account_key: Storage Account Key. + :paramtype account_key: str + """ + super(TargetLocation, self).__init__(**kwargs) + self.storage_account_resource_id = storage_account_resource_id + self.account_key = account_key + + class TaskList(msrest.serialization.Model): """OData page of tasks. - :param value: List of tasks. - :type value: list[~azure.mgmt.datamigration.models.ProjectTask] - :param next_link: URL to load the next page of tasks. - :type next_link: str + :ivar value: List of tasks. + :vartype value: list[~azure.mgmt.datamigration.models.ProjectTask] + :ivar next_link: URL to load the next page of tasks. + :vartype next_link: str """ _attribute_map = { @@ -13029,6 +17890,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of tasks. + :paramtype value: list[~azure.mgmt.datamigration.models.ProjectTask] + :keyword next_link: URL to load the next page of tasks. + :paramtype next_link: str + """ super(TaskList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -13037,8 +17904,8 @@ def __init__( class UploadOCIDriverTaskInput(msrest.serialization.Model): """Input for the service task to upload an OCI driver. - :param driver_share: File share information for the OCI driver archive. - :type driver_share: ~azure.mgmt.datamigration.models.FileShare + :ivar driver_share: File share information for the OCI driver archive. + :vartype driver_share: ~azure.mgmt.datamigration.models.FileShare """ _attribute_map = { @@ -13051,6 +17918,10 @@ def __init__( driver_share: Optional["FileShare"] = None, **kwargs ): + """ + :keyword driver_share: File share information for the OCI driver archive. + :paramtype driver_share: ~azure.mgmt.datamigration.models.FileShare + """ super(UploadOCIDriverTaskInput, self).__init__(**kwargs) self.driver_share = driver_share @@ -13080,6 +17951,8 @@ def __init__( self, **kwargs ): + """ + """ super(UploadOCIDriverTaskOutput, self).__init__(**kwargs) self.driver_package_name = None self.validation_errors = None @@ -13092,8 +17965,25 @@ class UploadOCIDriverTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -13102,10 +17992,10 @@ class UploadOCIDriverTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Input for the service task to upload an OCI driver. - :type input: ~azure.mgmt.datamigration.models.UploadOCIDriverTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Input for the service task to upload an OCI driver. + :vartype input: ~azure.mgmt.datamigration.models.UploadOCIDriverTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.UploadOCIDriverTaskOutput] """ @@ -13135,6 +18025,12 @@ def __init__( input: Optional["UploadOCIDriverTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Input for the service task to upload an OCI driver. + :paramtype input: ~azure.mgmt.datamigration.models.UploadOCIDriverTaskInput + """ super(UploadOCIDriverTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Service.Upload.OCI' # type: str self.input = input @@ -13148,8 +18044,25 @@ class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(ProjectTaskProperti All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -13158,10 +18071,10 @@ class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(ProjectTaskProperti :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ValidateSyncMigrationInputSqlServerTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ValidateSyncMigrationInputSqlServerTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ValidateSyncMigrationInputSqlServerTaskOutput] @@ -13192,6 +18105,12 @@ def __init__( input: Optional["ValidateSyncMigrationInputSqlServerTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: ~azure.mgmt.datamigration.models.ValidateSyncMigrationInputSqlServerTaskInput + """ super(ValidateMigrationInputSqlServerSqlDbSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ValidateMigrationInput.SqlServer.SqlDb.Sync' # type: str self.input = input @@ -13203,22 +18122,22 @@ class ValidateMigrationInputSqlServerSqlMISyncTaskInput(SqlServerSqlMISyncTaskIn All required parameters must be populated in order to send to Azure. - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] - :param backup_file_share: Backup file share information for all selected databases. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param storage_resource_id: Required. Fully qualified resourceId of storage. - :type storage_resource_id: str - :param source_connection_info: Required. Connection information for source SQL Server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Connection information for Azure SQL Database Managed + :ivar backup_file_share: Backup file share information for all selected databases. + :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :ivar storage_resource_id: Required. Fully qualified resourceId of storage. + :vartype storage_resource_id: str + :ivar source_connection_info: Required. Connection information for source SQL Server. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Connection information for Azure SQL Database Managed Instance. - :type target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo - :param azure_app: Required. Azure Active Directory Application the DMS instance will use to + :vartype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo + :ivar azure_app: Required. Azure Active Directory Application the DMS instance will use to connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage Account. - :type azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + :vartype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp """ _validation = { @@ -13249,6 +18168,24 @@ def __init__( backup_file_share: Optional["FileShare"] = None, **kwargs ): + """ + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] + :keyword backup_file_share: Backup file share information for all selected databases. + :paramtype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :keyword storage_resource_id: Required. Fully qualified resourceId of storage. + :paramtype storage_resource_id: str + :keyword source_connection_info: Required. Connection information for source SQL Server. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Connection information for Azure SQL Database + Managed Instance. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo + :keyword azure_app: Required. Azure Active Directory Application the DMS instance will use to + connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage + Account. + :paramtype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp + """ super(ValidateMigrationInputSqlServerSqlMISyncTaskInput, self).__init__(selected_databases=selected_databases, backup_file_share=backup_file_share, storage_resource_id=storage_resource_id, source_connection_info=source_connection_info, target_connection_info=target_connection_info, azure_app=azure_app, **kwargs) @@ -13281,6 +18218,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidateMigrationInputSqlServerSqlMISyncTaskOutput, self).__init__(**kwargs) self.id = None self.name = None @@ -13294,8 +18233,25 @@ class ValidateMigrationInputSqlServerSqlMISyncTaskProperties(ProjectTaskProperti All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -13304,10 +18260,11 @@ class ValidateMigrationInputSqlServerSqlMISyncTaskProperties(ProjectTaskProperti :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMISyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: + ~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMISyncTaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMISyncTaskOutput] @@ -13338,6 +18295,13 @@ def __init__( input: Optional["ValidateMigrationInputSqlServerSqlMISyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: + ~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMISyncTaskInput + """ super(ValidateMigrationInputSqlServerSqlMISyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS' # type: str self.input = input @@ -13349,23 +18313,23 @@ class ValidateMigrationInputSqlServerSqlMITaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Information for connecting to source. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar source_connection_info: Required. Information for connecting to source. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Information for connecting to target. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] - :param selected_logins: Logins to migrate. - :type selected_logins: list[str] - :param backup_file_share: Backup file share information for all selected databases. - :type backup_file_share: ~azure.mgmt.datamigration.models.FileShare - :param backup_blob_share: Required. SAS URI of Azure Storage Account Container to be used for + :ivar selected_logins: Logins to migrate. + :vartype selected_logins: list[str] + :ivar backup_file_share: Backup file share information for all selected databases. + :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :ivar backup_blob_share: Required. SAS URI of Azure Storage Account Container to be used for storing backup files. - :type backup_blob_share: ~azure.mgmt.datamigration.models.BlobShare - :param backup_mode: Backup Mode to specify whether to use existing backup or create new backup. + :vartype backup_blob_share: ~azure.mgmt.datamigration.models.BlobShare + :ivar backup_mode: Backup Mode to specify whether to use existing backup or create new backup. Possible values include: "CreateBackup", "ExistingBackup". - :type backup_mode: str or ~azure.mgmt.datamigration.models.BackupMode + :vartype backup_mode: str or ~azure.mgmt.datamigration.models.BackupMode """ _validation = { @@ -13397,6 +18361,25 @@ def __init__( backup_mode: Optional[Union[str, "BackupMode"]] = None, **kwargs ): + """ + :keyword source_connection_info: Required. Information for connecting to source. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Information for connecting to target. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput] + :keyword selected_logins: Logins to migrate. + :paramtype selected_logins: list[str] + :keyword backup_file_share: Backup file share information for all selected databases. + :paramtype backup_file_share: ~azure.mgmt.datamigration.models.FileShare + :keyword backup_blob_share: Required. SAS URI of Azure Storage Account Container to be used for + storing backup files. + :paramtype backup_blob_share: ~azure.mgmt.datamigration.models.BlobShare + :keyword backup_mode: Backup Mode to specify whether to use existing backup or create new + backup. Possible values include: "CreateBackup", "ExistingBackup". + :paramtype backup_mode: str or ~azure.mgmt.datamigration.models.BackupMode + """ super(ValidateMigrationInputSqlServerSqlMITaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.target_connection_info = target_connection_info @@ -13430,8 +18413,8 @@ class ValidateMigrationInputSqlServerSqlMITaskOutput(msrest.serialization.Model) list[~azure.mgmt.datamigration.models.ReportableException] :ivar existing_backup_errors: Errors associated with existing backup files. :vartype existing_backup_errors: list[~azure.mgmt.datamigration.models.ReportableException] - :param database_backup_info: Information about backup files when existing backup mode is used. - :type database_backup_info: ~azure.mgmt.datamigration.models.DatabaseBackupInfo + :ivar database_backup_info: Information about backup files when existing backup mode is used. + :vartype database_backup_info: ~azure.mgmt.datamigration.models.DatabaseBackupInfo """ _validation = { @@ -13461,6 +18444,11 @@ def __init__( database_backup_info: Optional["DatabaseBackupInfo"] = None, **kwargs ): + """ + :keyword database_backup_info: Information about backup files when existing backup mode is + used. + :paramtype database_backup_info: ~azure.mgmt.datamigration.models.DatabaseBackupInfo + """ super(ValidateMigrationInputSqlServerSqlMITaskOutput, self).__init__(**kwargs) self.id = None self.name = None @@ -13479,8 +18467,25 @@ class ValidateMigrationInputSqlServerSqlMITaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -13489,10 +18494,10 @@ class ValidateMigrationInputSqlServerSqlMITaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Task input. - :type input: ~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMITaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Task input. + :vartype input: ~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMITaskInput :ivar output: Task output. This is ignored if submitted. :vartype output: list[~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMITaskOutput] @@ -13523,6 +18528,13 @@ def __init__( input: Optional["ValidateMigrationInputSqlServerSqlMITaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Task input. + :paramtype input: + ~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMITaskInput + """ super(ValidateMigrationInputSqlServerSqlMITaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'ValidateMigrationInput.SqlServer.AzureSqlDbMI' # type: str self.input = input @@ -13536,8 +18548,25 @@ class ValidateMongoDbTaskProperties(ProjectTaskProperties): All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -13546,10 +18575,10 @@ class ValidateMongoDbTaskProperties(ProjectTaskProperties): :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Describes how a MongoDB data migration should be performed. - :type input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Describes how a MongoDB data migration should be performed. + :vartype input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings :ivar output: An array containing a single MongoDbMigrationProgress object. :vartype output: list[~azure.mgmt.datamigration.models.MongoDbMigrationProgress] """ @@ -13579,6 +18608,12 @@ def __init__( input: Optional["MongoDbMigrationSettings"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Describes how a MongoDB data migration should be performed. + :paramtype input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings + """ super(ValidateMongoDbTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Validate.MongoDb' # type: str self.input = input @@ -13592,8 +18627,25 @@ class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskProperties All required parameters must be populated in order to send to Azure. - :param task_type: Required. Task type.Constant filled by server. - :type task_type: str + :ivar task_type: Required. Task type.Constant filled by server. Possible values include: + "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", + "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", + "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", + "ConnectToTarget.AzureDbForPostgreSql.Sync", + "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", + "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", + "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", + "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", + "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", + "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", + "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", + "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", + "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", + "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", + "MigrateSchemaSqlServerSqlDb". + :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType :ivar errors: Array of errors. This is ignored if submitted. :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] :ivar state: The state of the task. This is ignored if submitted. Possible values include: @@ -13602,11 +18654,11 @@ class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(ProjectTaskProperties :vartype state: str or ~azure.mgmt.datamigration.models.TaskState :ivar commands: Array of command properties. :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties] - :param client_data: Key value pairs of client data to attach meta data information to task. - :type client_data: dict[str, str] - :param input: Input for the task that migrates Oracle databases to Azure Database for - PostgreSQL for online migrations. - :type input: ~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskInput + :ivar client_data: Key value pairs of client data to attach meta data information to task. + :vartype client_data: dict[str, str] + :ivar input: Input for the task that migrates Oracle databases to Azure Database for PostgreSQL + for online migrations. + :vartype input: ~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskInput :ivar output: An array containing a single validation error response object. :vartype output: list[~azure.mgmt.datamigration.models.ValidateOracleAzureDbPostgreSqlSyncTaskOutput] @@ -13637,6 +18689,13 @@ def __init__( input: Optional["MigrateOracleAzureDbPostgreSqlSyncTaskInput"] = None, **kwargs ): + """ + :keyword client_data: Key value pairs of client data to attach meta data information to task. + :paramtype client_data: dict[str, str] + :keyword input: Input for the task that migrates Oracle databases to Azure Database for + PostgreSQL for online migrations. + :paramtype input: ~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskInput + """ super(ValidateOracleAzureDbForPostgreSqlSyncTaskProperties, self).__init__(client_data=client_data, **kwargs) self.task_type = 'Validate.Oracle.AzureDbPostgreSql.Sync' # type: str self.input = input @@ -13664,6 +18723,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidateOracleAzureDbPostgreSqlSyncTaskOutput, self).__init__(**kwargs) self.validation_errors = None @@ -13673,12 +18734,12 @@ class ValidateSyncMigrationInputSqlServerTaskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_connection_info: Required. Information for connecting to source SQL server. - :type source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param target_connection_info: Required. Information for connecting to target. - :type target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo - :param selected_databases: Required. Databases to migrate. - :type selected_databases: + :ivar source_connection_info: Required. Information for connecting to source SQL server. + :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar target_connection_info: Required. Information for connecting to target. + :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :ivar selected_databases: Required. Databases to migrate. + :vartype selected_databases: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncDatabaseInput] """ @@ -13702,6 +18763,15 @@ def __init__( selected_databases: List["MigrateSqlServerSqlDbSyncDatabaseInput"], **kwargs ): + """ + :keyword source_connection_info: Required. Information for connecting to source SQL server. + :paramtype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword target_connection_info: Required. Information for connecting to target. + :paramtype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :keyword selected_databases: Required. Databases to migrate. + :paramtype selected_databases: + list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncDatabaseInput] + """ super(ValidateSyncMigrationInputSqlServerTaskInput, self).__init__(**kwargs) self.source_connection_info = source_connection_info self.target_connection_info = target_connection_info @@ -13737,6 +18807,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidateSyncMigrationInputSqlServerTaskOutput, self).__init__(**kwargs) self.id = None self.name = None @@ -13746,10 +18818,10 @@ def __init__( class ValidationError(msrest.serialization.Model): """Description about the errors happen while performing migration validation. - :param text: Error Text. - :type text: str - :param severity: Severity of the error. Possible values include: "Message", "Warning", "Error". - :type severity: str or ~azure.mgmt.datamigration.models.Severity + :ivar text: Error Text. + :vartype text: str + :ivar severity: Severity of the error. Possible values include: "Message", "Warning", "Error". + :vartype severity: str or ~azure.mgmt.datamigration.models.Severity """ _attribute_map = { @@ -13764,6 +18836,13 @@ def __init__( severity: Optional[Union[str, "Severity"]] = None, **kwargs ): + """ + :keyword text: Error Text. + :paramtype text: str + :keyword severity: Severity of the error. Possible values include: "Message", "Warning", + "Error". + :paramtype severity: str or ~azure.mgmt.datamigration.models.Severity + """ super(ValidationError, self).__init__(**kwargs) self.text = text self.severity = severity @@ -13772,12 +18851,12 @@ def __init__( class WaitStatistics(msrest.serialization.Model): """Wait statistics gathered during query batch execution. - :param wait_type: Type of the Wait. - :type wait_type: str - :param wait_time_ms: Total wait time in millisecond(s). - :type wait_time_ms: float - :param wait_count: Total no. of waits. - :type wait_count: long + :ivar wait_type: Type of the Wait. + :vartype wait_type: str + :ivar wait_time_ms: Total wait time in millisecond(s). + :vartype wait_time_ms: float + :ivar wait_count: Total no. of waits. + :vartype wait_count: long """ _attribute_map = { @@ -13794,6 +18873,14 @@ def __init__( wait_count: Optional[int] = None, **kwargs ): + """ + :keyword wait_type: Type of the Wait. + :paramtype wait_type: str + :keyword wait_time_ms: Total wait time in millisecond(s). + :paramtype wait_time_ms: float + :keyword wait_count: Total no. of waits. + :paramtype wait_count: long + """ super(WaitStatistics, self).__init__(**kwargs) self.wait_type = wait_type self.wait_time_ms = wait_time_ms diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py index 6fcef949b4af..f225cba43b6f 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py @@ -6,22 +6,30 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._database_migrations_sql_db_operations import DatabaseMigrationsSqlDbOperations +from ._database_migrations_sql_mi_operations import DatabaseMigrationsSqlMiOperations +from ._database_migrations_sql_vm_operations import DatabaseMigrationsSqlVmOperations +from ._operations import Operations +from ._sql_migration_services_operations import SqlMigrationServicesOperations from ._resource_skus_operations import ResourceSkusOperations from ._services_operations import ServicesOperations from ._tasks_operations import TasksOperations from ._service_tasks_operations import ServiceTasksOperations from ._projects_operations import ProjectsOperations from ._usages_operations import UsagesOperations -from ._operations import Operations from ._files_operations import FilesOperations __all__ = [ + 'DatabaseMigrationsSqlDbOperations', + 'DatabaseMigrationsSqlMiOperations', + 'DatabaseMigrationsSqlVmOperations', + 'Operations', + 'SqlMigrationServicesOperations', 'ResourceSkusOperations', 'ServicesOperations', 'TasksOperations', 'ServiceTasksOperations', 'ProjectsOperations', 'UsagesOperations', - 'Operations', 'FilesOperations', ] diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_database_migrations_sql_db_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_database_migrations_sql_db_operations.py new file mode 100644 index 000000000000..62091ff9fa92 --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_database_migrations_sql_db_operations.py @@ -0,0 +1,637 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + subscription_id: str, + *, + migration_operation_id: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlDbInstanceName": _SERIALIZER.url("sql_db_instance_name", sql_db_instance_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if migration_operation_id is not None: + query_parameters['migrationOperationId'] = _SERIALIZER.query("migration_operation_id", migration_operation_id, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlDbInstanceName": _SERIALIZER.url("sql_db_instance_name", sql_db_instance_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + subscription_id: str, + *, + force: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlDbInstanceName": _SERIALIZER.url("sql_db_instance_name", sql_db_instance_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if force is not None: + query_parameters['force'] = _SERIALIZER.query("force", force, 'bool') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_cancel_request_initial( + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlDbInstanceName": _SERIALIZER.url("sql_db_instance_name", sql_db_instance_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class DatabaseMigrationsSqlDbOperations(object): + """DatabaseMigrationsSqlDbOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.datamigration.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + migration_operation_id: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlDb": + """Retrieve the Database Migration resource. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_db_instance_name: + :type sql_db_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param migration_operation_id: Optional migration operation ID. If this is provided, then + details of migration operation for that ID are retrieved. If not provided (default), then + details related to most recent or current operation are retrieved. + :type migration_operation_id: str + :param expand: Complete migration details be included in the response. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabaseMigrationSqlDb, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlDb + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlDb"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + migration_operation_id=migration_operation_id, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabaseMigrationSqlDb', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlDb", + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlDb": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlDb"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DatabaseMigrationSqlDb') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseMigrationSqlDb', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DatabaseMigrationSqlDb', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlDb", + **kwargs: Any + ) -> LROPoller["_models.DatabaseMigrationSqlDb"]: + """Create or Update Database Migration resource. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_db_instance_name: + :type sql_db_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Details of Sql Db migration resource. + :type parameters: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlDb + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either DatabaseMigrationSqlDb or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datamigration.models.DatabaseMigrationSqlDb] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlDb"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DatabaseMigrationSqlDb', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + force: Optional[bool] = None, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + force=force, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + force: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Delete Database Migration resource. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_db_instance_name: + :type sql_db_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param force: Optional force delete boolean. If this is provided as true, migration will be + deleted even if active. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + def _cancel_initial( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MigrationOperationInput') + + request = build_cancel_request_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore + + + @distributed_trace + def begin_cancel( + self, + resource_group_name: str, + sql_db_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> LROPoller[None]: + """Stop on going migration for the database. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_db_instance_name: + :type sql_db_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Required migration operation ID for which cancel will be initiated. + :type parameters: ~azure.mgmt.datamigration.models.MigrationOperationInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._cancel_initial( + resource_group_name=resource_group_name, + sql_db_instance_name=sql_db_instance_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_database_migrations_sql_mi_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_database_migrations_sql_mi_operations.py new file mode 100644 index 000000000000..3856aea94810 --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_database_migrations_sql_mi_operations.py @@ -0,0 +1,651 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + subscription_id: str, + *, + migration_operation_id: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if migration_operation_id is not None: + query_parameters['migrationOperationId'] = _SERIALIZER.query("migration_operation_id", migration_operation_id, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request_initial( + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cutover_request_initial( + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class DatabaseMigrationsSqlMiOperations(object): + """DatabaseMigrationsSqlMiOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.datamigration.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + migration_operation_id: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlMi": + """Retrieve the specified database migration for a given SQL Managed Instance. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: + :type managed_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param migration_operation_id: Optional migration operation ID. If this is provided, then + details of migration operation for that ID are retrieved. If not provided (default), then + details related to most recent or current operation are retrieved. + :type migration_operation_id: str + :param expand: Complete migration details be included in the response. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabaseMigrationSqlMi, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlMi + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlMi"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + migration_operation_id=migration_operation_id, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabaseMigrationSqlMi', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlMi", + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlMi": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlMi"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DatabaseMigrationSqlMi') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseMigrationSqlMi', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DatabaseMigrationSqlMi', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlMi", + **kwargs: Any + ) -> LROPoller["_models.DatabaseMigrationSqlMi"]: + """Create a new database migration to a given SQL Managed Instance. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: + :type managed_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlMi + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either DatabaseMigrationSqlMi or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datamigration.models.DatabaseMigrationSqlMi] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlMi"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DatabaseMigrationSqlMi', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + def _cancel_initial( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MigrationOperationInput') + + request = build_cancel_request_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore + + + @distributed_trace + def begin_cancel( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> LROPoller[None]: + """Stop in-progress database migration to SQL Managed Instance. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: + :type managed_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Required migration operation ID for which cancel will be initiated. + :type parameters: ~azure.mgmt.datamigration.models.MigrationOperationInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._cancel_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore + + def _cutover_initial( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MigrationOperationInput') + + request = build_cutover_request_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._cutover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _cutover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover'} # type: ignore + + + @distributed_trace + def begin_cutover( + self, + resource_group_name: str, + managed_instance_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> LROPoller[None]: + """Initiate cutover for in-progress online database migration to SQL Managed Instance. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: + :type managed_instance_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Required migration operation ID for which cutover will be initiated. + :type parameters: ~azure.mgmt.datamigration.models.MigrationOperationInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._cutover_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_cutover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover'} # type: ignore diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_database_migrations_sql_vm_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_database_migrations_sql_vm_operations.py new file mode 100644 index 000000000000..a050299192c1 --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_database_migrations_sql_vm_operations.py @@ -0,0 +1,651 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + subscription_id: str, + *, + migration_operation_id: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlVirtualMachineName": _SERIALIZER.url("sql_virtual_machine_name", sql_virtual_machine_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if migration_operation_id is not None: + query_parameters['migrationOperationId'] = _SERIALIZER.query("migration_operation_id", migration_operation_id, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlVirtualMachineName": _SERIALIZER.url("sql_virtual_machine_name", sql_virtual_machine_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request_initial( + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlVirtualMachineName": _SERIALIZER.url("sql_virtual_machine_name", sql_virtual_machine_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cutover_request_initial( + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlVirtualMachineName": _SERIALIZER.url("sql_virtual_machine_name", sql_virtual_machine_name, 'str'), + "targetDbName": _SERIALIZER.url("target_db_name", target_db_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class DatabaseMigrationsSqlVmOperations(object): + """DatabaseMigrationsSqlVmOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.datamigration.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + migration_operation_id: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlVm": + """Retrieve the specified database migration for a given SQL VM. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_virtual_machine_name: + :type sql_virtual_machine_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param migration_operation_id: Optional migration operation ID. If this is provided, then + details of migration operation for that ID are retrieved. If not provided (default), then + details related to most recent or current operation are retrieved. + :type migration_operation_id: str + :param expand: Complete migration details be included in the response. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabaseMigrationSqlVm, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlVm + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlVm"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + migration_operation_id=migration_operation_id, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabaseMigrationSqlVm', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlVm", + **kwargs: Any + ) -> "_models.DatabaseMigrationSqlVm": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlVm"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DatabaseMigrationSqlVm') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseMigrationSqlVm', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DatabaseMigrationSqlVm', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.DatabaseMigrationSqlVm", + **kwargs: Any + ) -> LROPoller["_models.DatabaseMigrationSqlVm"]: + """Create a new database migration to a given SQL VM. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_virtual_machine_name: + :type sql_virtual_machine_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.DatabaseMigrationSqlVm + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either DatabaseMigrationSqlVm or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datamigration.models.DatabaseMigrationSqlVm] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationSqlVm"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DatabaseMigrationSqlVm', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}'} # type: ignore + + def _cancel_initial( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MigrationOperationInput') + + request = build_cancel_request_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore + + + @distributed_trace + def begin_cancel( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> LROPoller[None]: + """Stop in-progress database migration to SQL VM. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_virtual_machine_name: + :type sql_virtual_machine_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: + :type parameters: ~azure.mgmt.datamigration.models.MigrationOperationInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._cancel_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel'} # type: ignore + + def _cutover_initial( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MigrationOperationInput') + + request = build_cutover_request_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._cutover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _cutover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover'} # type: ignore + + + @distributed_trace + def begin_cutover( + self, + resource_group_name: str, + sql_virtual_machine_name: str, + target_db_name: str, + parameters: "_models.MigrationOperationInput", + **kwargs: Any + ) -> LROPoller[None]: + """Initiate cutover for in-progress online database migration to SQL VM. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_virtual_machine_name: + :type sql_virtual_machine_name: str + :param target_db_name: The name of the target database. + :type target_db_name: str + :param parameters: + :type parameters: ~azure.mgmt.datamigration.models.MigrationOperationInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._cutover_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + target_db_name=target_db_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_cutover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover'} # type: ignore diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_files_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_files_operations.py index 86365f8bc6c9..fcbd2005ca58 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_files_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_files_operations.py @@ -5,23 +5,315 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + file_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "fileName": _SERIALIZER.url("file_name", file_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + file_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "fileName": _SERIALIZER.url("file_name", file_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + file_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "fileName": _SERIALIZER.url("file_name", file_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + file_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "fileName": _SERIALIZER.url("file_name", file_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_read_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + file_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/read') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "fileName": _SERIALIZER.url("file_name", file_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_read_write_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + file_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/readwrite') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "fileName": _SERIALIZER.url("file_name", file_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class FilesOperations(object): """FilesOperations operations. @@ -45,14 +337,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FileList"] + group_name: str, + service_name: str, + project_name: str, + **kwargs: Any + ) -> Iterable["_models.FileList"]: """Get files in a project. The project resource is a nested resource representing a stored migration project. This method @@ -74,37 +366,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('FileList', pipeline_response) + deserialized = self._deserialize("FileList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,26 +407,27 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files'} # type: ignore + @distributed_trace def get( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - file_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectFile" + group_name: str, + service_name: str, + project_name: str, + file_name: str, + **kwargs: Any + ) -> "_models.ProjectFile": """Get file information. The files resource is a nested, proxy-only resource representing a file stored under the @@ -160,35 +451,25 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectFile', pipeline_response) @@ -197,18 +478,20 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'} # type: ignore + + @distributed_trace def create_or_update( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - file_name, # type: str - parameters, # type: "_models.ProjectFile" - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectFile" + group_name: str, + service_name: str, + project_name: str, + file_name: str, + parameters: "_models.ProjectFile", + **kwargs: Any + ) -> "_models.ProjectFile": """Create a file resource. The PUT method creates a new file or updates an existing one. @@ -233,40 +516,30 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'ProjectFile') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectFile') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -279,17 +552,19 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'} # type: ignore + + @distributed_trace def delete( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - file_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + group_name: str, + service_name: str, + project_name: str, + file_name: str, + **kwargs: Any + ) -> None: """Delete file. This method deletes a file. @@ -312,35 +587,25 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -348,16 +613,17 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'} # type: ignore + + @distributed_trace def update( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - file_name, # type: str - parameters, # type: "_models.ProjectFile" - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectFile" + group_name: str, + service_name: str, + project_name: str, + file_name: str, + parameters: "_models.ProjectFile", + **kwargs: Any + ) -> "_models.ProjectFile": """Update a file. This method updates an existing file. @@ -382,40 +648,30 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'ProjectFile') + + request = build_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectFile') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectFile', pipeline_response) @@ -424,17 +680,19 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'} # type: ignore + + @distributed_trace def read( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - file_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FileStorageInfo" + group_name: str, + service_name: str, + project_name: str, + file_name: str, + **kwargs: Any + ) -> "_models.FileStorageInfo": """Request storage information for downloading the file content. This method is used for requesting storage information using which contents of the file can be @@ -458,35 +716,25 @@ def read( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.read.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_read_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + template_url=self.read.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FileStorageInfo', pipeline_response) @@ -495,17 +743,19 @@ def read( return cls(pipeline_response, deserialized, {}) return deserialized + read.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/read'} # type: ignore + + @distributed_trace def read_write( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - file_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FileStorageInfo" + group_name: str, + service_name: str, + project_name: str, + file_name: str, + **kwargs: Any + ) -> "_models.FileStorageInfo": """Request information for reading and writing file content. This method is used for requesting information for reading and writing the file content. @@ -528,35 +778,25 @@ def read_write( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.read_write.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'fileName': self._serialize.url("file_name", file_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_read_write_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + file_name=file_name, + template_url=self.read_write.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FileStorageInfo', pipeline_response) @@ -565,4 +805,6 @@ def read_write( return cls(pipeline_response, deserialized, {}) return deserialized + read_write.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/readwrite'} # type: ignore + diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_operations.py index a12bcbf22bb9..eaa044a3f412 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_operations.py @@ -5,23 +5,50 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.DataMigration/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,49 +72,44 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ServiceOperationList"] - """Get available resource provider actions (operations). - - Lists all available actions exposed by the Database Migration Service resource provider. + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: + """Lists all of the available SQL Migration REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ServiceOperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datamigration.models.ServiceOperationList] + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datamigration.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceOperationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ServiceOperationList', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -100,12 +122,12 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_projects_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_projects_operations.py index 465021b30d63..f440a4dfa672 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_projects_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_projects_operations.py @@ -5,23 +5,231 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + group_name: str, + service_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + *, + delete_running_tasks: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if delete_running_tasks is not None: + query_parameters['deleteRunningTasks'] = _SERIALIZER.query("delete_running_tasks", delete_running_tasks, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ProjectsOperations(object): """ProjectsOperations operations. @@ -45,13 +253,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - group_name, # type: str - service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProjectList"] + group_name: str, + service_name: str, + **kwargs: Any + ) -> Iterable["_models.ProjectList"]: """Get projects in a service. The project resource is a nested resource representing a stored migration project. This method @@ -71,36 +279,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ProjectList', pipeline_response) + deserialized = self._deserialize("ProjectList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,26 +318,27 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects'} # type: ignore + @distributed_trace def create_or_update( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - parameters, # type: "_models.Project" - **kwargs # type: Any - ): - # type: (...) -> "_models.Project" + group_name: str, + service_name: str, + project_name: str, + parameters: "_models.Project", + **kwargs: Any + ) -> "_models.Project": """Create or update project. The project resource is a nested resource representing a stored migration project. The PUT @@ -156,39 +362,29 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'Project') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Project') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -201,16 +397,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} # type: ignore + + @distributed_trace def get( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Project" + group_name: str, + service_name: str, + project_name: str, + **kwargs: Any + ) -> "_models.Project": """Get project information. The project resource is a nested resource representing a stored migration project. The GET @@ -232,34 +430,24 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Project', pipeline_response) @@ -268,17 +456,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} # type: ignore + + @distributed_trace def delete( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - delete_running_tasks=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None + group_name: str, + service_name: str, + project_name: str, + delete_running_tasks: Optional[bool] = None, + **kwargs: Any + ) -> None: """Delete project. The project resource is a nested resource representing a stored migration project. The DELETE @@ -302,36 +492,25 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if delete_running_tasks is not None: - query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + delete_running_tasks=delete_running_tasks, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,15 +518,16 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} # type: ignore + + @distributed_trace def update( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - parameters, # type: "_models.Project" - **kwargs # type: Any - ): - # type: (...) -> "_models.Project" + group_name: str, + service_name: str, + project_name: str, + parameters: "_models.Project", + **kwargs: Any + ) -> "_models.Project": """Update project. The project resource is a nested resource representing a stored migration project. The PATCH @@ -371,39 +551,29 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Project') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Project') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Project', pipeline_response) @@ -412,4 +582,6 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} # type: ignore + diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_resource_skus_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_resource_skus_operations.py index 96d5b8c7af29..4e1672f25e54 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_resource_skus_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_resource_skus_operations.py @@ -5,23 +5,56 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_skus_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/skus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ResourceSkusOperations(object): """ResourceSkusOperations operations. @@ -45,11 +78,11 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_skus( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ResourceSkusResult"] + **kwargs: Any + ) -> Iterable["_models.ResourceSkusResult"]: """Get supported SKUs. The skus action returns the list of SKUs that DMS supports. @@ -64,34 +97,29 @@ def list_skus( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_skus_request( + subscription_id=self._config.subscription_id, + template_url=self.list_skus.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_skus_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceSkusResult', pipeline_response) + deserialized = self._deserialize("ResourceSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,12 +132,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_service_tasks_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_service_tasks_operations.py index 7ae439bb88d2..9da1ebb7c9a9 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_service_tasks_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_service_tasks_operations.py @@ -5,23 +5,276 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + group_name: str, + service_name: str, + *, + task_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if task_type is not None: + query_parameters['taskType'] = _SERIALIZER.query("task_type", task_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + group_name: str, + service_name: str, + task_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + group_name: str, + service_name: str, + task_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + group_name: str, + service_name: str, + task_name: str, + *, + delete_running_tasks: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if delete_running_tasks is not None: + query_parameters['deleteRunningTasks'] = _SERIALIZER.query("delete_running_tasks", delete_running_tasks, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + group_name: str, + service_name: str, + task_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request( + subscription_id: str, + group_name: str, + service_name: str, + task_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}/cancel') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ServiceTasksOperations(object): """ServiceTasksOperations operations. @@ -45,14 +298,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - group_name, # type: str - service_name, # type: str - task_type=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.TaskList"] + group_name: str, + service_name: str, + task_type: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.TaskList"]: """Get service level tasks for a service. The services resource is the top-level resource that represents the Database Migration Service. @@ -76,38 +329,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if task_type is not None: - query_parameters['taskType'] = self._serialize.query("task_type", task_type, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_type=task_type, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_type=task_type, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('TaskList', pipeline_response) + deserialized = self._deserialize("TaskList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,26 +370,27 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks'} # type: ignore + @distributed_trace def create_or_update( self, - group_name, # type: str - service_name, # type: str - task_name, # type: str - parameters, # type: "_models.ProjectTask" - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectTask" + group_name: str, + service_name: str, + task_name: str, + parameters: "_models.ProjectTask", + **kwargs: Any + ) -> "_models.ProjectTask": """Create or update service task. The service tasks resource is a nested, proxy-only resource representing work performed by a @@ -165,39 +416,29 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'ProjectTask') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_name=task_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectTask') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -210,17 +451,19 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'} # type: ignore + + @distributed_trace def get( self, - group_name, # type: str - service_name, # type: str - task_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectTask" + group_name: str, + service_name: str, + task_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.ProjectTask": """Get service task information. The service tasks resource is a nested, proxy-only resource representing work performed by a @@ -244,36 +487,25 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_name=task_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -282,17 +514,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'} # type: ignore + + @distributed_trace def delete( self, - group_name, # type: str - service_name, # type: str - task_name, # type: str - delete_running_tasks=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None + group_name: str, + service_name: str, + task_name: str, + delete_running_tasks: Optional[bool] = None, + **kwargs: Any + ) -> None: """Delete service task. The service tasks resource is a nested, proxy-only resource representing work performed by a @@ -316,36 +550,25 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if delete_running_tasks is not None: - query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_name=task_name, + delete_running_tasks=delete_running_tasks, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -353,15 +576,16 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'} # type: ignore + + @distributed_trace def update( self, - group_name, # type: str - service_name, # type: str - task_name, # type: str - parameters, # type: "_models.ProjectTask" - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectTask" + group_name: str, + service_name: str, + task_name: str, + parameters: "_models.ProjectTask", + **kwargs: Any + ) -> "_models.ProjectTask": """Create or update service task. The service tasks resource is a nested, proxy-only resource representing work performed by a @@ -386,39 +610,29 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'ProjectTask') + + request = build_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_name=task_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectTask') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -427,16 +641,18 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'} # type: ignore + + @distributed_trace def cancel( self, - group_name, # type: str - service_name, # type: str - task_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectTask" + group_name: str, + service_name: str, + task_name: str, + **kwargs: Any + ) -> "_models.ProjectTask": """Cancel a service task. The service tasks resource is a nested, proxy-only resource representing work performed by a @@ -458,34 +674,24 @@ def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + task_name=task_name, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -494,4 +700,6 @@ def cancel( return cls(pipeline_response, deserialized, {}) return deserialized + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}/cancel'} # type: ignore + diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_services_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_services_operations.py index d443ec5072f3..42d8b1b93072 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_services_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_services_operations.py @@ -5,25 +5,480 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_or_update_request_initial( + subscription_id: str, + group_name: str, + service_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + group_name: str, + service_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + group_name: str, + service_name: str, + *, + delete_running_tasks: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if delete_running_tasks is not None: + query_parameters['deleteRunningTasks'] = _SERIALIZER.query("delete_running_tasks", delete_running_tasks, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + group_name: str, + service_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_check_status_request( + subscription_id: str, + group_name: str, + service_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + group_name: str, + service_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + group_name: str, + service_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_skus_request( + subscription_id: str, + group_name: str, + service_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/skus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_check_children_name_availability_request( + subscription_id: str, + group_name: str, + service_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_check_name_availability_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ServicesOperations(object): """ServicesOperations operations. @@ -49,50 +504,38 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, - group_name, # type: str - service_name, # type: str - parameters, # type: "_models.DataMigrationService" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.DataMigrationService"] + group_name: str, + service_name: str, + parameters: "_models.DataMigrationService", + **kwargs: Any + ) -> Optional["_models.DataMigrationService"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DataMigrationService"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'DataMigrationService') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'DataMigrationService') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -105,16 +548,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - group_name, # type: str - service_name, # type: str - parameters, # type: "_models.DataMigrationService" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataMigrationService"] + group_name: str, + service_name: str, + parameters: "_models.DataMigrationService", + **kwargs: Any + ) -> LROPoller["_models.DataMigrationService"]: """Create or update DMS Instance. The services resource is the top-level resource that represents the Database Migration Service. @@ -134,15 +579,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.datamigration.models.DataMigrationService :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either DataMigrationService or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either DataMigrationService or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datamigration.models.DataMigrationService] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DataMigrationService"] lro_delay = kwargs.pop( 'polling_interval', @@ -154,27 +603,21 @@ def begin_create_or_update( group_name=group_name, service_name=service_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('DataMigrationService', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -186,15 +629,16 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + @distributed_trace def get( self, - group_name, # type: str - service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataMigrationService" + group_name: str, + service_name: str, + **kwargs: Any + ) -> "_models.DataMigrationService": """Get DMS Service Instance. The services resource is the top-level resource that represents the Database Migration Service. @@ -214,33 +658,23 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DataMigrationService', pipeline_response) @@ -249,65 +683,55 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + def _delete_initial( self, - group_name, # type: str - service_name, # type: str - delete_running_tasks=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None + group_name: str, + service_name: str, + delete_running_tasks: Optional[bool] = None, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if delete_running_tasks is not None: - query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + delete_running_tasks=delete_running_tasks, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - group_name, # type: str - service_name, # type: str - delete_running_tasks=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + group_name: str, + service_name: str, + delete_running_tasks: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: """Delete DMS Service Instance. The services resource is the top-level resource that represents the Database Migration Service. @@ -321,15 +745,17 @@ def begin_delete( :type delete_running_tasks: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -344,21 +770,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -370,54 +789,43 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore def _update_initial( self, - group_name, # type: str - service_name, # type: str - parameters, # type: "_models.DataMigrationService" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.DataMigrationService"] + group_name: str, + service_name: str, + parameters: "_models.DataMigrationService", + **kwargs: Any + ) -> Optional["_models.DataMigrationService"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DataMigrationService"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DataMigrationService') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'DataMigrationService') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -427,16 +835,18 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + + @distributed_trace def begin_update( self, - group_name, # type: str - service_name, # type: str - parameters, # type: "_models.DataMigrationService" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataMigrationService"] + group_name: str, + service_name: str, + parameters: "_models.DataMigrationService", + **kwargs: Any + ) -> LROPoller["_models.DataMigrationService"]: """Create or update DMS Service Instance. The services resource is the top-level resource that represents the Database Migration Service. @@ -452,15 +862,19 @@ def begin_update( :type parameters: ~azure.mgmt.datamigration.models.DataMigrationService :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either DataMigrationService or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either DataMigrationService or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datamigration.models.DataMigrationService] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DataMigrationService"] lro_delay = kwargs.pop( 'polling_interval', @@ -472,27 +886,21 @@ def begin_update( group_name=group_name, service_name=service_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('DataMigrationService', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -504,15 +912,16 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} # type: ignore + @distributed_trace def check_status( self, - group_name, # type: str - service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataMigrationServiceStatusResponse" + group_name: str, + service_name: str, + **kwargs: Any + ) -> "_models.DataMigrationServiceStatusResponse": """Check service health status. The services resource is the top-level resource that represents the Database Migration Service. @@ -533,33 +942,23 @@ def check_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.check_status.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_check_status_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self.check_status.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DataMigrationServiceStatusResponse', pipeline_response) @@ -568,61 +967,52 @@ def check_status( return cls(pipeline_response, deserialized, {}) return deserialized + check_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus'} # type: ignore + def _start_initial( self, - group_name, # type: str - service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + group_name: str, + service_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - group_name, # type: str - service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + group_name: str, + service_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Start service. The services resource is the top-level resource that represents the Database Migration Service. @@ -634,15 +1024,17 @@ def begin_start( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -656,21 +1048,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -682,61 +1067,51 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start'} # type: ignore def _stop_initial( self, - group_name, # type: str - service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + group_name: str, + service_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - group_name, # type: str - service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + group_name: str, + service_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stop service. The services resource is the top-level resource that represents the Database Migration Service. @@ -749,15 +1124,17 @@ def begin_stop( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -771,21 +1148,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -797,15 +1167,16 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop'} # type: ignore + @distributed_trace def list_skus( self, - group_name, # type: str - service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ServiceSkuList"] + group_name: str, + service_name: str, + **kwargs: Any + ) -> Iterable["_models.ServiceSkuList"]: """Get compatible SKUs. The services resource is the top-level resource that represents the Database Migration Service. @@ -825,36 +1196,33 @@ def list_skus( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_skus_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=self.list_skus.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_skus_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ServiceSkuList', pipeline_response) + deserialized = self._deserialize("ServiceSkuList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -867,25 +1235,26 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/skus'} # type: ignore + @distributed_trace def check_children_name_availability( self, - group_name, # type: str - service_name, # type: str - parameters, # type: "_models.NameAvailabilityRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.NameAvailabilityResponse" + group_name: str, + service_name: str, + parameters: "_models.NameAvailabilityRequest", + **kwargs: Any + ) -> "_models.NameAvailabilityResponse": """Check nested resource name validity and availability. This method checks whether a proposed nested resource name is valid and available. @@ -906,38 +1275,28 @@ def check_children_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_children_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NameAvailabilityRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_check_children_name_availability_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + content_type=content_type, + json=_json, + template_url=self.check_children_name_availability.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NameAvailabilityRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NameAvailabilityResponse', pipeline_response) @@ -946,14 +1305,16 @@ def check_children_name_availability( return cls(pipeline_response, deserialized, {}) return deserialized + check_children_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability'} # type: ignore + + @distributed_trace def list_by_resource_group( self, - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataMigrationServiceList"] + group_name: str, + **kwargs: Any + ) -> Iterable["_models.DataMigrationServiceList"]: """Get services in resource group. The Services resource is the top-level resource that represents the Database Migration Service. @@ -962,7 +1323,8 @@ def list_by_resource_group( :param group_name: Name of the resource group. :type group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataMigrationServiceList or the result of cls(response) + :return: An iterator like instance of either DataMigrationServiceList or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datamigration.models.DataMigrationServiceList] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -971,35 +1333,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('DataMigrationServiceList', pipeline_response) + deserialized = self._deserialize("DataMigrationServiceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1012,29 +1370,31 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services'} # type: ignore + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataMigrationServiceList"] + **kwargs: Any + ) -> Iterable["_models.DataMigrationServiceList"]: """Get services in subscription. The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataMigrationServiceList or the result of cls(response) + :return: An iterator like instance of either DataMigrationServiceList or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datamigration.models.DataMigrationServiceList] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -1043,34 +1403,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('DataMigrationServiceList', pipeline_response) + deserialized = self._deserialize("DataMigrationServiceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1083,24 +1438,25 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services'} # type: ignore + @distributed_trace def check_name_availability( self, - location, # type: str - parameters, # type: "_models.NameAvailabilityRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.NameAvailabilityResponse" + location: str, + parameters: "_models.NameAvailabilityRequest", + **kwargs: Any + ) -> "_models.NameAvailabilityResponse": """Check name validity and availability. This method checks whether a proposed top-level resource name is valid and available. @@ -1119,37 +1475,27 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NameAvailabilityRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_check_name_availability_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.check_name_availability.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NameAvailabilityRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NameAvailabilityResponse', pipeline_response) @@ -1158,4 +1504,6 @@ def check_name_availability( return cls(pipeline_response, deserialized, {}) return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability'} # type: ignore + diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_sql_migration_services_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_sql_migration_services_operations.py new file mode 100644 index 000000000000..264a0d730ecb --- /dev/null +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_sql_migration_services_operations.py @@ -0,0 +1,1286 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + resource_group_name: str, + sql_migration_service_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlMigrationServiceName": _SERIALIZER.url("sql_migration_service_name", sql_migration_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name: str, + sql_migration_service_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlMigrationServiceName": _SERIALIZER.url("sql_migration_service_name", sql_migration_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name: str, + sql_migration_service_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlMigrationServiceName": _SERIALIZER.url("sql_migration_service_name", sql_migration_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_update_request_initial( + resource_group_name: str, + sql_migration_service_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlMigrationServiceName": _SERIALIZER.url("sql_migration_service_name", sql_migration_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_by_resource_group_request( + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_auth_keys_request( + resource_group_name: str, + sql_migration_service_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listAuthKeys') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlMigrationServiceName": _SERIALIZER.url("sql_migration_service_name", sql_migration_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_regenerate_auth_keys_request( + resource_group_name: str, + sql_migration_service_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlMigrationServiceName": _SERIALIZER.url("sql_migration_service_name", sql_migration_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_node_request( + resource_group_name: str, + sql_migration_service_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlMigrationServiceName": _SERIALIZER.url("sql_migration_service_name", sql_migration_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_migrations_request( + resource_group_name: str, + sql_migration_service_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMigrations') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlMigrationServiceName": _SERIALIZER.url("sql_migration_service_name", sql_migration_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_monitoring_data_request( + resource_group_name: str, + sql_migration_service_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMonitoringData') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "sqlMigrationServiceName": _SERIALIZER.url("sql_migration_service_name", sql_migration_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_subscription_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/sqlMigrationServices') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class SqlMigrationServicesOperations(object): + """SqlMigrationServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.datamigration.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> "_models.SqlMigrationService": + """Retrieve the Database Migration Service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SqlMigrationService, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.SqlMigrationService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.SqlMigrationService", + **kwargs: Any + ) -> "_models.SqlMigrationService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SqlMigrationService') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.SqlMigrationService", + **kwargs: Any + ) -> LROPoller["_models.SqlMigrationService"]: + """Create or Update Database Migration Service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.SqlMigrationService + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either SqlMigrationService or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datamigration.models.SqlMigrationService] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Delete Database Migration Service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.SqlMigrationServiceUpdate", + **kwargs: Any + ) -> "_models.SqlMigrationService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SqlMigrationServiceUpdate') + + request = build_update_request_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.SqlMigrationServiceUpdate", + **kwargs: Any + ) -> LROPoller["_models.SqlMigrationService"]: + """Update Database Migration Service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.SqlMigrationServiceUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either SqlMigrationService or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datamigration.models.SqlMigrationService] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SqlMigrationService', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.SqlMigrationListResult"]: + """Retrieve all SQL migration services in the resource group. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlMigrationListResult or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datamigration.models.SqlMigrationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SqlMigrationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices'} # type: ignore + + @distributed_trace + def list_auth_keys( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> "_models.AuthenticationKeys": + """Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthenticationKeys, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.AuthenticationKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthenticationKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_auth_keys_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=self.list_auth_keys.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthenticationKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_auth_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listAuthKeys'} # type: ignore + + + @distributed_trace + def regenerate_auth_keys( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.RegenAuthKeys", + **kwargs: Any + ) -> "_models.RegenAuthKeys": + """Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.RegenAuthKeys + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegenAuthKeys, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.RegenAuthKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegenAuthKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'RegenAuthKeys') + + request = build_regenerate_auth_keys_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self.regenerate_auth_keys.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegenAuthKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + regenerate_auth_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys'} # type: ignore + + + @distributed_trace + def delete_node( + self, + resource_group_name: str, + sql_migration_service_name: str, + parameters: "_models.DeleteNode", + **kwargs: Any + ) -> "_models.DeleteNode": + """Delete the integration runtime node. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :param parameters: Details of SqlMigrationService resource. + :type parameters: ~azure.mgmt.datamigration.models.DeleteNode + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeleteNode, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.DeleteNode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeleteNode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DeleteNode') + + request = build_delete_node_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self.delete_node.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeleteNode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + delete_node.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode'} # type: ignore + + + @distributed_trace + def list_migrations( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> Iterable["_models.DatabaseMigrationListResult"]: + """Retrieve the List of database migrations attached to the service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DatabaseMigrationListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.datamigration.models.DatabaseMigrationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseMigrationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_migrations_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=self.list_migrations.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_migrations_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DatabaseMigrationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_migrations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMigrations'} # type: ignore + + @distributed_trace + def list_monitoring_data( + self, + resource_group_name: str, + sql_migration_service_name: str, + **kwargs: Any + ) -> "_models.IntegrationRuntimeMonitoringData": + """Retrieve the registered Integration Runtime nodes and their monitoring data for a given + Database Migration Service. + + :param resource_group_name: Name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param sql_migration_service_name: Name of the SQL Migration Service. + :type sql_migration_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationRuntimeMonitoringData, or the result of cls(response) + :rtype: ~azure.mgmt.datamigration.models.IntegrationRuntimeMonitoringData + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationRuntimeMonitoringData"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_monitoring_data_request( + resource_group_name=resource_group_name, + sql_migration_service_name=sql_migration_service_name, + subscription_id=self._config.subscription_id, + template_url=self.list_monitoring_data.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IntegrationRuntimeMonitoringData', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_monitoring_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMonitoringData'} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs: Any + ) -> Iterable["_models.SqlMigrationListResult"]: + """Retrieve all SQL migration services in the subscriptions. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlMigrationListResult or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datamigration.models.SqlMigrationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlMigrationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SqlMigrationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/sqlMigrationServices'} # type: ignore diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_tasks_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_tasks_operations.py index 87e484181c4f..9bb5fd6054b5 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_tasks_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_tasks_operations.py @@ -5,23 +5,336 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + *, + task_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if task_type is not None: + query_parameters['taskType'] = _SERIALIZER.query("task_type", task_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + task_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + task_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + task_name: str, + *, + delete_running_tasks: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if delete_running_tasks is not None: + query_parameters['deleteRunningTasks'] = _SERIALIZER.query("delete_running_tasks", delete_running_tasks, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + task_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + task_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_command_request( + subscription_id: str, + group_name: str, + service_name: str, + project_name: str, + task_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/command') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + "serviceName": _SERIALIZER.url("service_name", service_name, 'str'), + "projectName": _SERIALIZER.url("project_name", project_name, 'str'), + "taskName": _SERIALIZER.url("task_name", task_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class TasksOperations(object): """TasksOperations operations. @@ -45,15 +358,15 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - task_type=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.TaskList"] + group_name: str, + service_name: str, + project_name: str, + task_type: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.TaskList"]: """Get tasks in a service. The services resource is the top-level resource that represents the Database Migration Service. @@ -78,39 +391,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if task_type is not None: - query_parameters['taskType'] = self._serialize.query("task_type", task_type, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_type=task_type, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_type=task_type, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('TaskList', pipeline_response) + deserialized = self._deserialize("TaskList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -123,27 +434,28 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks'} # type: ignore + @distributed_trace def create_or_update( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - task_name, # type: str - parameters, # type: "_models.ProjectTask" - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectTask" + group_name: str, + service_name: str, + project_name: str, + task_name: str, + parameters: "_models.ProjectTask", + **kwargs: Any + ) -> "_models.ProjectTask": """Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS @@ -170,40 +482,30 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'ProjectTask') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectTask') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -216,18 +518,20 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} # type: ignore + + @distributed_trace def get( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - task_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectTask" + group_name: str, + service_name: str, + project_name: str, + task_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.ProjectTask": """Get task information. The tasks resource is a nested, proxy-only resource representing work performed by a DMS @@ -253,37 +557,26 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -292,18 +585,20 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} # type: ignore + + @distributed_trace def delete( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - task_name, # type: str - delete_running_tasks=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None + group_name: str, + service_name: str, + project_name: str, + task_name: str, + delete_running_tasks: Optional[bool] = None, + **kwargs: Any + ) -> None: """Delete task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS @@ -329,37 +624,26 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if delete_running_tasks is not None: - query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + delete_running_tasks=delete_running_tasks, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -367,16 +651,17 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} # type: ignore + + @distributed_trace def update( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - task_name, # type: str - parameters, # type: "_models.ProjectTask" - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectTask" + group_name: str, + service_name: str, + project_name: str, + task_name: str, + parameters: "_models.ProjectTask", + **kwargs: Any + ) -> "_models.ProjectTask": """Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS @@ -403,40 +688,30 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'ProjectTask') + + request = build_update_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ProjectTask') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -445,17 +720,19 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} # type: ignore + + @distributed_trace def cancel( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - task_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ProjectTask" + group_name: str, + service_name: str, + project_name: str, + task_name: str, + **kwargs: Any + ) -> "_models.ProjectTask": """Cancel a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS @@ -479,35 +756,25 @@ def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProjectTask', pipeline_response) @@ -516,18 +783,20 @@ def cancel( return cls(pipeline_response, deserialized, {}) return deserialized + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel'} # type: ignore + + @distributed_trace def command( self, - group_name, # type: str - service_name, # type: str - project_name, # type: str - task_name, # type: str - parameters, # type: "_models.CommandProperties" - **kwargs # type: Any - ): - # type: (...) -> "_models.CommandProperties" + group_name: str, + service_name: str, + project_name: str, + task_name: str, + parameters: "_models.CommandProperties", + **kwargs: Any + ) -> "_models.CommandProperties": """Execute a command on a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS @@ -553,40 +822,30 @@ def command( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.command.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'groupName': self._serialize.url("group_name", group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'projectName': self._serialize.url("project_name", project_name, 'str'), - 'taskName': self._serialize.url("task_name", task_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(parameters, 'CommandProperties') + + request = build_command_request( + subscription_id=self._config.subscription_id, + group_name=group_name, + service_name=service_name, + project_name=project_name, + task_name=task_name, + content_type=content_type, + json=_json, + template_url=self.command.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'CommandProperties') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CommandProperties', pipeline_response) @@ -595,4 +854,6 @@ def command( return cls(pipeline_response, deserialized, {}) return deserialized + command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/command'} # type: ignore + diff --git a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_usages_operations.py b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_usages_operations.py index 9139c217c67c..dabb46d0796d 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_usages_operations.py +++ b/sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_usages_operations.py @@ -5,23 +5,58 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + location: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/usages') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class UsagesOperations(object): """UsagesOperations operations. @@ -45,12 +80,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.QuotaList"] + location: str, + **kwargs: Any + ) -> Iterable["_models.QuotaList"]: """Get resource quotas and usage information. This method returns region-specific quotas and resource usage information for the Database @@ -68,35 +103,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-30" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('QuotaList', pipeline_response) + deserialized = self._deserialize("QuotaList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,12 +140,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data )