diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/__init__.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/__init__.py new file mode 100644 index 000000000000..50b17677a35b --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/__init__.py @@ -0,0 +1,18 @@ +# 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 .data_migration_service_client import DataMigrationServiceClient +from .version import VERSION + +__all__ = ['DataMigrationServiceClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/data_migration_service_client.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/data_migration_service_client.py new file mode 100644 index 000000000000..b705eda55e65 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/data_migration_service_client.py @@ -0,0 +1,106 @@ +# 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 msrest.service_client import ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.resource_skus_operations import ResourceSkusOperations +from .operations.services_operations import ServicesOperations +from .operations.tasks_operations import TasksOperations +from .operations.projects_operations import ProjectsOperations +from .operations.usages_operations import UsagesOperations +from .operations.operations import Operations +from . import models + + +class DataMigrationServiceClientConfiguration(AzureConfiguration): + """Configuration for DataMigrationServiceClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Identifier of the subscription + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(DataMigrationServiceClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-datamigration/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class DataMigrationServiceClient(object): + """Data Migration Client + + :ivar config: Configuration for client. + :vartype config: DataMigrationServiceClientConfiguration + + :ivar resource_skus: ResourceSkus operations + :vartype resource_skus: azure.mgmt.datamigration.operations.ResourceSkusOperations + :ivar services: Services operations + :vartype services: azure.mgmt.datamigration.operations.ServicesOperations + :ivar tasks: Tasks operations + :vartype tasks: azure.mgmt.datamigration.operations.TasksOperations + :ivar projects: Projects operations + :vartype projects: azure.mgmt.datamigration.operations.ProjectsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.datamigration.operations.UsagesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.datamigration.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Identifier of the subscription + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = DataMigrationServiceClientConfiguration(credentials, subscription_id, base_url) + self._client = ServiceClient(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2017-11-15-preview' + self._serialize = Serializer(client_models) + 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.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) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py new file mode 100644 index 000000000000..dec2f0cbe45d --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py @@ -0,0 +1,220 @@ +# 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 .tracked_resource import TrackedResource +from .resource import Resource +from .odata_error import ODataError +from .task_output import TaskOutput +from .validation_error import ValidationError +from .wait_statistics import WaitStatistics +from .execution_statistics import ExecutionStatistics +from .query_execution_result import QueryExecutionResult +from .query_analysis_validation_result import QueryAnalysisValidationResult +from .schema_comparison_validation_result_type import SchemaComparisonValidationResultType +from .schema_comparison_validation_result import SchemaComparisonValidationResult +from .data_integrity_validation_result import DataIntegrityValidationResult +from .migration_validation_database_level_result import MigrationValidationDatabaseLevelResult +from .migration_validation_database_summary_result import MigrationValidationDatabaseSummaryResult +from .migration_validation_result import MigrationValidationResult +from .reportable_exception import ReportableException +from .migrate_sql_server_sql_db_task_output_error import MigrateSqlServerSqlDbTaskOutputError +from .migrate_sql_server_sql_db_task_output_table_level import MigrateSqlServerSqlDbTaskOutputTableLevel +from .data_item_migration_summary_result import DataItemMigrationSummaryResult +from .migrate_sql_server_sql_db_task_output_database_level import MigrateSqlServerSqlDbTaskOutputDatabaseLevel +from .migration_report_result import MigrationReportResult +from .database_summary_result import DatabaseSummaryResult +from .migrate_sql_server_sql_db_task_output_migration_level import MigrateSqlServerSqlDbTaskOutputMigrationLevel +from .migrate_sql_server_sql_db_task_output import MigrateSqlServerSqlDbTaskOutput +from .connection_info import ConnectionInfo +from .sql_connection_info import SqlConnectionInfo +from .sql_migration_task_input import SqlMigrationTaskInput +from .migration_validation_options import MigrationValidationOptions +from .migrate_sql_server_sql_db_database_input import MigrateSqlServerSqlDbDatabaseInput +from .migrate_sql_server_sql_db_task_input import MigrateSqlServerSqlDbTaskInput +from .migrate_sql_server_sql_db_task_properties import MigrateSqlServerSqlDbTaskProperties +from .database_table import DatabaseTable +from .get_user_tables_sql_task_output import GetUserTablesSqlTaskOutput +from .get_user_tables_sql_task_input import GetUserTablesSqlTaskInput +from .get_user_tables_sql_task_properties import GetUserTablesSqlTaskProperties +from .connect_to_target_sql_db_task_output import ConnectToTargetSqlDbTaskOutput +from .connect_to_target_sql_db_task_input import ConnectToTargetSqlDbTaskInput +from .connect_to_target_sql_db_task_properties import ConnectToTargetSqlDbTaskProperties +from .database_file_info import DatabaseFileInfo +from .connect_to_source_sql_server_task_output_database_level import ConnectToSourceSqlServerTaskOutputDatabaseLevel +from .connect_to_source_sql_server_task_output_task_level import ConnectToSourceSqlServerTaskOutputTaskLevel +from .connect_to_source_sql_server_task_output import ConnectToSourceSqlServerTaskOutput +from .connect_to_source_sql_server_task_input import ConnectToSourceSqlServerTaskInput +from .connect_to_source_sql_server_task_properties import ConnectToSourceSqlServerTaskProperties +from .project_task_properties import ProjectTaskProperties +from .project_task import ProjectTask +from .service_sku import ServiceSku +from .data_migration_service import DataMigrationService +from .name_availability_request import NameAvailabilityRequest +from .database_info import DatabaseInfo +from .project import Project +from .api_error import ApiError, ApiErrorException +from .service_operation_display import ServiceOperationDisplay +from .service_operation import ServiceOperation +from .quota_name import QuotaName +from .quota import Quota +from .name_availability_response import NameAvailabilityResponse +from .available_service_sku_sku import AvailableServiceSkuSku +from .available_service_sku_capacity import AvailableServiceSkuCapacity +from .available_service_sku import AvailableServiceSku +from .data_migration_service_status_response import DataMigrationServiceStatusResponse +from .resource_sku_restrictions import ResourceSkuRestrictions +from .resource_sku_capabilities import ResourceSkuCapabilities +from .resource_sku_costs import ResourceSkuCosts +from .resource_sku_capacity import ResourceSkuCapacity +from .resource_sku import ResourceSku +from .database import Database +from .database_object_name import DatabaseObjectName +from .migration_table_metadata import MigrationTableMetadata +from .data_migration_project_metadata import DataMigrationProjectMetadata +from .data_migration_error import DataMigrationError +from .database_file_input import DatabaseFileInput +from .resource_sku_paged import ResourceSkuPaged +from .available_service_sku_paged import AvailableServiceSkuPaged +from .data_migration_service_paged import DataMigrationServicePaged +from .project_task_paged import ProjectTaskPaged +from .project_paged import ProjectPaged +from .quota_paged import QuotaPaged +from .service_operation_paged import ServiceOperationPaged +from .data_migration_service_client_enums import ( + ValidationStatus, + Severity, + UpdateActionType, + ObjectType, + MigrationState, + DatabaseMigrationStage, + MigrationStatus, + AuthenticationType, + DatabaseState, + DatabaseCompatLevel, + DatabaseFileType, + ServerLevelPermissionsGroup, + TaskState, + ServiceProvisioningState, + ProjectTargetPlatform, + ProjectSourcePlatform, + ProjectProvisioningState, + NameCheckFailureReason, + ServiceScalability, + ResourceSkuRestrictionsType, + ResourceSkuRestrictionsReasonCode, + ResourceSkuCapacityScaleType, + ErrorType, +) + +__all__ = [ + 'TrackedResource', + 'Resource', + 'ODataError', + 'TaskOutput', + 'ValidationError', + 'WaitStatistics', + 'ExecutionStatistics', + 'QueryExecutionResult', + 'QueryAnalysisValidationResult', + 'SchemaComparisonValidationResultType', + 'SchemaComparisonValidationResult', + 'DataIntegrityValidationResult', + 'MigrationValidationDatabaseLevelResult', + 'MigrationValidationDatabaseSummaryResult', + 'MigrationValidationResult', + 'ReportableException', + 'MigrateSqlServerSqlDbTaskOutputError', + 'MigrateSqlServerSqlDbTaskOutputTableLevel', + 'DataItemMigrationSummaryResult', + 'MigrateSqlServerSqlDbTaskOutputDatabaseLevel', + 'MigrationReportResult', + 'DatabaseSummaryResult', + 'MigrateSqlServerSqlDbTaskOutputMigrationLevel', + 'MigrateSqlServerSqlDbTaskOutput', + 'ConnectionInfo', + 'SqlConnectionInfo', + 'SqlMigrationTaskInput', + 'MigrationValidationOptions', + 'MigrateSqlServerSqlDbDatabaseInput', + 'MigrateSqlServerSqlDbTaskInput', + 'MigrateSqlServerSqlDbTaskProperties', + 'DatabaseTable', + 'GetUserTablesSqlTaskOutput', + 'GetUserTablesSqlTaskInput', + 'GetUserTablesSqlTaskProperties', + 'ConnectToTargetSqlDbTaskOutput', + 'ConnectToTargetSqlDbTaskInput', + 'ConnectToTargetSqlDbTaskProperties', + 'DatabaseFileInfo', + 'ConnectToSourceSqlServerTaskOutputDatabaseLevel', + 'ConnectToSourceSqlServerTaskOutputTaskLevel', + 'ConnectToSourceSqlServerTaskOutput', + 'ConnectToSourceSqlServerTaskInput', + 'ConnectToSourceSqlServerTaskProperties', + 'ProjectTaskProperties', + 'ProjectTask', + 'ServiceSku', + 'DataMigrationService', + 'NameAvailabilityRequest', + 'DatabaseInfo', + 'Project', + 'ApiError', 'ApiErrorException', + 'ServiceOperationDisplay', + 'ServiceOperation', + 'QuotaName', + 'Quota', + 'NameAvailabilityResponse', + 'AvailableServiceSkuSku', + 'AvailableServiceSkuCapacity', + 'AvailableServiceSku', + 'DataMigrationServiceStatusResponse', + 'ResourceSkuRestrictions', + 'ResourceSkuCapabilities', + 'ResourceSkuCosts', + 'ResourceSkuCapacity', + 'ResourceSku', + 'Database', + 'DatabaseObjectName', + 'MigrationTableMetadata', + 'DataMigrationProjectMetadata', + 'DataMigrationError', + 'DatabaseFileInput', + 'ResourceSkuPaged', + 'AvailableServiceSkuPaged', + 'DataMigrationServicePaged', + 'ProjectTaskPaged', + 'ProjectPaged', + 'QuotaPaged', + 'ServiceOperationPaged', + 'ValidationStatus', + 'Severity', + 'UpdateActionType', + 'ObjectType', + 'MigrationState', + 'DatabaseMigrationStage', + 'MigrationStatus', + 'AuthenticationType', + 'DatabaseState', + 'DatabaseCompatLevel', + 'DatabaseFileType', + 'ServerLevelPermissionsGroup', + 'TaskState', + 'ServiceProvisioningState', + 'ProjectTargetPlatform', + 'ProjectSourcePlatform', + 'ProjectProvisioningState', + 'NameCheckFailureReason', + 'ServiceScalability', + 'ResourceSkuRestrictionsType', + 'ResourceSkuRestrictionsReasonCode', + 'ResourceSkuCapacityScaleType', + 'ErrorType', +] diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/api_error.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/api_error.py new file mode 100644 index 000000000000..e14fcd41d59c --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/api_error.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ApiError(Model): + """Error information. + + :param error: Error information in OData format + :type error: ~azure.mgmt.datamigration.models.ODataError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ODataError'}, + } + + def __init__(self, error=None): + super(ApiError, self).__init__() + self.error = error + + +class ApiErrorException(HttpOperationError): + """Server responsed with exception of type: 'ApiError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ApiErrorException, self).__init__(deserialize, response, 'ApiError', *args) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku.py new file mode 100644 index 000000000000..3b186fc62c0a --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class AvailableServiceSku(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, resource_type=None, sku=None, capacity=None): + super(AvailableServiceSku, self).__init__() + self.resource_type = resource_type + self.sku = sku + self.capacity = capacity diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku_capacity.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku_capacity.py new file mode 100644 index 000000000000..4e097ee1e8db --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku_capacity.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class AvailableServiceSkuCapacity(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': 'ServiceScalability'}, + } + + def __init__(self, minimum=None, maximum=None, default=None, scale_type=None): + super(AvailableServiceSkuCapacity, self).__init__() + self.minimum = minimum + self.maximum = maximum + self.default = default + self.scale_type = scale_type diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku_paged.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku_paged.py new file mode 100644 index 000000000000..9f2cc2633422 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class AvailableServiceSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`AvailableServiceSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AvailableServiceSku]'} + } + + def __init__(self, *args, **kwargs): + + super(AvailableServiceSkuPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku_sku.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku_sku.py new file mode 100644 index 000000000000..730d866f2ae6 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/available_service_sku_sku.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class AvailableServiceSkuSku(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 "Free", "Basic", "Standard", or + "Premium" + :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, name=None, family=None, size=None, tier=None): + super(AvailableServiceSkuSku, self).__init__() + self.name = name + self.family = family + self.size = size + self.tier = tier diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_input.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_input.py new file mode 100644 index 000000000000..54902f30042c --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_input.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ConnectToSourceSqlServerTaskInput(Model): + """Input for the task that validates connection to SQL Server and also + validates source server requirements. + + :param source_connection_info: 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' + :type check_permissions_group: str or + ~azure.mgmt.datamigration.models.ServerLevelPermissionsGroup + """ + + _validation = { + 'source_connection_info': {'required': True}, + } + + _attribute_map = { + 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'SqlConnectionInfo'}, + 'check_permissions_group': {'key': 'checkPermissionsGroup', 'type': 'ServerLevelPermissionsGroup'}, + } + + def __init__(self, source_connection_info, check_permissions_group=None): + super(ConnectToSourceSqlServerTaskInput, self).__init__() + self.source_connection_info = source_connection_info + self.check_permissions_group = check_permissions_group diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_output.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_output.py new file mode 100644 index 000000000000..8c35558dab10 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_output.py @@ -0,0 +1,49 @@ +# 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 .task_output import TaskOutput + + +class ConnectToSourceSqlServerTaskOutput(TaskOutput): + """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: ConnectToSourceSqlServerTaskOutputDatabaseLevel, + ConnectToSourceSqlServerTaskOutputTaskLevel + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Result identifier + :vartype id: str + :param 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': 'ConnectToSourceSqlServerTaskOutputDatabaseLevel', 'TaskLevelOutput': 'ConnectToSourceSqlServerTaskOutputTaskLevel'} + } + + def __init__(self): + super(ConnectToSourceSqlServerTaskOutput, self).__init__() + self.result_type = None + self.result_type = 'ConnectToSourceSqlServerTaskOutput' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_output_database_level.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_output_database_level.py new file mode 100644 index 000000000000..777ede0da889 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_output_database_level.py @@ -0,0 +1,73 @@ +# 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 .connect_to_source_sql_server_task_output import ConnectToSourceSqlServerTaskOutput + + +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. + + :ivar id: Result identifier + :vartype id: str + :param result_type: 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': 'DatabaseCompatLevel'}, + 'database_state': {'key': 'databaseState', 'type': 'DatabaseState'}, + } + + def __init__(self): + super(ConnectToSourceSqlServerTaskOutputDatabaseLevel, self).__init__() + self.name = None + self.size_mb = None + self.database_files = None + self.compatibility_level = None + self.database_state = None + self.result_type = 'DatabaseLevelOutput' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_output_task_level.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_output_task_level.py new file mode 100644 index 000000000000..f900a9e0c2c1 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_output_task_level.py @@ -0,0 +1,62 @@ +# 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 .connect_to_source_sql_server_task_output import ConnectToSourceSqlServerTaskOutput + + +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. + + :ivar id: Result identifier + :vartype id: str + :param result_type: Constant filled by server. + :type result_type: str + :ivar databases: Source databases as a map from database name to database + id + :vartype databases: dict[str, 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}, + '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}'}, + 'source_server_version': {'key': 'sourceServerVersion', 'type': 'str'}, + 'source_server_brand_version': {'key': 'sourceServerBrandVersion', 'type': 'str'}, + 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, + } + + def __init__(self): + super(ConnectToSourceSqlServerTaskOutputTaskLevel, self).__init__() + self.databases = None + self.source_server_version = None + self.source_server_brand_version = None + self.validation_errors = None + self.result_type = 'TaskLevelOutput' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_properties.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_properties.py new file mode 100644 index 000000000000..a75e54b5d93c --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_source_sql_server_task_properties.py @@ -0,0 +1,57 @@ +# 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 .project_task_properties import ProjectTaskProperties + + +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. + + :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 + :param task_type: Constant filled by server. + :type task_type: 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 = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'task_type': {'required': True}, + 'output': {'readonly': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'TaskState'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'ConnectToSourceSqlServerTaskInput'}, + 'output': {'key': 'output', 'type': '[ConnectToSourceSqlServerTaskOutput]'}, + } + + def __init__(self, input=None): + super(ConnectToSourceSqlServerTaskProperties, self).__init__() + self.input = input + self.output = None + self.task_type = 'ConnectToSource.SqlServer' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_target_sql_db_task_input.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_target_sql_db_task_input.py new file mode 100644 index 000000000000..f417cb5bda21 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_target_sql_db_task_input.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class ConnectToTargetSqlDbTaskInput(Model): + """Input for the task that validates connection to SQL DB and target server + requirements. + + :param target_connection_info: 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, target_connection_info): + super(ConnectToTargetSqlDbTaskInput, self).__init__() + self.target_connection_info = target_connection_info diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_target_sql_db_task_output.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_target_sql_db_task_output.py new file mode 100644 index 000000000000..76c30a62b959 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_target_sql_db_task_output.py @@ -0,0 +1,51 @@ +# 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 .task_output import TaskOutput + + +class ConnectToTargetSqlDbTaskOutput(TaskOutput): + """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: dict[str, 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): + super(ConnectToTargetSqlDbTaskOutput, self).__init__() + self.databases = None + self.target_server_version = None + self.target_server_brand_version = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_target_sql_db_task_properties.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_target_sql_db_task_properties.py new file mode 100644 index 000000000000..efdb1ed1554a --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_target_sql_db_task_properties.py @@ -0,0 +1,57 @@ +# 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 .project_task_properties import ProjectTaskProperties + + +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. + + :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 + :param task_type: Constant filled by server. + :type task_type: 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 = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'task_type': {'required': True}, + 'output': {'readonly': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'TaskState'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'ConnectToTargetSqlDbTaskInput'}, + 'output': {'key': 'output', 'type': '[ConnectToTargetSqlDbTaskOutput]'}, + } + + def __init__(self, input=None): + super(ConnectToTargetSqlDbTaskProperties, self).__init__() + self.input = input + self.output = None + self.task_type = 'ConnectToTarget.SqlDb' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info.py new file mode 100644 index 000000000000..ec5678bf3f56 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class ConnectionInfo(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: SqlConnectionInfo + + :param user_name: User name + :type user_name: str + :param password: Password credential. + :type password: str + :param type: Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'SqlConnectionInfo': 'SqlConnectionInfo'} + } + + def __init__(self, user_name=None, password=None): + super(ConnectionInfo, self).__init__() + self.user_name = user_name + self.password = password + self.type = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_integrity_validation_result.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_integrity_validation_result.py new file mode 100644 index 000000000000..2d659aeac9fa --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_integrity_validation_result.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class DataIntegrityValidationResult(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, failed_objects=None, validation_errors=None): + super(DataIntegrityValidationResult, self).__init__() + self.failed_objects = failed_objects + self.validation_errors = validation_errors diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_item_migration_summary_result.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_item_migration_summary_result.py new file mode 100644 index 000000000000..f47fdd682558 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_item_migration_summary_result.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class DataItemMigrationSummaryResult(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 + :ivar ended_on: Migration end time + :vartype ended_on: 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': 'MigrationState'}, + '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): + super(DataItemMigrationSummaryResult, self).__init__() + 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 diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_error.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_error.py new file mode 100644 index 000000000000..7af9c3d70deb --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_error.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class DataMigrationError(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: 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': 'ErrorType'}, + } + + def __init__(self, type=None): + super(DataMigrationError, self).__init__() + self.message = None + self.type = type diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_project_metadata.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_project_metadata.py new file mode 100644 index 000000000000..34425519b63c --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_project_metadata.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class DataMigrationProjectMetadata(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): + super(DataMigrationProjectMetadata, self).__init__() + 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 diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service.py new file mode 100644 index 000000000000..406312afde19 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service.py @@ -0,0 +1,82 @@ +# 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 .tracked_resource import TrackedResource + + +class DataMigrationService(TrackedResource): + """A Data Migration Service 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Resource location. + :type location: str + :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 + :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 sku: Service SKU + :type sku: ~azure.mgmt.datamigration.models.ServiceSku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'virtual_subnet_id': {'required': 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'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ServiceProvisioningState'}, + 'public_key': {'key': 'properties.publicKey', 'type': 'str'}, + 'virtual_subnet_id': {'key': 'properties.virtualSubnetId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ServiceSku'}, + } + + def __init__(self, location, virtual_subnet_id, tags=None, etag=None, kind=None, public_key=None, sku=None): + super(DataMigrationService, self).__init__(tags=tags, location=location) + self.etag = etag + self.kind = kind + self.provisioning_state = None + self.public_key = public_key + self.virtual_subnet_id = virtual_subnet_id + self.sku = sku diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service_client_enums.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service_client_enums.py new file mode 100644 index 000000000000..dc1cdd93cebb --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service_client_enums.py @@ -0,0 +1,212 @@ +# 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 enum import Enum + + +class ValidationStatus(Enum): + + default = "Default" + not_started = "NotStarted" + initialized = "Initialized" + in_progress = "InProgress" + completed = "Completed" + completed_with_issues = "CompletedWithIssues" + failed = "Failed" + stopped = "Stopped" + + +class Severity(Enum): + + message = "Message" + warning = "Warning" + error = "Error" + + +class UpdateActionType(Enum): + + deleted_on_target = "DeletedOnTarget" + changed_on_target = "ChangedOnTarget" + added_on_target = "AddedOnTarget" + + +class ObjectType(Enum): + + stored_procedures = "StoredProcedures" + table = "Table" + user = "User" + view = "View" + function = "Function" + + +class MigrationState(Enum): + + none = "None" + in_progress = "InProgress" + failed = "Failed" + warning = "Warning" + completed = "Completed" + skipped = "Skipped" + stopped = "Stopped" + + +class DatabaseMigrationStage(Enum): + + none = "None" + initialize = "Initialize" + backup = "Backup" + file_copy = "FileCopy" + restore = "Restore" + completed = "Completed" + + +class MigrationStatus(Enum): + + default = "Default" + connecting = "Connecting" + source_and_target_selected = "SourceAndTargetSelected" + select_logins = "SelectLogins" + configured = "Configured" + running = "Running" + error = "Error" + stopped = "Stopped" + completed = "Completed" + completed_with_warnings = "CompletedWithWarnings" + + +class AuthenticationType(Enum): + + none = "None" + windows_authentication = "WindowsAuthentication" + sql_authentication = "SqlAuthentication" + active_directory_integrated = "ActiveDirectoryIntegrated" + active_directory_password = "ActiveDirectoryPassword" + + +class DatabaseState(Enum): + + online = "Online" + restoring = "Restoring" + recovering = "Recovering" + recovery_pending = "RecoveryPending" + suspect = "Suspect" + emergency = "Emergency" + offline = "Offline" + copying = "Copying" + offline_secondary = "OfflineSecondary" + + +class DatabaseCompatLevel(Enum): + + compat_level80 = "CompatLevel80" + compat_level90 = "CompatLevel90" + compat_level100 = "CompatLevel100" + compat_level110 = "CompatLevel110" + compat_level120 = "CompatLevel120" + compat_level130 = "CompatLevel130" + compat_level140 = "CompatLevel140" + + +class DatabaseFileType(Enum): + + rows = "Rows" + log = "Log" + filestream = "Filestream" + not_supported = "NotSupported" + fulltext = "Fulltext" + + +class ServerLevelPermissionsGroup(Enum): + + default = "Default" + migration_from_sql_server_to_azure_db = "MigrationFromSqlServerToAzureDB" + + +class TaskState(Enum): + + unknown = "Unknown" + queued = "Queued" + running = "Running" + canceled = "Canceled" + succeeded = "Succeeded" + failed = "Failed" + failed_input_validation = "FailedInputValidation" + faulted = "Faulted" + + +class ServiceProvisioningState(Enum): + + accepted = "Accepted" + deleting = "Deleting" + deploying = "Deploying" + stopped = "Stopped" + stopping = "Stopping" + starting = "Starting" + failed_to_start = "FailedToStart" + failed_to_stop = "FailedToStop" + succeeded = "Succeeded" + failed = "Failed" + + +class ProjectTargetPlatform(Enum): + + sqldb = "SQLDB" + unknown = "Unknown" + + +class ProjectSourcePlatform(Enum): + + sql = "SQL" + unknown = "Unknown" + + +class ProjectProvisioningState(Enum): + + deleting = "Deleting" + succeeded = "Succeeded" + + +class NameCheckFailureReason(Enum): + + already_exists = "AlreadyExists" + invalid = "Invalid" + + +class ServiceScalability(Enum): + + none = "none" + manual = "manual" + automatic = "automatic" + + +class ResourceSkuRestrictionsType(Enum): + + location = "location" + + +class ResourceSkuRestrictionsReasonCode(Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" + + +class ResourceSkuCapacityScaleType(Enum): + + automatic = "Automatic" + manual = "Manual" + none = "None" + + +class ErrorType(Enum): + + default = "Default" + warning = "Warning" + error = "Error" diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service_paged.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service_paged.py new file mode 100644 index 000000000000..c49a03551cb3 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class DataMigrationServicePaged(Paged): + """ + A paging container for iterating over a list of :class:`DataMigrationService ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataMigrationService]'} + } + + def __init__(self, *args, **kwargs): + + super(DataMigrationServicePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service_status_response.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service_status_response.py new file mode 100644 index 000000000000..3c90e5c91eda --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/data_migration_service_status_response.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class DataMigrationServiceStatusResponse(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, agent_version=None, status=None, vm_size=None, supported_task_types=None): + super(DataMigrationServiceStatusResponse, self).__init__() + self.agent_version = agent_version + self.status = status + self.vm_size = vm_size + self.supported_task_types = supported_task_types diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database.py new file mode 100644 index 000000000000..899be5b033e3 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database.py @@ -0,0 +1,100 @@ +# 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 msrest.serialization import Model + + +class Database(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': 'DatabaseCompatLevel'}, + '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': 'DatabaseState'}, + 'server_id': {'key': 'serverId', 'type': 'str'}, + } + + def __init__(self, id=None, name=None, compatibility_level=None, collation=None, server_name=None, fqdn=None, install_id=None, server_version=None, server_edition=None, server_level=None, server_default_data_path=None, server_default_log_path=None, server_default_backup_path=None, server_core_count=None, server_visible_online_core_count=None, database_state=None, server_id=None): + super(Database, self).__init__() + self.id = id + self.name = name + self.compatibility_level = compatibility_level + self.collation = collation + self.server_name = server_name + self.fqdn = fqdn + self.install_id = install_id + self.server_version = server_version + self.server_edition = server_edition + self.server_level = server_level + self.server_default_data_path = server_default_data_path + self.server_default_log_path = server_default_log_path + self.server_default_backup_path = server_default_backup_path + self.server_core_count = server_core_count + self.server_visible_online_core_count = server_visible_online_core_count + self.database_state = database_state + self.server_id = server_id diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_file_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_file_info.py new file mode 100644 index 000000000000..f41a47199e00 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_file_info.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class DatabaseFileInfo(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': 'DatabaseFileType'}, + 'size_mb': {'key': 'sizeMB', 'type': 'float'}, + } + + def __init__(self, database_name=None, id=None, logical_name=None, physical_full_name=None, restore_full_name=None, file_type=None, size_mb=None): + super(DatabaseFileInfo, self).__init__() + self.database_name = database_name + self.id = id + self.logical_name = logical_name + self.physical_full_name = physical_full_name + self.restore_full_name = restore_full_name + self.file_type = file_type + self.size_mb = size_mb diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_file_input.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_file_input.py new file mode 100644 index 000000000000..95c61e2ae7cf --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_file_input.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class DatabaseFileInput(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': 'DatabaseFileType'}, + } + + def __init__(self, id=None, logical_name=None, physical_full_name=None, restore_full_name=None, file_type=None): + super(DatabaseFileInput, self).__init__() + self.id = id + self.logical_name = logical_name + self.physical_full_name = physical_full_name + self.restore_full_name = restore_full_name + self.file_type = file_type diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_info.py new file mode 100644 index 000000000000..8d4172eb1063 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_info.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class DatabaseInfo(Model): + """Project Database Details. + + :param source_database_name: 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, source_database_name): + super(DatabaseInfo, self).__init__() + self.source_database_name = source_database_name diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_object_name.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_object_name.py new file mode 100644 index 000000000000..1131a5d2971d --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_object_name.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class DatabaseObjectName(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': 'ObjectType'}, + } + + def __init__(self, object_type=None): + super(DatabaseObjectName, self).__init__() + self.database_name = None + self.object_name = None + self.schema_name = None + self.object_type = object_type diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_summary_result.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_summary_result.py new file mode 100644 index 000000000000..a1bf93eb9a92 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_summary_result.py @@ -0,0 +1,74 @@ +# 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 .data_item_migration_summary_result import DataItemMigrationSummaryResult + + +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 + :ivar ended_on: Migration end time + :vartype ended_on: 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': 'MigrationState'}, + '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): + super(DatabaseSummaryResult, self).__init__() + self.size_mb = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_table.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_table.py new file mode 100644 index 000000000000..685fcca40a7c --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/database_table.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class DatabaseTable(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): + super(DatabaseTable, self).__init__() + self.has_rows = None + self.name = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/execution_statistics.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/execution_statistics.py new file mode 100644 index 000000000000..aa54dea81c8e --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/execution_statistics.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class ExecutionStatistics(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, execution_count=None, cpu_time_ms=None, elapsed_time_ms=None, wait_stats=None, has_errors=None, sql_errors=None): + super(ExecutionStatistics, self).__init__() + self.execution_count = execution_count + self.cpu_time_ms = cpu_time_ms + self.elapsed_time_ms = elapsed_time_ms + self.wait_stats = wait_stats + self.has_errors = has_errors + self.sql_errors = sql_errors diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/get_user_tables_sql_task_input.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/get_user_tables_sql_task_input.py new file mode 100644 index 000000000000..8207803dbbe7 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/get_user_tables_sql_task_input.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class GetUserTablesSqlTaskInput(Model): + """Input for the task that collects user tables for the given list of + databases. + + :param connection_info: Connection information for SQL Server + :type connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo + :param selected_databases: 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, connection_info, selected_databases): + super(GetUserTablesSqlTaskInput, self).__init__() + self.connection_info = connection_info + self.selected_databases = selected_databases diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/get_user_tables_sql_task_output.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/get_user_tables_sql_task_output.py new file mode 100644 index 000000000000..b62a051b515a --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/get_user_tables_sql_task_output.py @@ -0,0 +1,47 @@ +# 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 .task_output import TaskOutput + + +class GetUserTablesSqlTaskOutput(TaskOutput): + """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: dict[str, + list[~azure.mgmt.datamigration.models.DatabaseTable]] + :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': '{[DatabaseTable]}'}, + 'validation_errors': {'key': 'validationErrors', 'type': '[ReportableException]'}, + } + + def __init__(self): + super(GetUserTablesSqlTaskOutput, self).__init__() + self.databases_to_tables = None + self.validation_errors = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/get_user_tables_sql_task_properties.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/get_user_tables_sql_task_properties.py new file mode 100644 index 000000000000..6d48f80492a8 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/get_user_tables_sql_task_properties.py @@ -0,0 +1,56 @@ +# 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 .project_task_properties import ProjectTaskProperties + + +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. + + :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 + :param task_type: Constant filled by server. + :type task_type: 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 = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'task_type': {'required': True}, + 'output': {'readonly': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'TaskState'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'GetUserTablesSqlTaskInput'}, + 'output': {'key': 'output', 'type': '[GetUserTablesSqlTaskOutput]'}, + } + + def __init__(self, input=None): + super(GetUserTablesSqlTaskProperties, self).__init__() + self.input = input + self.output = None + self.task_type = 'GetUserTables.Sql' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_database_input.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_database_input.py new file mode 100644 index 000000000000..323847870dbf --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_database_input.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class MigrateSqlServerSqlDbDatabaseInput(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, name=None, target_database_name=None, make_source_db_read_only=None, table_map=None): + super(MigrateSqlServerSqlDbDatabaseInput, self).__init__() + 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 diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_input.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_input.py new file mode 100644 index 000000000000..b00e84e522cd --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_input.py @@ -0,0 +1,59 @@ +# 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 .sql_migration_task_input import SqlMigrationTaskInput + + +class MigrateSqlServerSqlDbTaskInput(SqlMigrationTaskInput): + """Input for the task that migrates on-prem SQL Server databases to Azure SQL + Database. + + :param source_connection_info: Information for connecting to source + :type source_connection_info: + ~azure.mgmt.datamigration.models.SqlConnectionInfo + :param target_connection_info: Information for connecting to target + :type target_connection_info: + ~azure.mgmt.datamigration.models.SqlConnectionInfo + :param selected_databases: 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, source_connection_info, target_connection_info, selected_databases, validation_options=None): + super(MigrateSqlServerSqlDbTaskInput, self).__init__(source_connection_info=source_connection_info, target_connection_info=target_connection_info) + self.selected_databases = selected_databases + self.validation_options = validation_options diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output.py new file mode 100644 index 000000000000..db0319ef3a36 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output.py @@ -0,0 +1,51 @@ +# 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 .task_output import TaskOutput + + +class MigrateSqlServerSqlDbTaskOutput(TaskOutput): + """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: MigrateSqlServerSqlDbTaskOutputError, + MigrateSqlServerSqlDbTaskOutputTableLevel, + MigrateSqlServerSqlDbTaskOutputDatabaseLevel, + MigrateSqlServerSqlDbTaskOutputMigrationLevel + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Result identifier + :vartype id: str + :param 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': {'ErrorOutput': 'MigrateSqlServerSqlDbTaskOutputError', 'TableLevelOutput': 'MigrateSqlServerSqlDbTaskOutputTableLevel', 'DatabaseLevelOutput': 'MigrateSqlServerSqlDbTaskOutputDatabaseLevel', 'MigrationLevelOutput': 'MigrateSqlServerSqlDbTaskOutputMigrationLevel'} + } + + def __init__(self): + super(MigrateSqlServerSqlDbTaskOutput, self).__init__() + self.result_type = None + self.result_type = 'MigrateSqlServerSqlDbTaskOutput' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_database_level.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_database_level.py new file mode 100644 index 000000000000..6e0b95229eec --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_database_level.py @@ -0,0 +1,118 @@ +# 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 .migrate_sql_server_sql_db_task_output import MigrateSqlServerSqlDbTaskOutput + + +class MigrateSqlServerSqlDbTaskOutputDatabaseLevel(MigrateSqlServerSqlDbTaskOutput): + """MigrateSqlServerSqlDbTaskOutputDatabaseLevel. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Result identifier + :vartype id: str + :param 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 + :ivar ended_on: Migration end time + :vartype ended_on: 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: dict[str, + ~azure.mgmt.datamigration.models.DataItemMigrationSummaryResult] + """ + + _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': 'MigrationState'}, + 'stage': {'key': 'stage', 'type': 'DatabaseMigrationStage'}, + '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': '{DataItemMigrationSummaryResult}'}, + } + + def __init__(self): + super(MigrateSqlServerSqlDbTaskOutputDatabaseLevel, self).__init__() + 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 + self.result_type = 'DatabaseLevelOutput' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_error.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_error.py new file mode 100644 index 000000000000..663cf4b0e2f4 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_error.py @@ -0,0 +1,44 @@ +# 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 .migrate_sql_server_sql_db_task_output import MigrateSqlServerSqlDbTaskOutput + + +class MigrateSqlServerSqlDbTaskOutputError(MigrateSqlServerSqlDbTaskOutput): + """MigrateSqlServerSqlDbTaskOutputError. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Result identifier + :vartype id: str + :param 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): + super(MigrateSqlServerSqlDbTaskOutputError, self).__init__() + self.error = None + self.result_type = 'ErrorOutput' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_migration_level.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_migration_level.py new file mode 100644 index 000000000000..eb31196efc0a --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_migration_level.py @@ -0,0 +1,116 @@ +# 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 .migrate_sql_server_sql_db_task_output import MigrateSqlServerSqlDbTaskOutput + + +class MigrateSqlServerSqlDbTaskOutputMigrationLevel(MigrateSqlServerSqlDbTaskOutput): + """MigrateSqlServerSqlDbTaskOutputMigrationLevel. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Result identifier + :vartype id: str + :param result_type: Constant filled by server. + :type result_type: str + :ivar started_on: Migration start time + :vartype started_on: datetime + :ivar ended_on: Migration end time + :vartype ended_on: 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: dict[str, str] + :ivar database_summary: Summary of database results in the migration + :vartype database_summary: dict[str, + ~azure.mgmt.datamigration.models.DatabaseSummaryResult] + :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': 'MigrationStatus'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'databases': {'key': 'databases', 'type': '{str}'}, + 'database_summary': {'key': 'databaseSummary', 'type': '{DatabaseSummaryResult}'}, + '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, migration_report_result=None): + super(MigrateSqlServerSqlDbTaskOutputMigrationLevel, self).__init__() + 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_report_result = migration_report_result + 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.result_type = 'MigrationLevelOutput' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_table_level.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_table_level.py new file mode 100644 index 000000000000..a367c60599c4 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_output_table_level.py @@ -0,0 +1,87 @@ +# 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 .migrate_sql_server_sql_db_task_output import MigrateSqlServerSqlDbTaskOutput + + +class MigrateSqlServerSqlDbTaskOutputTableLevel(MigrateSqlServerSqlDbTaskOutput): + """MigrateSqlServerSqlDbTaskOutputTableLevel. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Result identifier + :vartype id: str + :param 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 + :ivar ended_on: Migration end time + :vartype ended_on: 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': 'MigrationState'}, + '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): + super(MigrateSqlServerSqlDbTaskOutputTableLevel, self).__init__() + 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.result_type = 'TableLevelOutput' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_properties.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_properties.py new file mode 100644 index 000000000000..f91c678a2669 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_sql_server_sql_db_task_properties.py @@ -0,0 +1,57 @@ +# 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 .project_task_properties import ProjectTaskProperties + + +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. + + :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 + :param task_type: Constant filled by server. + :type task_type: 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 = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'task_type': {'required': True}, + 'output': {'readonly': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'TaskState'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MigrateSqlServerSqlDbTaskInput'}, + 'output': {'key': 'output', 'type': '[MigrateSqlServerSqlDbTaskOutput]'}, + } + + def __init__(self, input=None): + super(MigrateSqlServerSqlDbTaskProperties, self).__init__() + self.input = input + self.output = None + self.task_type = 'Migrate.SqlServer.SqlDb' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_report_result.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_report_result.py new file mode 100644 index 000000000000..46536a5b5133 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_report_result.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class MigrationReportResult(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, id=None, report_url=None): + super(MigrationReportResult, self).__init__() + self.id = id + self.report_url = report_url diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_table_metadata.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_table_metadata.py new file mode 100644 index 000000000000..7b1feba4549c --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_table_metadata.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class MigrationTableMetadata(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): + super(MigrationTableMetadata, self).__init__() + self.source_table_name = None + self.target_table_name = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_database_level_result.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_database_level_result.py new file mode 100644 index 000000000000..2e398ae16a56 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_database_level_result.py @@ -0,0 +1,88 @@ +# 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 msrest.serialization import Model + + +class MigrationValidationDatabaseLevelResult(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 + :ivar ended_on: Validation end time + :vartype ended_on: 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', 'Failed', 'Stopped' + :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': 'ValidationStatus'}, + } + + def __init__(self): + super(MigrationValidationDatabaseLevelResult, self).__init__() + 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 diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_database_summary_result.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_database_summary_result.py new file mode 100644 index 000000000000..707979420a6f --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_database_summary_result.py @@ -0,0 +1,67 @@ +# 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 msrest.serialization import Model + + +class MigrationValidationDatabaseSummaryResult(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 + :ivar ended_on: Validation end time + :vartype ended_on: datetime + :ivar status: Current status of validation at the database level. Possible + values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', + 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped' + :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': 'ValidationStatus'}, + } + + def __init__(self): + super(MigrationValidationDatabaseSummaryResult, self).__init__() + 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 diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_options.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_options.py new file mode 100644 index 000000000000..7c4ab1a05430 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_options.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class MigrationValidationOptions(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, enable_schema_validation=None, enable_data_integrity_validation=None, enable_query_analysis_validation=None): + super(MigrationValidationOptions, self).__init__() + self.enable_schema_validation = enable_schema_validation + self.enable_data_integrity_validation = enable_data_integrity_validation + self.enable_query_analysis_validation = enable_query_analysis_validation diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_result.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_result.py new file mode 100644 index 000000000000..12d4bc6e38dd --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migration_validation_result.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class MigrationValidationResult(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', 'Failed', 'Stopped' + :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': 'ValidationStatus'}, + } + + def __init__(self, summary_results=None): + super(MigrationValidationResult, self).__init__() + self.id = None + self.migration_id = None + self.summary_results = summary_results + self.status = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/name_availability_request.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/name_availability_request.py new file mode 100644 index 000000000000..795c6c4a8279 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/name_availability_request.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class NameAvailabilityRequest(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, name=None, type=None): + super(NameAvailabilityRequest, self).__init__() + self.name = name + self.type = type diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/name_availability_response.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/name_availability_response.py new file mode 100644 index 000000000000..a7704fe8c971 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/name_availability_response.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class NameAvailabilityResponse(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': 'NameCheckFailureReason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, name_available=None, reason=None, message=None): + super(NameAvailabilityResponse, self).__init__() + self.name_available = name_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/odata_error.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/odata_error.py new file mode 100644 index 000000000000..df8a46d6a46f --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/odata_error.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class ODataError(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, code=None, message=None, details=None): + super(ODataError, self).__init__() + self.code = code + self.message = message + self.details = details diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project.py new file mode 100644 index 000000000000..8b41856152a8 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project.py @@ -0,0 +1,89 @@ +# 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 .tracked_resource import TrackedResource + + +class Project(TrackedResource): + """A project 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Resource location. + :type location: str + :param source_platform: Source platform for the project. Possible values + include: 'SQL', 'Unknown' + :type source_platform: str or + ~azure.mgmt.datamigration.models.ProjectSourcePlatform + :param target_platform: Target platform for the project. Possible values + include: 'SQLDB', '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 + :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}, + 'source_platform': {'required': True}, + 'target_platform': {'required': 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'}, + 'source_platform': {'key': 'properties.sourcePlatform', 'type': 'ProjectSourcePlatform'}, + 'target_platform': {'key': 'properties.targetPlatform', 'type': 'ProjectTargetPlatform'}, + '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': 'ProjectProvisioningState'}, + } + + def __init__(self, location, source_platform, target_platform, tags=None, source_connection_info=None, target_connection_info=None, databases_info=None): + super(Project, self).__init__(tags=tags, location=location) + self.source_platform = source_platform + self.target_platform = target_platform + self.creation_time = None + self.source_connection_info = source_connection_info + self.target_connection_info = target_connection_info + self.databases_info = databases_info + self.provisioning_state = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_paged.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_paged.py new file mode 100644 index 000000000000..4b7bbb6b5dd0 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ProjectPaged(Paged): + """ + A paging container for iterating over a list of :class:`Project ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Project]'} + } + + def __init__(self, *args, **kwargs): + + super(ProjectPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task.py new file mode 100644 index 000000000000..27d49f6eee3f --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task.py @@ -0,0 +1,50 @@ +# 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 .resource import Resource + + +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 + """ + + _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'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProjectTaskProperties'}, + } + + def __init__(self, etag=None, properties=None): + super(ProjectTask, self).__init__() + self.etag = etag + self.properties = properties diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_paged.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_paged.py new file mode 100644 index 000000000000..c55903ccf8a6 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ProjectTaskPaged(Paged): + """ + A paging container for iterating over a list of :class:`ProjectTask ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ProjectTask]'} + } + + def __init__(self, *args, **kwargs): + + super(ProjectTaskPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_properties.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_properties.py new file mode 100644 index 000000000000..098ceaab0869 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_properties.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class ProjectTaskProperties(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: MigrateSqlServerSqlDbTaskProperties, + GetUserTablesSqlTaskProperties, ConnectToTargetSqlDbTaskProperties, + ConnectToSourceSqlServerTaskProperties + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + :param task_type: Constant filled by server. + :type task_type: str + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'task_type': {'required': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'TaskState'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + } + + _subtype_map = { + 'task_type': {'Migrate.SqlServer.SqlDb': 'MigrateSqlServerSqlDbTaskProperties', 'GetUserTables.Sql': 'GetUserTablesSqlTaskProperties', 'ConnectToTarget.SqlDb': 'ConnectToTargetSqlDbTaskProperties', 'ConnectToSource.SqlServer': 'ConnectToSourceSqlServerTaskProperties'} + } + + def __init__(self): + super(ProjectTaskProperties, self).__init__() + self.errors = None + self.state = None + self.task_type = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/query_analysis_validation_result.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/query_analysis_validation_result.py new file mode 100644 index 000000000000..b3adaf681836 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/query_analysis_validation_result.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class QueryAnalysisValidationResult(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, query_results=None, validation_errors=None): + super(QueryAnalysisValidationResult, self).__init__() + self.query_results = query_results + self.validation_errors = validation_errors diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/query_execution_result.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/query_execution_result.py new file mode 100644 index 000000000000..7341c78ec708 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/query_execution_result.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class QueryExecutionResult(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, query_text=None, statements_in_batch=None, source_result=None, target_result=None): + super(QueryExecutionResult, self).__init__() + self.query_text = query_text + self.statements_in_batch = statements_in_batch + self.source_result = source_result + self.target_result = target_result diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/quota.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/quota.py new file mode 100644 index 000000000000..de4eb5ff65f3 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/quota.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class Quota(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, current_value=None, id=None, limit=None, name=None, unit=None): + super(Quota, self).__init__() + self.current_value = current_value + self.id = id + self.limit = limit + self.name = name + self.unit = unit diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/quota_name.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/quota_name.py new file mode 100644 index 000000000000..a32622e91e6b --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/quota_name.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class QuotaName(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, localized_value=None, value=None): + super(QuotaName, self).__init__() + self.localized_value = localized_value + self.value = value diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/quota_paged.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/quota_paged.py new file mode 100644 index 000000000000..804619b87737 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/quota_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class QuotaPaged(Paged): + """ + A paging container for iterating over a list of :class:`Quota ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Quota]'} + } + + def __init__(self, *args, **kwargs): + + super(QuotaPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/reportable_exception.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/reportable_exception.py new file mode 100644 index 000000000000..44237ae5f196 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/reportable_exception.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ReportableException(Model): + """Exception object for all custom exceptions. + + :param message: Error message + :type 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'}, + '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, message=None, file_path=None, line_number=None, h_result=None, stack_trace=None): + super(ReportableException, self).__init__() + self.message = message + self.file_path = file_path + self.line_number = line_number + self.h_result = h_result + self.stack_trace = stack_trace diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource.py new file mode 100644 index 000000000000..a2ddd410be1b --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Resource(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): + super(Resource, self).__init__() + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku.py new file mode 100644 index 000000000000..afce3c7b4d8b --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku.py @@ -0,0 +1,93 @@ +# 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 msrest.serialization import Model + + +class ResourceSku(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): + super(ResourceSku, self).__init__() + 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 diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_capabilities.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_capabilities.py new file mode 100644 index 000000000000..278f55789e9e --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_capabilities.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ResourceSkuCapabilities(Model): + """Describes The SKU capabilites 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): + super(ResourceSkuCapabilities, self).__init__() + self.name = None + self.value = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_capacity.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_capacity.py new file mode 100644 index 000000000000..af5208854205 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_capacity.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class ResourceSkuCapacity(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': 'ResourceSkuCapacityScaleType'}, + } + + def __init__(self): + super(ResourceSkuCapacity, self).__init__() + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_costs.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_costs.py new file mode 100644 index 000000000000..103f21eb6428 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_costs.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ResourceSkuCosts(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): + super(ResourceSkuCosts, self).__init__() + self.meter_id = None + self.quantity = None + self.extended_unit = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_paged.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_paged.py new file mode 100644 index 000000000000..2c654d80d650 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ResourceSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceSku]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceSkuPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_restrictions.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_restrictions.py new file mode 100644 index 000000000000..82168cb58466 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/resource_sku_restrictions.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class ResourceSkuRestrictions(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': 'ResourceSkuRestrictionsType'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'ResourceSkuRestrictionsReasonCode'}, + } + + def __init__(self): + super(ResourceSkuRestrictions, self).__init__() + self.type = None + self.values = None + self.reason_code = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/schema_comparison_validation_result.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/schema_comparison_validation_result.py new file mode 100644 index 000000000000..48c955b62d48 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/schema_comparison_validation_result.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class SchemaComparisonValidationResult(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, schema_differences=None, validation_errors=None, source_database_object_count=None, target_database_object_count=None): + super(SchemaComparisonValidationResult, self).__init__() + self.schema_differences = schema_differences + self.validation_errors = validation_errors + self.source_database_object_count = source_database_object_count + self.target_database_object_count = target_database_object_count diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/schema_comparison_validation_result_type.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/schema_comparison_validation_result_type.py new file mode 100644 index 000000000000..5a497c6d60e4 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/schema_comparison_validation_result_type.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class SchemaComparisonValidationResultType(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': 'ObjectType'}, + 'update_action': {'key': 'updateAction', 'type': 'UpdateActionType'}, + } + + def __init__(self, object_name=None, object_type=None, update_action=None): + super(SchemaComparisonValidationResultType, self).__init__() + self.object_name = object_name + self.object_type = object_type + self.update_action = update_action diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_operation.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_operation.py new file mode 100644 index 000000000000..2c5599d0beb4 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_operation.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class ServiceOperation(Model): + """Description of an action supported by the Data 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, name=None, display=None): + super(ServiceOperation, self).__init__() + self.name = name + self.display = display diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_operation_display.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_operation_display.py new file mode 100644 index 000000000000..49c68d1c9442 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_operation_display.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ServiceOperationDisplay(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, provider=None, resource=None, operation=None, description=None): + super(ServiceOperationDisplay, self).__init__() + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_operation_paged.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_operation_paged.py new file mode 100644 index 000000000000..955dcd654588 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_operation_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ServiceOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServiceOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServiceOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(ServiceOperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_sku.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_sku.py new file mode 100644 index 000000000000..3a77e8efabd4 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/service_sku.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class ServiceSku(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 'Free', 'Basic', 'Standard', or + 'Premium' + :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, name=None, tier=None, family=None, size=None, capacity=None): + super(ServiceSku, self).__init__() + self.name = name + self.tier = tier + self.family = family + self.size = size + self.capacity = capacity diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/sql_connection_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/sql_connection_info.py new file mode 100644 index 000000000000..6f7905d6765b --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/sql_connection_info.py @@ -0,0 +1,65 @@ +# 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 .connection_info import ConnectionInfo + + +class SqlConnectionInfo(ConnectionInfo): + """Information for connecting to SQL database server. + + :param user_name: User name + :type user_name: str + :param password: Password credential. + :type password: str + :param type: Constant filled by server. + :type type: str + :param data_source: 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. Default + value: True . + :type encrypt_connection: bool + :param additional_settings: Additional connection settings + :type additional_settings: str + :param trust_server_certificate: Whether to trust the server certificate. + Default value: False . + :type trust_server_certificate: bool + """ + + _validation = { + 'type': {'required': True}, + 'data_source': {'required': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'AuthenticationType'}, + 'encrypt_connection': {'key': 'encryptConnection', 'type': 'bool'}, + 'additional_settings': {'key': 'additionalSettings', 'type': 'str'}, + 'trust_server_certificate': {'key': 'trustServerCertificate', 'type': 'bool'}, + } + + def __init__(self, data_source, user_name=None, password=None, authentication=None, encrypt_connection=True, additional_settings=None, trust_server_certificate=False): + super(SqlConnectionInfo, self).__init__(user_name=user_name, password=password) + self.data_source = data_source + self.authentication = authentication + self.encrypt_connection = encrypt_connection + self.additional_settings = additional_settings + self.trust_server_certificate = trust_server_certificate + self.type = 'SqlConnectionInfo' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/sql_migration_task_input.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/sql_migration_task_input.py new file mode 100644 index 000000000000..77b0562eb6f9 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/sql_migration_task_input.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class SqlMigrationTaskInput(Model): + """Base class for migration task input. + + :param source_connection_info: Information for connecting to source + :type source_connection_info: + ~azure.mgmt.datamigration.models.SqlConnectionInfo + :param target_connection_info: 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, source_connection_info, target_connection_info): + super(SqlMigrationTaskInput, self).__init__() + self.source_connection_info = source_connection_info + self.target_connection_info = target_connection_info diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/task_output.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/task_output.py new file mode 100644 index 000000000000..a70c25e06381 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/task_output.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class TaskOutput(Model): + """Base class for all DMS task outputs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Result identifier + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self): + super(TaskOutput, self).__init__() + self.id = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/tracked_resource.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/tracked_resource.py new file mode 100644 index 000000000000..b60f8ddede5f --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/tracked_resource.py @@ -0,0 +1,51 @@ +# 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 .resource import Resource + + +class TrackedResource(Resource): + """ARM tracked top level 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Resource location. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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'}, + } + + def __init__(self, location, tags=None): + super(TrackedResource, self).__init__() + self.tags = tags + self.location = location diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/validation_error.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/validation_error.py new file mode 100644 index 000000000000..b36c35e47315 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/validation_error.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class ValidationError(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': 'Severity'}, + } + + def __init__(self, text=None, severity=None): + super(ValidationError, self).__init__() + self.text = text + self.severity = severity diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/wait_statistics.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/wait_statistics.py new file mode 100644 index 000000000000..cdad32c6a8b2 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/wait_statistics.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class WaitStatistics(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) . Default value: 0 + . + :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, wait_type=None, wait_time_ms=0, wait_count=None): + super(WaitStatistics, self).__init__() + self.wait_type = wait_type + self.wait_time_ms = wait_time_ms + self.wait_count = wait_count diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py new file mode 100644 index 000000000000..dae6a3120660 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py @@ -0,0 +1,26 @@ +# 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 .resource_skus_operations import ResourceSkusOperations +from .services_operations import ServicesOperations +from .tasks_operations import TasksOperations +from .projects_operations import ProjectsOperations +from .usages_operations import UsagesOperations +from .operations import Operations + +__all__ = [ + 'ResourceSkusOperations', + 'ServicesOperations', + 'TasksOperations', + 'ProjectsOperations', + 'UsagesOperations', + 'Operations', +] diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/operations.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/operations.py new file mode 100644 index 000000000000..31458e628e8f --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/operations.py @@ -0,0 +1,100 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API. Constant value: "2017-11-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-11-15-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get available resource provider actions (operations). + + Lists all available actions exposed by the Data Migration Service + resource provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ServiceOperation + :rtype: + ~azure.mgmt.datamigration.models.ServiceOperationPaged[~azure.mgmt.datamigration.models.ServiceOperation] + :raises: + :class:`ApiErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ServiceOperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ServiceOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.DataMigration/operations'} diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/projects_operations.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/projects_operations.py new file mode 100644 index 000000000000..3e925cccc461 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/projects_operations.py @@ -0,0 +1,392 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProjectsOperations(object): + """ProjectsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API. Constant value: "2017-11-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-11-15-preview" + + self.config = config + + def list( + self, group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get projects in a service. + + The project resource is a nested resource representing a stored + migration project. This method returns a list of projects owned by a + service resource. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Project + :rtype: + ~azure.mgmt.datamigration.models.ProjectPaged[~azure.mgmt.datamigration.models.Project] + :raises: + :class:`ApiErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProjectPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProjectPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects'} + + def create_or_update( + self, parameters, group_name, service_name, project_name, custom_headers=None, raw=False, **operation_config): + """Create or update project. + + The project resource is a nested resource representing a stored + migration project. The PUT method creates a new project or updates an + existing one. + + :param parameters: Information about the project + :type parameters: ~azure.mgmt.datamigration.models.Project + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param project_name: Name of the project + :type project_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Project or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.Project or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Project') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Project', response) + if response.status_code == 201: + deserialized = self._deserialize('Project', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} + + def get( + self, group_name, service_name, project_name, custom_headers=None, raw=False, **operation_config): + """Get project information. + + The project resource is a nested resource representing a stored + migration project. The GET method retrieves information about a + project. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param project_name: Name of the project + :type project_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Project or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.Project or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Project', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} + + def delete( + self, group_name, service_name, project_name, delete_running_tasks=None, custom_headers=None, raw=False, **operation_config): + """Delete project. + + The project resource is a nested resource representing a stored + migration project. The DELETE method deletes a project. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param project_name: Name of the project + :type project_name: str + :param delete_running_tasks: Delete the resource even if it contains + running tasks + :type delete_running_tasks: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + if delete_running_tasks is not None: + query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ApiErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} + + def update( + self, parameters, group_name, service_name, project_name, custom_headers=None, raw=False, **operation_config): + """Update project. + + The project resource is a nested resource representing a stored + migration project. The PATCH method updates an existing project. + + :param parameters: Information about the project + :type parameters: ~azure.mgmt.datamigration.models.Project + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param project_name: Name of the project + :type project_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Project or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.Project or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Project') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Project', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'} diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/resource_skus_operations.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/resource_skus_operations.py new file mode 100644 index 000000000000..6c9e083a565b --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/resource_skus_operations.py @@ -0,0 +1,103 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ResourceSkusOperations(object): + """ResourceSkusOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API. Constant value: "2017-11-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-11-15-preview" + + self.config = config + + def list_skus( + self, custom_headers=None, raw=False, **operation_config): + """Get supported SKUs. + + The skus action returns the list of SKUs that DMS supports. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourceSku + :rtype: + ~azure.mgmt.datamigration.models.ResourceSkuPaged[~azure.mgmt.datamigration.models.ResourceSku] + :raises: + :class:`ApiErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_skus.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceSkuPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/skus'} diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/services_operations.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/services_operations.py new file mode 100644 index 000000000000..8e48a0ffa8f0 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/services_operations.py @@ -0,0 +1,1087 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrest.exceptions import DeserializationError +from msrestazure.azure_operation import AzureOperationPoller + +from .. import models + + +class ServicesOperations(object): + """ServicesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API. Constant value: "2017-11-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-11-15-preview" + + self.config = config + + + def _create_or_update_initial( + self, parameters, group_name, service_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DataMigrationService') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DataMigrationService', response) + if response.status_code == 201: + deserialized = self._deserialize('DataMigrationService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, parameters, group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Create or update DMS Instance. + + The services resource is the top-level resource that represents the + Data Migration Service. The PUT method creates a new service or updates + an existing one. When a service is updated, existing child resources + (i.e. tasks) are unaffected. Services currently support a single kind, + "vm", which refers to a VM-based service, although other kinds may be + added in the future. This method can change the kind, SKU, and network + of the service, but if tasks are currently running (i.e. the service is + busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The + provider will reply when successful with 200 OK or 201 Created. + Long-running operations use the provisioningState property. + + :param parameters: Information about the service + :type parameters: + ~azure.mgmt.datamigration.models.DataMigrationService + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns + DataMigrationService or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datamigration.models.DataMigrationService] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + raw_result = self._create_or_update_initial( + parameters=parameters, + group_name=group_name, + service_name=service_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 201, 202]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = self._deserialize('DataMigrationService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} + + def get( + self, group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get DMS Service Instance. + + The services resource is the top-level resource that represents the + Data Migration Service. The GET method retrieves information about a + service instance. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DataMigrationService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.DataMigrationService or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DataMigrationService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} + + + def _delete_initial( + self, group_name, service_name, delete_running_tasks=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + if delete_running_tasks is not None: + query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ApiErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, group_name, service_name, delete_running_tasks=None, custom_headers=None, raw=False, **operation_config): + """Delete DMS Service Instance. + + The services resource is the top-level resource that represents the + Data Migration Service. The DELETE method deletes a service. Any + running tasks will be canceled. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param delete_running_tasks: Delete the resource even if it contains + running tasks + :type delete_running_tasks: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + raw_result = self._delete_initial( + group_name=group_name, + service_name=service_name, + delete_running_tasks=delete_running_tasks, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202, 204]: + raise models.ApiErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} + + + def _update_initial( + self, parameters, group_name, service_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DataMigrationService') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DataMigrationService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, parameters, group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Create or update DMS Service Instance. + + The services resource is the top-level resource that represents the + Data Migration Service. The PATCH method updates an existing service. + This method can change the kind, SKU, and network of the service, but + if tasks are currently running (i.e. the service is busy), this will + fail with 400 Bad Request ("ServiceIsBusy"). + + :param parameters: Information about the service + :type parameters: + ~azure.mgmt.datamigration.models.DataMigrationService + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns + DataMigrationService or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datamigration.models.DataMigrationService] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + raw_result = self._update_initial( + parameters=parameters, + group_name=group_name, + service_name=service_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = self._deserialize('DataMigrationService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'} + + def check_status( + self, group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Check service health status. + + The services resource is the top-level resource that represents the + Data Migration Service. This action performs a health check and returns + the status of the service and virtual machine size. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DataMigrationServiceStatusResponse or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.datamigration.models.DataMigrationServiceStatusResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.check_status.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DataMigrationServiceStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus'} + + + def _start_initial( + self, group_name, service_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ApiErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def start( + self, group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Start service. + + The services resource is the top-level resource that represents the + Data Migration Service. This action starts the service and the service + can be used for data migration. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + raw_result = self._start_initial( + group_name=group_name, + service_name=service_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202]: + raise models.ApiErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start'} + + + def _stop_initial( + self, group_name, service_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ApiErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop( + self, group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Stop service. + + The services resource is the top-level resource that represents the + Data Migration Service. This action stops the service and the service + cannot be used for data migration. The service owner won't be billed + when the service is stopped. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + raw_result = self._stop_initial( + group_name=group_name, + service_name=service_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202]: + raise models.ApiErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop'} + + def list_skus( + self, group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get compatible SKUs. + + The services resource is the top-level resource that represents the + Data Migration Service. The skus action returns the list of SKUs that a + service resource can be updated to. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AvailableServiceSku + :rtype: + ~azure.mgmt.datamigration.models.AvailableServiceSkuPaged[~azure.mgmt.datamigration.models.AvailableServiceSku] + :raises: + :class:`ApiErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_skus.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.AvailableServiceSkuPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AvailableServiceSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/skus'} + + def check_children_name_availability( + self, group_name, service_name, name=None, type=None, custom_headers=None, raw=False, **operation_config): + """Check nested resource name validity and availability. + + This method checks whether a proposed nested resource name is valid and + available. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param name: The proposed resource name + :type name: str + :param type: The resource type chain (e.g. virtualMachines/extensions) + :type type: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NameAvailabilityResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.NameAvailabilityResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + parameters = models.NameAvailabilityRequest(name=name, type=type) + + # Construct URL + url = self.check_children_name_availability.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'NameAvailabilityRequest') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NameAvailabilityResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_children_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability'} + + def list_by_resource_group( + self, group_name, custom_headers=None, raw=False, **operation_config): + """Get services in resource group. + + The Services resource is the top-level resource that represents the + Data Migration Service. This method returns a list of service resources + in a resource group. + + :param group_name: Name of the resource group + :type group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DataMigrationService + :rtype: + ~azure.mgmt.datamigration.models.DataMigrationServicePaged[~azure.mgmt.datamigration.models.DataMigrationService] + :raises: + :class:`ApiErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DataMigrationServicePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DataMigrationServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get services in subscription. + + The services resource is the top-level resource that represents the + Data Migration Service. This method returns a list of service resources + in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DataMigrationService + :rtype: + ~azure.mgmt.datamigration.models.DataMigrationServicePaged[~azure.mgmt.datamigration.models.DataMigrationService] + :raises: + :class:`ApiErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DataMigrationServicePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DataMigrationServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services'} + + def check_name_availability( + self, location, name=None, type=None, custom_headers=None, raw=False, **operation_config): + """Check name validity and availability. + + This method checks whether a proposed top-level resource name is valid + and available. + + :param location: The Azure region of the operation + :type location: str + :param name: The proposed resource name + :type name: str + :param type: The resource type chain (e.g. virtualMachines/extensions) + :type type: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NameAvailabilityResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.NameAvailabilityResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + parameters = models.NameAvailabilityRequest(name=name, type=type) + + # Construct URL + url = self.check_name_availability.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'NameAvailabilityRequest') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NameAvailabilityResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability'} diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/tasks_operations.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/tasks_operations.py new file mode 100644 index 000000000000..452ebf83d5d4 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/tasks_operations.py @@ -0,0 +1,504 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TasksOperations(object): + """TasksOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API. Constant value: "2017-11-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-11-15-preview" + + self.config = config + + def list( + self, group_name, service_name, project_name, task_type=None, custom_headers=None, raw=False, **operation_config): + """Get tasks in a service. + + The services resource is the top-level resource that represents the + Data Migration Service. This method returns a list of tasks owned by a + service resource. Some tasks may have a status of Unknown, which + indicates that an error occurred while querying the status of that + task. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param project_name: Name of the project + :type project_name: str + :param task_type: Filter tasks by task type + :type task_type: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ProjectTask + :rtype: + ~azure.mgmt.datamigration.models.ProjectTaskPaged[~azure.mgmt.datamigration.models.ProjectTask] + :raises: + :class:`ApiErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if task_type is not None: + query_parameters['taskType'] = self._serialize.query("task_type", task_type, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProjectTaskPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProjectTaskPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks'} + + def create_or_update( + self, group_name, service_name, project_name, task_name, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Create or update task. + + The tasks resource is a nested, proxy-only resource representing work + performed by a DMS instance. The PUT method creates a new task or + updates an existing one, although since tasks have no mutable custom + properties, there is little reason to update an exising one. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param project_name: Name of the project + :type project_name: str + :param task_name: Name of the Task + :type task_name: 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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ProjectTask or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.ProjectTask or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + parameters = models.ProjectTask(etag=etag, properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ProjectTask') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProjectTask', response) + if response.status_code == 201: + deserialized = self._deserialize('ProjectTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} + + def get( + self, group_name, service_name, project_name, task_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get task information. + + The tasks resource is a nested, proxy-only resource representing work + performed by a DMS instance. The GET method retrieves information about + a task. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param project_name: Name of the project + :type project_name: str + :param task_name: Name of the Task + :type task_name: str + :param expand: Expand the response + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ProjectTask or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.ProjectTask or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProjectTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} + + def delete( + self, group_name, service_name, project_name, task_name, delete_running_tasks=None, custom_headers=None, raw=False, **operation_config): + """Delete task. + + The tasks resource is a nested, proxy-only resource representing work + performed by a DMS instance. The DELETE method deletes a task, + canceling it first if it's running. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param project_name: Name of the project + :type project_name: str + :param task_name: Name of the Task + :type task_name: str + :param delete_running_tasks: Delete the resource even if it contains + running tasks + :type delete_running_tasks: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + if delete_running_tasks is not None: + query_parameters['deleteRunningTasks'] = self._serialize.query("delete_running_tasks", delete_running_tasks, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ApiErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} + + def update( + self, group_name, service_name, project_name, task_name, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Create or update task. + + The tasks resource is a nested, proxy-only resource representing work + performed by a DMS instance. The PATCH method updates an existing task, + but since tasks have no mutable custom properties, there is little + reason to do so. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param project_name: Name of the project + :type project_name: str + :param task_name: Name of the Task + :type task_name: 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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ProjectTask or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.ProjectTask or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + parameters = models.ProjectTask(etag=etag, properties=properties) + + # Construct URL + url = self.update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ProjectTask') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProjectTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'} + + def cancel( + self, group_name, service_name, project_name, task_name, custom_headers=None, raw=False, **operation_config): + """Cancel a task. + + The tasks resource is a nested, proxy-only resource representing work + performed by a DMS instance. This method cancels a task if it's + currently queued or running. + + :param group_name: Name of the resource group + :type group_name: str + :param service_name: Name of the service + :type service_name: str + :param project_name: Name of the project + :type project_name: str + :param task_name: Name of the Task + :type task_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ProjectTask or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.ProjectTask or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.cancel.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProjectTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel'} diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/usages_operations.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/usages_operations.py new file mode 100644 index 000000000000..1a426755d7b8 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/usages_operations.py @@ -0,0 +1,107 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class UsagesOperations(object): + """UsagesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API. Constant value: "2017-11-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-11-15-preview" + + self.config = config + + def list( + self, location, custom_headers=None, raw=False, **operation_config): + """Get resource quotas and usage information. + + This method returns region-specific quotas and resource usage + information for the Data Migration Service. + + :param location: The Azure region of the operation + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Quota + :rtype: + ~azure.mgmt.datamigration.models.QuotaPaged[~azure.mgmt.datamigration.models.Quota] + :raises: + :class:`ApiErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QuotaPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QuotaPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/usages'} diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" +