From 0cabe7b46569b269d057b0b6353b34b1e67e1979 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 1 Oct 2018 12:50:38 -0700 Subject: [PATCH 1/4] Generated from b729557b5b0c560d6dc8c702b926f626d773e4ac (#3472) Fix ref/allOf in same object. --- azure-mgmt-datamigration/azure/mgmt/datamigration/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py index 53c4c7ea05e8..e0ec669828cb 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "0.1.0" From 4d08779531d575b9ffe8988e530b27baa0eff53d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 24 Oct 2018 14:35:07 -0700 Subject: [PATCH 2/4] [AutoPR datamigration/resource-manager] Updates to Schema migration, project files resource and MongoDb scenario. (#3620) * Generated from 15db3a1eb5955b63b419027978ceb13d1b8a421d Add missing files upload option for Schema migration scenario. Add support for MongoDb migration acenario. * Packaging update of azure-mgmt-datamigration --- azure-mgmt-datamigration/MANIFEST.in | 3 + .../data_migration_service_client.py | 5 + .../mgmt/datamigration/models/__init__.py | 93 ++- .../connect_to_mongo_db_task_properties.py | 62 ++ ...connect_to_mongo_db_task_properties_py3.py | 62 ++ .../datamigration/models/connection_info.py | 4 +- .../models/connection_info_py3.py | 4 +- .../data_migration_service_client_enums.py | 45 ++ .../datamigration/models/file_storage_info.py | 32 + .../models/file_storage_info_py3.py | 32 + .../migrate_mongo_db_task_properties.py | 61 ++ .../migrate_mongo_db_task_properties_py3.py | 61 ++ ...schema_sql_server_sql_db_database_input.py | 4 + ...ma_sql_server_sql_db_database_input_py3.py | 6 +- .../models/mongo_db_cluster_info.py | 53 ++ .../models/mongo_db_cluster_info_py3.py | 53 ++ .../models/mongo_db_collection_info.py | 94 +++ .../models/mongo_db_collection_info_py3.py | 94 +++ .../models/mongo_db_collection_progress.py | 101 ++++ .../mongo_db_collection_progress_py3.py | 101 ++++ .../models/mongo_db_collection_settings.py | 38 ++ .../mongo_db_collection_settings_py3.py | 38 ++ .../models/mongo_db_connection_info.py | 47 ++ .../models/mongo_db_connection_info_py3.py | 47 ++ .../models/mongo_db_database_info.py | 67 +++ .../models/mongo_db_database_info_py3.py | 67 +++ .../models/mongo_db_database_progress.py | 107 ++++ .../models/mongo_db_database_progress_py3.py | 107 ++++ .../models/mongo_db_database_settings.py | 43 ++ .../models/mongo_db_database_settings_py3.py | 43 ++ .../datamigration/models/mongo_db_error.py | 43 ++ .../models/mongo_db_error_py3.py | 43 ++ .../models/mongo_db_migration_progress.py | 107 ++++ .../models/mongo_db_migration_progress_py3.py | 107 ++++ .../models/mongo_db_migration_settings.py | 67 +++ .../models/mongo_db_migration_settings_py3.py | 67 +++ .../models/mongo_db_object_info.py | 58 ++ .../models/mongo_db_object_info_py3.py | 58 ++ .../datamigration/models/mongo_db_progress.py | 115 ++++ .../models/mongo_db_progress_py3.py | 115 ++++ .../models/mongo_db_shard_key_field.py | 40 ++ .../models/mongo_db_shard_key_field_py3.py | 40 ++ .../models/mongo_db_shard_key_info.py | 39 ++ .../models/mongo_db_shard_key_info_py3.py | 39 ++ .../models/mongo_db_shard_key_setting.py | 39 ++ .../models/mongo_db_shard_key_setting_py3.py | 39 ++ .../models/mongo_db_throttling_settings.py | 39 ++ .../mongo_db_throttling_settings_py3.py | 39 ++ .../mgmt/datamigration/models/project.py | 5 +- .../mgmt/datamigration/models/project_file.py | 50 ++ .../models/project_file_paged.py | 27 + .../models/project_file_properties.py | 55 ++ .../models/project_file_properties_py3.py | 55 ++ .../datamigration/models/project_file_py3.py | 50 ++ .../mgmt/datamigration/models/project_py3.py | 5 +- .../models/project_task_properties.py | 8 +- .../models/project_task_properties_py3.py | 8 +- .../validate_mongo_db_task_properties.py | 63 ++ .../validate_mongo_db_task_properties_py3.py | 63 ++ .../mgmt/datamigration/operations/__init__.py | 2 + .../operations/files_operations.py | 548 ++++++++++++++++++ 61 files changed, 3586 insertions(+), 21 deletions(-) create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_mongo_db_task_properties.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_mongo_db_task_properties_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/file_storage_info.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/file_storage_info_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_mongo_db_task_properties.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_mongo_db_task_properties_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cluster_info.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cluster_info_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_info.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_info_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_progress.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_progress_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_settings.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_settings_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_connection_info.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_connection_info_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_info.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_info_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_progress.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_progress_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_settings.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_settings_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_error.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_error_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_progress.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_progress_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_settings.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_settings_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_object_info.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_object_info_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_progress.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_progress_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_field.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_field_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_info.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_info_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_setting.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_setting_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_throttling_settings.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_throttling_settings_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_paged.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/validate_mongo_db_task_properties.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/validate_mongo_db_task_properties_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/operations/files_operations.py diff --git a/azure-mgmt-datamigration/MANIFEST.in b/azure-mgmt-datamigration/MANIFEST.in index bb37a2723dae..6ceb27f7a96e 100644 --- a/azure-mgmt-datamigration/MANIFEST.in +++ b/azure-mgmt-datamigration/MANIFEST.in @@ -1 +1,4 @@ include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + 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 index 5fb7c0ebb1fe..8f91d1c9f822 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/data_migration_service_client.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/data_migration_service_client.py @@ -19,6 +19,7 @@ from .operations.projects_operations import ProjectsOperations from .operations.usages_operations import UsagesOperations from .operations.operations import Operations +from .operations.files_operations import FilesOperations from . import models @@ -72,6 +73,8 @@ class DataMigrationServiceClient(SDKClient): :vartype usages: azure.mgmt.datamigration.operations.UsagesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.datamigration.operations.Operations + :ivar files: Files operations + :vartype files: azure.mgmt.datamigration.operations.FilesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -103,3 +106,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.files = FilesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py index d3904f749467..c4d6afeb19c5 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py @@ -10,23 +10,38 @@ # -------------------------------------------------------------------------- try: + from .tracked_resource_py3 import TrackedResource + from .resource_py3 import Resource + from .project_file_properties_py3 import ProjectFileProperties + from .project_file_py3 import ProjectFile from .odata_error_py3 import ODataError from .reportable_exception_py3 import ReportableException from .migrate_sync_complete_command_output_py3 import MigrateSyncCompleteCommandOutput from .migrate_sync_complete_command_input_py3 import MigrateSyncCompleteCommandInput from .migrate_sync_complete_command_properties_py3 import MigrateSyncCompleteCommandProperties from .command_properties_py3 import CommandProperties - from .tracked_resource_py3 import TrackedResource - from .resource_py3 import Resource from .get_tde_certificates_sql_task_output_py3 import GetTdeCertificatesSqlTaskOutput from .selected_certificate_input_py3 import SelectedCertificateInput from .file_share_py3 import FileShare from .postgre_sql_connection_info_py3 import PostgreSqlConnectionInfo from .my_sql_connection_info_py3 import MySqlConnectionInfo + from .mongo_db_connection_info_py3 import MongoDbConnectionInfo from .connection_info_py3 import ConnectionInfo from .sql_connection_info_py3 import SqlConnectionInfo from .get_tde_certificates_sql_task_input_py3 import GetTdeCertificatesSqlTaskInput from .get_tde_certificates_sql_task_properties_py3 import GetTdeCertificatesSqlTaskProperties + from .mongo_db_error_py3 import MongoDbError + from .mongo_db_collection_progress_py3 import MongoDbCollectionProgress + from .mongo_db_database_progress_py3 import MongoDbDatabaseProgress + from .mongo_db_progress_py3 import MongoDbProgress + from .mongo_db_migration_progress_py3 import MongoDbMigrationProgress + from .mongo_db_throttling_settings_py3 import MongoDbThrottlingSettings + from .mongo_db_shard_key_field_py3 import MongoDbShardKeyField + from .mongo_db_shard_key_setting_py3 import MongoDbShardKeySetting + from .mongo_db_collection_settings_py3 import MongoDbCollectionSettings + from .mongo_db_database_settings_py3 import MongoDbDatabaseSettings + from .mongo_db_migration_settings_py3 import MongoDbMigrationSettings + from .validate_mongo_db_task_properties_py3 import ValidateMongoDbTaskProperties from .database_backup_info_py3 import DatabaseBackupInfo from .validate_migration_input_sql_server_sql_mi_task_output_py3 import ValidateMigrationInputSqlServerSqlMITaskOutput from .blob_share_py3 import BlobShare @@ -97,6 +112,7 @@ from .migrate_sql_server_sql_mi_task_output_py3 import MigrateSqlServerSqlMITaskOutput from .migrate_sql_server_sql_mi_task_input_py3 import MigrateSqlServerSqlMITaskInput from .migrate_sql_server_sql_mi_task_properties_py3 import MigrateSqlServerSqlMITaskProperties + from .migrate_mongo_db_task_properties_py3 import MigrateMongoDbTaskProperties from .connect_to_target_azure_db_for_my_sql_task_output_py3 import ConnectToTargetAzureDbForMySqlTaskOutput from .connect_to_target_azure_db_for_my_sql_task_input_py3 import ConnectToTargetAzureDbForMySqlTaskInput from .connect_to_target_azure_db_for_my_sql_task_properties_py3 import ConnectToTargetAzureDbForMySqlTaskProperties @@ -125,6 +141,12 @@ from .connect_to_source_sql_server_task_input_py3 import ConnectToSourceSqlServerTaskInput from .connect_to_source_sql_server_sync_task_properties_py3 import ConnectToSourceSqlServerSyncTaskProperties from .connect_to_source_sql_server_task_properties_py3 import ConnectToSourceSqlServerTaskProperties + from .mongo_db_shard_key_info_py3 import MongoDbShardKeyInfo + from .mongo_db_collection_info_py3 import MongoDbCollectionInfo + from .mongo_db_object_info_py3 import MongoDbObjectInfo + from .mongo_db_database_info_py3 import MongoDbDatabaseInfo + from .mongo_db_cluster_info_py3 import MongoDbClusterInfo + from .connect_to_mongo_db_task_properties_py3 import ConnectToMongoDbTaskProperties from .project_task_properties_py3 import ProjectTaskProperties from .project_task_py3 import ProjectTask from .service_sku_py3 import ServiceSku @@ -133,6 +155,7 @@ from .database_info_py3 import DatabaseInfo from .project_py3 import Project from .api_error_py3 import ApiError, ApiErrorException + from .file_storage_info_py3 import FileStorageInfo from .service_operation_display_py3 import ServiceOperationDisplay from .service_operation_py3 import ServiceOperation from .quota_name_py3 import QuotaName @@ -173,23 +196,38 @@ from .database_file_input_py3 import DatabaseFileInput from .migrate_sql_server_sql_server_database_input_py3 import MigrateSqlServerSqlServerDatabaseInput except (SyntaxError, ImportError): + from .tracked_resource import TrackedResource + from .resource import Resource + from .project_file_properties import ProjectFileProperties + from .project_file import ProjectFile from .odata_error import ODataError from .reportable_exception import ReportableException from .migrate_sync_complete_command_output import MigrateSyncCompleteCommandOutput from .migrate_sync_complete_command_input import MigrateSyncCompleteCommandInput from .migrate_sync_complete_command_properties import MigrateSyncCompleteCommandProperties from .command_properties import CommandProperties - from .tracked_resource import TrackedResource - from .resource import Resource from .get_tde_certificates_sql_task_output import GetTdeCertificatesSqlTaskOutput from .selected_certificate_input import SelectedCertificateInput from .file_share import FileShare from .postgre_sql_connection_info import PostgreSqlConnectionInfo from .my_sql_connection_info import MySqlConnectionInfo + from .mongo_db_connection_info import MongoDbConnectionInfo from .connection_info import ConnectionInfo from .sql_connection_info import SqlConnectionInfo from .get_tde_certificates_sql_task_input import GetTdeCertificatesSqlTaskInput from .get_tde_certificates_sql_task_properties import GetTdeCertificatesSqlTaskProperties + from .mongo_db_error import MongoDbError + from .mongo_db_collection_progress import MongoDbCollectionProgress + from .mongo_db_database_progress import MongoDbDatabaseProgress + from .mongo_db_progress import MongoDbProgress + from .mongo_db_migration_progress import MongoDbMigrationProgress + from .mongo_db_throttling_settings import MongoDbThrottlingSettings + from .mongo_db_shard_key_field import MongoDbShardKeyField + from .mongo_db_shard_key_setting import MongoDbShardKeySetting + from .mongo_db_collection_settings import MongoDbCollectionSettings + from .mongo_db_database_settings import MongoDbDatabaseSettings + from .mongo_db_migration_settings import MongoDbMigrationSettings + from .validate_mongo_db_task_properties import ValidateMongoDbTaskProperties from .database_backup_info import DatabaseBackupInfo from .validate_migration_input_sql_server_sql_mi_task_output import ValidateMigrationInputSqlServerSqlMITaskOutput from .blob_share import BlobShare @@ -260,6 +298,7 @@ from .migrate_sql_server_sql_mi_task_output import MigrateSqlServerSqlMITaskOutput from .migrate_sql_server_sql_mi_task_input import MigrateSqlServerSqlMITaskInput from .migrate_sql_server_sql_mi_task_properties import MigrateSqlServerSqlMITaskProperties + from .migrate_mongo_db_task_properties import MigrateMongoDbTaskProperties from .connect_to_target_azure_db_for_my_sql_task_output import ConnectToTargetAzureDbForMySqlTaskOutput from .connect_to_target_azure_db_for_my_sql_task_input import ConnectToTargetAzureDbForMySqlTaskInput from .connect_to_target_azure_db_for_my_sql_task_properties import ConnectToTargetAzureDbForMySqlTaskProperties @@ -288,6 +327,12 @@ from .connect_to_source_sql_server_task_input import ConnectToSourceSqlServerTaskInput from .connect_to_source_sql_server_sync_task_properties import ConnectToSourceSqlServerSyncTaskProperties from .connect_to_source_sql_server_task_properties import ConnectToSourceSqlServerTaskProperties + from .mongo_db_shard_key_info import MongoDbShardKeyInfo + from .mongo_db_collection_info import MongoDbCollectionInfo + from .mongo_db_object_info import MongoDbObjectInfo + from .mongo_db_database_info import MongoDbDatabaseInfo + from .mongo_db_cluster_info import MongoDbClusterInfo + from .connect_to_mongo_db_task_properties import ConnectToMongoDbTaskProperties from .project_task_properties import ProjectTaskProperties from .project_task import ProjectTask from .service_sku import ServiceSku @@ -296,6 +341,7 @@ from .database_info import DatabaseInfo from .project import Project from .api_error import ApiError, ApiErrorException + from .file_storage_info import FileStorageInfo from .service_operation_display import ServiceOperationDisplay from .service_operation import ServiceOperation from .quota_name import QuotaName @@ -342,10 +388,15 @@ from .project_paged import ProjectPaged from .quota_paged import QuotaPaged from .service_operation_paged import ServiceOperationPaged +from .project_file_paged import ProjectFilePaged from .data_migration_service_client_enums import ( CommandState, SqlSourcePlatform, AuthenticationType, + MongoDbErrorType, + MongoDbMigrationState, + MongoDbShardKeyOrder, + MongoDbReplication, BackupType, BackupMode, SyncTableMigrationState, @@ -363,6 +414,7 @@ DatabaseCompatLevel, DatabaseFileType, ServerLevelPermissionsGroup, + MongoDbClusterType, TaskState, ServiceProvisioningState, ProjectTargetPlatform, @@ -381,23 +433,38 @@ ) __all__ = [ + 'TrackedResource', + 'Resource', + 'ProjectFileProperties', + 'ProjectFile', 'ODataError', 'ReportableException', 'MigrateSyncCompleteCommandOutput', 'MigrateSyncCompleteCommandInput', 'MigrateSyncCompleteCommandProperties', 'CommandProperties', - 'TrackedResource', - 'Resource', 'GetTdeCertificatesSqlTaskOutput', 'SelectedCertificateInput', 'FileShare', 'PostgreSqlConnectionInfo', 'MySqlConnectionInfo', + 'MongoDbConnectionInfo', 'ConnectionInfo', 'SqlConnectionInfo', 'GetTdeCertificatesSqlTaskInput', 'GetTdeCertificatesSqlTaskProperties', + 'MongoDbError', + 'MongoDbCollectionProgress', + 'MongoDbDatabaseProgress', + 'MongoDbProgress', + 'MongoDbMigrationProgress', + 'MongoDbThrottlingSettings', + 'MongoDbShardKeyField', + 'MongoDbShardKeySetting', + 'MongoDbCollectionSettings', + 'MongoDbDatabaseSettings', + 'MongoDbMigrationSettings', + 'ValidateMongoDbTaskProperties', 'DatabaseBackupInfo', 'ValidateMigrationInputSqlServerSqlMITaskOutput', 'BlobShare', @@ -468,6 +535,7 @@ 'MigrateSqlServerSqlMITaskOutput', 'MigrateSqlServerSqlMITaskInput', 'MigrateSqlServerSqlMITaskProperties', + 'MigrateMongoDbTaskProperties', 'ConnectToTargetAzureDbForMySqlTaskOutput', 'ConnectToTargetAzureDbForMySqlTaskInput', 'ConnectToTargetAzureDbForMySqlTaskProperties', @@ -496,6 +564,12 @@ 'ConnectToSourceSqlServerTaskInput', 'ConnectToSourceSqlServerSyncTaskProperties', 'ConnectToSourceSqlServerTaskProperties', + 'MongoDbShardKeyInfo', + 'MongoDbCollectionInfo', + 'MongoDbObjectInfo', + 'MongoDbDatabaseInfo', + 'MongoDbClusterInfo', + 'ConnectToMongoDbTaskProperties', 'ProjectTaskProperties', 'ProjectTask', 'ServiceSku', @@ -504,6 +578,7 @@ 'DatabaseInfo', 'Project', 'ApiError', 'ApiErrorException', + 'FileStorageInfo', 'ServiceOperationDisplay', 'ServiceOperation', 'QuotaName', @@ -550,9 +625,14 @@ 'ProjectPaged', 'QuotaPaged', 'ServiceOperationPaged', + 'ProjectFilePaged', 'CommandState', 'SqlSourcePlatform', 'AuthenticationType', + 'MongoDbErrorType', + 'MongoDbMigrationState', + 'MongoDbShardKeyOrder', + 'MongoDbReplication', 'BackupType', 'BackupMode', 'SyncTableMigrationState', @@ -570,6 +650,7 @@ 'DatabaseCompatLevel', 'DatabaseFileType', 'ServerLevelPermissionsGroup', + 'MongoDbClusterType', 'TaskState', 'ServiceProvisioningState', 'ProjectTargetPlatform', diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_mongo_db_task_properties.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_mongo_db_task_properties.py new file mode 100644 index 000000000000..f0e771bcbc4f --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_mongo_db_task_properties.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 .project_task_properties import ProjectTaskProperties + + +class ConnectToMongoDbTaskProperties(ProjectTaskProperties): + """Properties for the task that validates the connection to and provides + information about a MongoDB server. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the task. This is ignored if submitted. Possible + values include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', + 'Failed', 'FailedInputValidation', 'Faulted' + :vartype state: str or ~azure.mgmt.datamigration.models.TaskState + :ivar commands: Array of command properties. + :vartype commands: + list[~azure.mgmt.datamigration.models.CommandProperties] + :param task_type: Required. Constant filled by server. + :type task_type: str + :param input: + :type input: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :ivar output: An array containing a single MongoDbClusterInfo object + :vartype output: list[~azure.mgmt.datamigration.models.MongoDbClusterInfo] + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'commands': {'readonly': True}, + 'task_type': {'required': True}, + 'output': {'readonly': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbConnectionInfo'}, + 'output': {'key': 'output', 'type': '[MongoDbClusterInfo]'}, + } + + def __init__(self, **kwargs): + super(ConnectToMongoDbTaskProperties, self).__init__(**kwargs) + self.input = kwargs.get('input', None) + self.output = None + self.task_type = 'Connect.MongoDb' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_mongo_db_task_properties_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_mongo_db_task_properties_py3.py new file mode 100644 index 000000000000..50c4bfae5e9b --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connect_to_mongo_db_task_properties_py3.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 .project_task_properties_py3 import ProjectTaskProperties + + +class ConnectToMongoDbTaskProperties(ProjectTaskProperties): + """Properties for the task that validates the connection to and provides + information about a MongoDB server. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the task. This is ignored if submitted. Possible + values include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', + 'Failed', 'FailedInputValidation', 'Faulted' + :vartype state: str or ~azure.mgmt.datamigration.models.TaskState + :ivar commands: Array of command properties. + :vartype commands: + list[~azure.mgmt.datamigration.models.CommandProperties] + :param task_type: Required. Constant filled by server. + :type task_type: str + :param input: + :type input: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :ivar output: An array containing a single MongoDbClusterInfo object + :vartype output: list[~azure.mgmt.datamigration.models.MongoDbClusterInfo] + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'commands': {'readonly': True}, + 'task_type': {'required': True}, + 'output': {'readonly': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbConnectionInfo'}, + 'output': {'key': 'output', 'type': '[MongoDbClusterInfo]'}, + } + + def __init__(self, *, input=None, **kwargs) -> None: + super(ConnectToMongoDbTaskProperties, self).__init__(**kwargs) + self.input = input + self.output = None + self.task_type = 'Connect.MongoDb' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info.py index 1c673462129d..5b3c0add300c 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info.py @@ -17,7 +17,7 @@ class ConnectionInfo(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: PostgreSqlConnectionInfo, MySqlConnectionInfo, - SqlConnectionInfo + MongoDbConnectionInfo, SqlConnectionInfo All required parameters must be populated in order to send to Azure. @@ -40,7 +40,7 @@ class ConnectionInfo(Model): } _subtype_map = { - 'type': {'PostgreSqlConnectionInfo': 'PostgreSqlConnectionInfo', 'MySqlConnectionInfo': 'MySqlConnectionInfo', 'SqlConnectionInfo': 'SqlConnectionInfo'} + 'type': {'PostgreSqlConnectionInfo': 'PostgreSqlConnectionInfo', 'MySqlConnectionInfo': 'MySqlConnectionInfo', 'MongoDbConnectionInfo': 'MongoDbConnectionInfo', 'SqlConnectionInfo': 'SqlConnectionInfo'} } def __init__(self, **kwargs): diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info_py3.py index 80211d0253c2..c2f2208ba3d7 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info_py3.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/connection_info_py3.py @@ -17,7 +17,7 @@ class ConnectionInfo(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: PostgreSqlConnectionInfo, MySqlConnectionInfo, - SqlConnectionInfo + MongoDbConnectionInfo, SqlConnectionInfo All required parameters must be populated in order to send to Azure. @@ -40,7 +40,7 @@ class ConnectionInfo(Model): } _subtype_map = { - 'type': {'PostgreSqlConnectionInfo': 'PostgreSqlConnectionInfo', 'MySqlConnectionInfo': 'MySqlConnectionInfo', 'SqlConnectionInfo': 'SqlConnectionInfo'} + 'type': {'PostgreSqlConnectionInfo': 'PostgreSqlConnectionInfo', 'MySqlConnectionInfo': 'MySqlConnectionInfo', 'MongoDbConnectionInfo': 'MongoDbConnectionInfo', 'SqlConnectionInfo': 'SqlConnectionInfo'} } def __init__(self, *, user_name: str=None, password: str=None, **kwargs) -> None: 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 index ad8f22838e90..627668009aed 100644 --- 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 @@ -35,6 +35,42 @@ class AuthenticationType(str, Enum): active_directory_password = "ActiveDirectoryPassword" +class MongoDbErrorType(str, Enum): + + error = "Error" + validation_error = "ValidationError" + warning = "Warning" + + +class MongoDbMigrationState(str, Enum): + + not_started = "NotStarted" + validating_input = "ValidatingInput" + initializing = "Initializing" + restarting = "Restarting" + copying = "Copying" + initial_replay = "InitialReplay" + replaying = "Replaying" + finalizing = "Finalizing" + complete = "Complete" + canceled = "Canceled" + failed = "Failed" + + +class MongoDbShardKeyOrder(str, Enum): + + forward = "Forward" + reverse = "Reverse" + hashed = "Hashed" + + +class MongoDbReplication(str, Enum): + + disabled = "Disabled" + one_time = "OneTime" + continuous = "Continuous" + + class BackupType(str, Enum): database = "Database" @@ -212,6 +248,13 @@ class ServerLevelPermissionsGroup(str, Enum): migration_from_my_sql_to_azure_db_for_my_sql = "MigrationFromMySQLToAzureDBForMySQL" +class MongoDbClusterType(str, Enum): + + blob_container = "BlobContainer" + cosmos_db = "CosmosDb" + mongo_db = "MongoDb" + + class TaskState(str, Enum): unknown = "Unknown" @@ -244,6 +287,7 @@ class ProjectTargetPlatform(str, Enum): sqlmi = "SQLMI" azure_db_for_my_sql = "AzureDbForMySql" azure_db_for_postgre_sql = "AzureDbForPostgreSql" + mongo_db = "MongoDb" unknown = "Unknown" @@ -252,6 +296,7 @@ class ProjectSourcePlatform(str, Enum): sql = "SQL" my_sql = "MySQL" postgre_sql = "PostgreSql" + mongo_db = "MongoDb" unknown = "Unknown" diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/file_storage_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/file_storage_info.py new file mode 100644 index 000000000000..2572d7ba461b --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/file_storage_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 FileStorageInfo(Model): + """File storage information. + + :param uri: A URI that can be used to access the file content. + :type uri: str + :param headers: + :type headers: dict[str, str] + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(FileStorageInfo, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.headers = kwargs.get('headers', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/file_storage_info_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/file_storage_info_py3.py new file mode 100644 index 000000000000..c5723ce48949 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/file_storage_info_py3.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 FileStorageInfo(Model): + """File storage information. + + :param uri: A URI that can be used to access the file content. + :type uri: str + :param headers: + :type headers: dict[str, str] + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{str}'}, + } + + def __init__(self, *, uri: str=None, headers=None, **kwargs) -> None: + super(FileStorageInfo, self).__init__(**kwargs) + self.uri = uri + self.headers = headers diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_mongo_db_task_properties.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_mongo_db_task_properties.py new file mode 100644 index 000000000000..7ae0ef518757 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_mongo_db_task_properties.py @@ -0,0 +1,61 @@ +# 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 MigrateMongoDbTaskProperties(ProjectTaskProperties): + """Properties for the task that migrates data between MongoDB data sources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the task. This is ignored if submitted. Possible + values include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', + 'Failed', 'FailedInputValidation', 'Faulted' + :vartype state: str or ~azure.mgmt.datamigration.models.TaskState + :ivar commands: Array of command properties. + :vartype commands: + list[~azure.mgmt.datamigration.models.CommandProperties] + :param task_type: Required. Constant filled by server. + :type task_type: str + :param input: + :type input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings + :ivar output: + :vartype output: list[~azure.mgmt.datamigration.models.MongoDbProgress] + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'commands': {'readonly': True}, + 'task_type': {'required': True}, + 'output': {'readonly': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbMigrationSettings'}, + 'output': {'key': 'output', 'type': '[MongoDbProgress]'}, + } + + def __init__(self, **kwargs): + super(MigrateMongoDbTaskProperties, self).__init__(**kwargs) + self.input = kwargs.get('input', None) + self.output = None + self.task_type = 'Migrate.MongoDb' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_mongo_db_task_properties_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_mongo_db_task_properties_py3.py new file mode 100644 index 000000000000..061cb4b66ff6 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_mongo_db_task_properties_py3.py @@ -0,0 +1,61 @@ +# 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_py3 import ProjectTaskProperties + + +class MigrateMongoDbTaskProperties(ProjectTaskProperties): + """Properties for the task that migrates data between MongoDB data sources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the task. This is ignored if submitted. Possible + values include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', + 'Failed', 'FailedInputValidation', 'Faulted' + :vartype state: str or ~azure.mgmt.datamigration.models.TaskState + :ivar commands: Array of command properties. + :vartype commands: + list[~azure.mgmt.datamigration.models.CommandProperties] + :param task_type: Required. Constant filled by server. + :type task_type: str + :param input: + :type input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings + :ivar output: + :vartype output: list[~azure.mgmt.datamigration.models.MongoDbProgress] + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'commands': {'readonly': True}, + 'task_type': {'required': True}, + 'output': {'readonly': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbMigrationSettings'}, + 'output': {'key': 'output', 'type': '[MongoDbProgress]'}, + } + + def __init__(self, *, input=None, **kwargs) -> None: + super(MigrateMongoDbTaskProperties, self).__init__(**kwargs) + self.input = input + self.output = None + self.task_type = 'Migrate.MongoDb' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_schema_sql_server_sql_db_database_input.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_schema_sql_server_sql_db_database_input.py index 56b805f441c8..0449ca9b6de5 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_schema_sql_server_sql_db_database_input.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_schema_sql_server_sql_db_database_input.py @@ -15,6 +15,8 @@ class MigrateSchemaSqlServerSqlDbDatabaseInput(Model): """Database input for migrate schema Sql Server to Azure SQL Server scenario. + :param name: Name of source database + :type name: str :param target_database_name: Name of target database :type target_database_name: str :param schema_setting: Database schema migration settings @@ -23,11 +25,13 @@ class MigrateSchemaSqlServerSqlDbDatabaseInput(Model): """ _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, 'schema_setting': {'key': 'schemaSetting', 'type': 'SchemaMigrationSetting'}, } def __init__(self, **kwargs): super(MigrateSchemaSqlServerSqlDbDatabaseInput, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.target_database_name = kwargs.get('target_database_name', None) self.schema_setting = kwargs.get('schema_setting', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_schema_sql_server_sql_db_database_input_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_schema_sql_server_sql_db_database_input_py3.py index 17c28c7a0757..25029f5cb5f6 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_schema_sql_server_sql_db_database_input_py3.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/migrate_schema_sql_server_sql_db_database_input_py3.py @@ -15,6 +15,8 @@ class MigrateSchemaSqlServerSqlDbDatabaseInput(Model): """Database input for migrate schema Sql Server to Azure SQL Server scenario. + :param name: Name of source database + :type name: str :param target_database_name: Name of target database :type target_database_name: str :param schema_setting: Database schema migration settings @@ -23,11 +25,13 @@ class MigrateSchemaSqlServerSqlDbDatabaseInput(Model): """ _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, 'target_database_name': {'key': 'targetDatabaseName', 'type': 'str'}, 'schema_setting': {'key': 'schemaSetting', 'type': 'SchemaMigrationSetting'}, } - def __init__(self, *, target_database_name: str=None, schema_setting=None, **kwargs) -> None: + def __init__(self, *, name: str=None, target_database_name: str=None, schema_setting=None, **kwargs) -> None: super(MigrateSchemaSqlServerSqlDbDatabaseInput, self).__init__(**kwargs) + self.name = name self.target_database_name = target_database_name self.schema_setting = schema_setting diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cluster_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cluster_info.py new file mode 100644 index 000000000000..d8c2c284f24c --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cluster_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 MongoDbClusterInfo(Model): + """Describes a MongoDB data source. + + All required parameters must be populated in order to send to Azure. + + :param databases: Required. A list of non-system databases in the cluster + :type databases: + list[~azure.mgmt.datamigration.models.MongoDbDatabaseInfo] + :param supports_sharding: Required. Whether the cluster supports sharded + collections + :type supports_sharding: bool + :param type: Required. The type of data source. Possible values include: + 'BlobContainer', 'CosmosDb', 'MongoDb' + :type type: str or ~azure.mgmt.datamigration.models.MongoDbClusterType + :param version: Required. The version of the data source in the form x.y.z + (e.g. 3.6.7). Not used if Type is BlobContainer. + :type version: str + """ + + _validation = { + 'databases': {'required': True}, + 'supports_sharding': {'required': True}, + 'type': {'required': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'databases': {'key': 'databases', 'type': '[MongoDbDatabaseInfo]'}, + 'supports_sharding': {'key': 'supportsSharding', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MongoDbClusterInfo, self).__init__(**kwargs) + self.databases = kwargs.get('databases', None) + self.supports_sharding = kwargs.get('supports_sharding', None) + self.type = kwargs.get('type', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cluster_info_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cluster_info_py3.py new file mode 100644 index 000000000000..5c47019ed26a --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cluster_info_py3.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 MongoDbClusterInfo(Model): + """Describes a MongoDB data source. + + All required parameters must be populated in order to send to Azure. + + :param databases: Required. A list of non-system databases in the cluster + :type databases: + list[~azure.mgmt.datamigration.models.MongoDbDatabaseInfo] + :param supports_sharding: Required. Whether the cluster supports sharded + collections + :type supports_sharding: bool + :param type: Required. The type of data source. Possible values include: + 'BlobContainer', 'CosmosDb', 'MongoDb' + :type type: str or ~azure.mgmt.datamigration.models.MongoDbClusterType + :param version: Required. The version of the data source in the form x.y.z + (e.g. 3.6.7). Not used if Type is BlobContainer. + :type version: str + """ + + _validation = { + 'databases': {'required': True}, + 'supports_sharding': {'required': True}, + 'type': {'required': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'databases': {'key': 'databases', 'type': '[MongoDbDatabaseInfo]'}, + 'supports_sharding': {'key': 'supportsSharding', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, databases, supports_sharding: bool, type, version: str, **kwargs) -> None: + super(MongoDbClusterInfo, self).__init__(**kwargs) + self.databases = databases + self.supports_sharding = supports_sharding + self.type = type + self.version = version diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_info.py new file mode 100644 index 000000000000..5cf10b86d90d --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_info.py @@ -0,0 +1,94 @@ +# 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 .mongo_db_object_info import MongoDbObjectInfo + + +class MongoDbCollectionInfo(MongoDbObjectInfo): + """Describes a supported collection within a MongoDB database. + + All required parameters must be populated in order to send to Azure. + + :param average_document_size: Required. The average document size, or -1 + if the average size is unknown + :type average_document_size: long + :param data_size: Required. The estimated total data size, in bytes, or -1 + if the size is unknown. + :type data_size: long + :param document_count: Required. The estimated total number of documents, + or -1 if the document count is unknown + :type document_count: long + :param name: Required. The unqualified name of the database or collection + :type name: str + :param qualified_name: Required. The qualified name of the database or + collection. For a collection, this is the database-qualified name. + :type qualified_name: str + :param database_name: Required. The name of the database containing the + collection + :type database_name: str + :param is_capped: Required. Whether the collection is a capped collection + (i.e. whether it has a fixed size and acts like a circular buffer) + :type is_capped: bool + :param is_system_collection: Required. Whether the collection is system + collection + :type is_system_collection: bool + :param is_view: Required. Whether the collection is a view of another + collection + :type is_view: bool + :param shard_key: The shard key on the collection, or null if the + collection is not sharded + :type shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeyInfo + :param supports_sharding: Required. Whether the database has sharding + enabled. Note that the migration task will enable sharding on the target + if necessary. + :type supports_sharding: bool + :param view_of: The name of the collection that this is a view of, if + IsView is true + :type view_of: str + """ + + _validation = { + 'average_document_size': {'required': True}, + 'data_size': {'required': True}, + 'document_count': {'required': True}, + 'name': {'required': True}, + 'qualified_name': {'required': True}, + 'database_name': {'required': True}, + 'is_capped': {'required': True}, + 'is_system_collection': {'required': True}, + 'is_view': {'required': True}, + 'supports_sharding': {'required': True}, + } + + _attribute_map = { + 'average_document_size': {'key': 'averageDocumentSize', 'type': 'long'}, + 'data_size': {'key': 'dataSize', 'type': 'long'}, + 'document_count': {'key': 'documentCount', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'is_capped': {'key': 'isCapped', 'type': 'bool'}, + 'is_system_collection': {'key': 'isSystemCollection', 'type': 'bool'}, + 'is_view': {'key': 'isView', 'type': 'bool'}, + 'shard_key': {'key': 'shardKey', 'type': 'MongoDbShardKeyInfo'}, + 'supports_sharding': {'key': 'supportsSharding', 'type': 'bool'}, + 'view_of': {'key': 'viewOf', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MongoDbCollectionInfo, self).__init__(**kwargs) + self.database_name = kwargs.get('database_name', None) + self.is_capped = kwargs.get('is_capped', None) + self.is_system_collection = kwargs.get('is_system_collection', None) + self.is_view = kwargs.get('is_view', None) + self.shard_key = kwargs.get('shard_key', None) + self.supports_sharding = kwargs.get('supports_sharding', None) + self.view_of = kwargs.get('view_of', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_info_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_info_py3.py new file mode 100644 index 000000000000..32f732da25fb --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_info_py3.py @@ -0,0 +1,94 @@ +# 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 .mongo_db_object_info_py3 import MongoDbObjectInfo + + +class MongoDbCollectionInfo(MongoDbObjectInfo): + """Describes a supported collection within a MongoDB database. + + All required parameters must be populated in order to send to Azure. + + :param average_document_size: Required. The average document size, or -1 + if the average size is unknown + :type average_document_size: long + :param data_size: Required. The estimated total data size, in bytes, or -1 + if the size is unknown. + :type data_size: long + :param document_count: Required. The estimated total number of documents, + or -1 if the document count is unknown + :type document_count: long + :param name: Required. The unqualified name of the database or collection + :type name: str + :param qualified_name: Required. The qualified name of the database or + collection. For a collection, this is the database-qualified name. + :type qualified_name: str + :param database_name: Required. The name of the database containing the + collection + :type database_name: str + :param is_capped: Required. Whether the collection is a capped collection + (i.e. whether it has a fixed size and acts like a circular buffer) + :type is_capped: bool + :param is_system_collection: Required. Whether the collection is system + collection + :type is_system_collection: bool + :param is_view: Required. Whether the collection is a view of another + collection + :type is_view: bool + :param shard_key: The shard key on the collection, or null if the + collection is not sharded + :type shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeyInfo + :param supports_sharding: Required. Whether the database has sharding + enabled. Note that the migration task will enable sharding on the target + if necessary. + :type supports_sharding: bool + :param view_of: The name of the collection that this is a view of, if + IsView is true + :type view_of: str + """ + + _validation = { + 'average_document_size': {'required': True}, + 'data_size': {'required': True}, + 'document_count': {'required': True}, + 'name': {'required': True}, + 'qualified_name': {'required': True}, + 'database_name': {'required': True}, + 'is_capped': {'required': True}, + 'is_system_collection': {'required': True}, + 'is_view': {'required': True}, + 'supports_sharding': {'required': True}, + } + + _attribute_map = { + 'average_document_size': {'key': 'averageDocumentSize', 'type': 'long'}, + 'data_size': {'key': 'dataSize', 'type': 'long'}, + 'document_count': {'key': 'documentCount', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'is_capped': {'key': 'isCapped', 'type': 'bool'}, + 'is_system_collection': {'key': 'isSystemCollection', 'type': 'bool'}, + 'is_view': {'key': 'isView', 'type': 'bool'}, + 'shard_key': {'key': 'shardKey', 'type': 'MongoDbShardKeyInfo'}, + 'supports_sharding': {'key': 'supportsSharding', 'type': 'bool'}, + 'view_of': {'key': 'viewOf', 'type': 'str'}, + } + + def __init__(self, *, average_document_size: int, data_size: int, document_count: int, name: str, qualified_name: str, database_name: str, is_capped: bool, is_system_collection: bool, is_view: bool, supports_sharding: bool, shard_key=None, view_of: str=None, **kwargs) -> None: + super(MongoDbCollectionInfo, self).__init__(average_document_size=average_document_size, data_size=data_size, document_count=document_count, name=name, qualified_name=qualified_name, **kwargs) + self.database_name = database_name + self.is_capped = is_capped + self.is_system_collection = is_system_collection + self.is_view = is_view + self.shard_key = shard_key + self.supports_sharding = supports_sharding + self.view_of = view_of diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_progress.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_progress.py new file mode 100644 index 000000000000..3df5e998919e --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_progress.py @@ -0,0 +1,101 @@ +# 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 .mongo_db_progress import MongoDbProgress + + +class MongoDbCollectionProgress(MongoDbProgress): + """Describes the progress of a collection. + + All required parameters must be populated in order to send to Azure. + + :param bytes_copied: Required. The number of document bytes copied during + the Copying stage + :type bytes_copied: long + :param documents_copied: Required. The number of documents copied during + the Copying stage + :type documents_copied: long + :param elapsed_time: Required. The elapsed time in the format + [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + :type elapsed_time: str + :param errors: Required. The errors and warnings that have occurred for + the current object. The keys are the error codes. + :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :param events_pending: Required. The number of oplog events awaiting + replay + :type events_pending: long + :param events_replayed: Required. The number of oplog events replayed so + far + :type events_replayed: long + :param last_event_time: The timestamp of the last oplog event received, or + null if no oplog event has been received yet + :type last_event_time: datetime + :param last_replay_time: The timestamp of the last oplog event replayed, + or null if no oplog event has been replayed yet + :type last_replay_time: datetime + :param name: The name of the progress object. For a collection, this is + the unqualified collection name. For a database, this is the database + name. For the overall migration, this is null. + :type name: str + :param qualified_name: The qualified name of the progress object. For a + collection, this is the database-qualified name. For a database, this is + the database name. For the overall migration, this is null. + :type qualified_name: str + :param result_type: Required. The type of progress object. Possible values + include: 'Migration', 'Database', 'Collection' + :type result_type: str or ~azure.mgmt.datamigration.models.enum + :param state: Required. Possible values include: 'NotStarted', + 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', + 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', + 'Failed' + :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :param total_bytes: Required. The total number of document bytes on the + source at the beginning of the Copying stage, or -1 if the total size was + unknown + :type total_bytes: long + :param total_documents: Required. The total number of documents on the + source at the beginning of the Copying stage, or -1 if the total count was + unknown + :type total_documents: long + """ + + _validation = { + 'bytes_copied': {'required': True}, + 'documents_copied': {'required': True}, + 'elapsed_time': {'required': True}, + 'errors': {'required': True}, + 'events_pending': {'required': True}, + 'events_replayed': {'required': True}, + 'result_type': {'required': True}, + 'state': {'required': True}, + 'total_bytes': {'required': True}, + 'total_documents': {'required': True}, + } + + _attribute_map = { + 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, + 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, + 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, + 'events_pending': {'key': 'eventsPending', 'type': 'long'}, + 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, + 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, + 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'result_type': {'key': 'resultType', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, + 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(MongoDbCollectionProgress, self).__init__(**kwargs) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_progress_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_progress_py3.py new file mode 100644 index 000000000000..aa3e17b861a7 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_progress_py3.py @@ -0,0 +1,101 @@ +# 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 .mongo_db_progress_py3 import MongoDbProgress + + +class MongoDbCollectionProgress(MongoDbProgress): + """Describes the progress of a collection. + + All required parameters must be populated in order to send to Azure. + + :param bytes_copied: Required. The number of document bytes copied during + the Copying stage + :type bytes_copied: long + :param documents_copied: Required. The number of documents copied during + the Copying stage + :type documents_copied: long + :param elapsed_time: Required. The elapsed time in the format + [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + :type elapsed_time: str + :param errors: Required. The errors and warnings that have occurred for + the current object. The keys are the error codes. + :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :param events_pending: Required. The number of oplog events awaiting + replay + :type events_pending: long + :param events_replayed: Required. The number of oplog events replayed so + far + :type events_replayed: long + :param last_event_time: The timestamp of the last oplog event received, or + null if no oplog event has been received yet + :type last_event_time: datetime + :param last_replay_time: The timestamp of the last oplog event replayed, + or null if no oplog event has been replayed yet + :type last_replay_time: datetime + :param name: The name of the progress object. For a collection, this is + the unqualified collection name. For a database, this is the database + name. For the overall migration, this is null. + :type name: str + :param qualified_name: The qualified name of the progress object. For a + collection, this is the database-qualified name. For a database, this is + the database name. For the overall migration, this is null. + :type qualified_name: str + :param result_type: Required. The type of progress object. Possible values + include: 'Migration', 'Database', 'Collection' + :type result_type: str or ~azure.mgmt.datamigration.models.enum + :param state: Required. Possible values include: 'NotStarted', + 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', + 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', + 'Failed' + :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :param total_bytes: Required. The total number of document bytes on the + source at the beginning of the Copying stage, or -1 if the total size was + unknown + :type total_bytes: long + :param total_documents: Required. The total number of documents on the + source at the beginning of the Copying stage, or -1 if the total count was + unknown + :type total_documents: long + """ + + _validation = { + 'bytes_copied': {'required': True}, + 'documents_copied': {'required': True}, + 'elapsed_time': {'required': True}, + 'errors': {'required': True}, + 'events_pending': {'required': True}, + 'events_replayed': {'required': True}, + 'result_type': {'required': True}, + 'state': {'required': True}, + 'total_bytes': {'required': True}, + 'total_documents': {'required': True}, + } + + _attribute_map = { + 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, + 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, + 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, + 'events_pending': {'key': 'eventsPending', 'type': 'long'}, + 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, + 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, + 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'result_type': {'key': 'resultType', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, + 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, + } + + def __init__(self, *, bytes_copied: int, documents_copied: int, elapsed_time: str, errors, events_pending: int, events_replayed: int, result_type, state, total_bytes: int, total_documents: int, last_event_time=None, last_replay_time=None, name: str=None, qualified_name: str=None, **kwargs) -> None: + super(MongoDbCollectionProgress, self).__init__(bytes_copied=bytes_copied, documents_copied=documents_copied, elapsed_time=elapsed_time, errors=errors, events_pending=events_pending, events_replayed=events_replayed, last_event_time=last_event_time, last_replay_time=last_replay_time, name=name, qualified_name=qualified_name, result_type=result_type, state=state, total_bytes=total_bytes, total_documents=total_documents, **kwargs) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_settings.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_settings.py new file mode 100644 index 000000000000..3413c05f5900 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_settings.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 MongoDbCollectionSettings(Model): + """Describes how an individual MongoDB collection should be migrated. + + :param can_delete: Whether the migrator is allowed to drop the target + collection in the course of performing a migration. The default is true. + :type can_delete: bool + :param shard_key: + :type shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeySetting + :param target_rus: The RUs that should be configured on a CosmosDB target, + or null to use the default. This has no effect on non-CosmosDB targets. + :type target_rus: int + """ + + _attribute_map = { + 'can_delete': {'key': 'canDelete', 'type': 'bool'}, + 'shard_key': {'key': 'shardKey', 'type': 'MongoDbShardKeySetting'}, + 'target_rus': {'key': 'targetRUs', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(MongoDbCollectionSettings, self).__init__(**kwargs) + self.can_delete = kwargs.get('can_delete', None) + self.shard_key = kwargs.get('shard_key', None) + self.target_rus = kwargs.get('target_rus', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_settings_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_settings_py3.py new file mode 100644 index 000000000000..1460c4cd5244 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_collection_settings_py3.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 MongoDbCollectionSettings(Model): + """Describes how an individual MongoDB collection should be migrated. + + :param can_delete: Whether the migrator is allowed to drop the target + collection in the course of performing a migration. The default is true. + :type can_delete: bool + :param shard_key: + :type shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeySetting + :param target_rus: The RUs that should be configured on a CosmosDB target, + or null to use the default. This has no effect on non-CosmosDB targets. + :type target_rus: int + """ + + _attribute_map = { + 'can_delete': {'key': 'canDelete', 'type': 'bool'}, + 'shard_key': {'key': 'shardKey', 'type': 'MongoDbShardKeySetting'}, + 'target_rus': {'key': 'targetRUs', 'type': 'int'}, + } + + def __init__(self, *, can_delete: bool=None, shard_key=None, target_rus: int=None, **kwargs) -> None: + super(MongoDbCollectionSettings, self).__init__(**kwargs) + self.can_delete = can_delete + self.shard_key = shard_key + self.target_rus = target_rus diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_connection_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_connection_info.py new file mode 100644 index 000000000000..fdf8107f7194 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_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 .connection_info import ConnectionInfo + + +class MongoDbConnectionInfo(ConnectionInfo): + """Describes a connection to a MongoDB data source. + + All required parameters must be populated in order to send to Azure. + + :param user_name: User name + :type user_name: str + :param password: Password credential. + :type password: str + :param type: Required. Constant filled by server. + :type type: str + :param connection_string: Required. A MongoDB connection string or blob + container URL. The user name and password can be specified here or in the + userName and password properties + :type connection_string: str + """ + + _validation = { + 'type': {'required': True}, + 'connection_string': {'required': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MongoDbConnectionInfo, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + self.type = 'MongoDbConnectionInfo' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_connection_info_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_connection_info_py3.py new file mode 100644 index 000000000000..ac3d78a7bda0 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_connection_info_py3.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 .connection_info_py3 import ConnectionInfo + + +class MongoDbConnectionInfo(ConnectionInfo): + """Describes a connection to a MongoDB data source. + + All required parameters must be populated in order to send to Azure. + + :param user_name: User name + :type user_name: str + :param password: Password credential. + :type password: str + :param type: Required. Constant filled by server. + :type type: str + :param connection_string: Required. A MongoDB connection string or blob + container URL. The user name and password can be specified here or in the + userName and password properties + :type connection_string: str + """ + + _validation = { + 'type': {'required': True}, + 'connection_string': {'required': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + } + + def __init__(self, *, connection_string: str, user_name: str=None, password: str=None, **kwargs) -> None: + super(MongoDbConnectionInfo, self).__init__(user_name=user_name, password=password, **kwargs) + self.connection_string = connection_string + self.type = 'MongoDbConnectionInfo' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_info.py new file mode 100644 index 000000000000..c7fdba42e91e --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_info.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 .mongo_db_object_info import MongoDbObjectInfo + + +class MongoDbDatabaseInfo(MongoDbObjectInfo): + """Describes a database within a MongoDB data source. + + All required parameters must be populated in order to send to Azure. + + :param average_document_size: Required. The average document size, or -1 + if the average size is unknown + :type average_document_size: long + :param data_size: Required. The estimated total data size, in bytes, or -1 + if the size is unknown. + :type data_size: long + :param document_count: Required. The estimated total number of documents, + or -1 if the document count is unknown + :type document_count: long + :param name: Required. The unqualified name of the database or collection + :type name: str + :param qualified_name: Required. The qualified name of the database or + collection. For a collection, this is the database-qualified name. + :type qualified_name: str + :param collections: Required. A list of supported collections in a MongoDB + database + :type collections: + list[~azure.mgmt.datamigration.models.MongoDbCollectionInfo] + :param supports_sharding: Required. Whether the database has sharding + enabled. Note that the migration task will enable sharding on the target + if necessary. + :type supports_sharding: bool + """ + + _validation = { + 'average_document_size': {'required': True}, + 'data_size': {'required': True}, + 'document_count': {'required': True}, + 'name': {'required': True}, + 'qualified_name': {'required': True}, + 'collections': {'required': True}, + 'supports_sharding': {'required': True}, + } + + _attribute_map = { + 'average_document_size': {'key': 'averageDocumentSize', 'type': 'long'}, + 'data_size': {'key': 'dataSize', 'type': 'long'}, + 'document_count': {'key': 'documentCount', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'collections': {'key': 'collections', 'type': '[MongoDbCollectionInfo]'}, + 'supports_sharding': {'key': 'supportsSharding', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(MongoDbDatabaseInfo, self).__init__(**kwargs) + self.collections = kwargs.get('collections', None) + self.supports_sharding = kwargs.get('supports_sharding', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_info_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_info_py3.py new file mode 100644 index 000000000000..c7ab66747fe2 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_info_py3.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 .mongo_db_object_info_py3 import MongoDbObjectInfo + + +class MongoDbDatabaseInfo(MongoDbObjectInfo): + """Describes a database within a MongoDB data source. + + All required parameters must be populated in order to send to Azure. + + :param average_document_size: Required. The average document size, or -1 + if the average size is unknown + :type average_document_size: long + :param data_size: Required. The estimated total data size, in bytes, or -1 + if the size is unknown. + :type data_size: long + :param document_count: Required. The estimated total number of documents, + or -1 if the document count is unknown + :type document_count: long + :param name: Required. The unqualified name of the database or collection + :type name: str + :param qualified_name: Required. The qualified name of the database or + collection. For a collection, this is the database-qualified name. + :type qualified_name: str + :param collections: Required. A list of supported collections in a MongoDB + database + :type collections: + list[~azure.mgmt.datamigration.models.MongoDbCollectionInfo] + :param supports_sharding: Required. Whether the database has sharding + enabled. Note that the migration task will enable sharding on the target + if necessary. + :type supports_sharding: bool + """ + + _validation = { + 'average_document_size': {'required': True}, + 'data_size': {'required': True}, + 'document_count': {'required': True}, + 'name': {'required': True}, + 'qualified_name': {'required': True}, + 'collections': {'required': True}, + 'supports_sharding': {'required': True}, + } + + _attribute_map = { + 'average_document_size': {'key': 'averageDocumentSize', 'type': 'long'}, + 'data_size': {'key': 'dataSize', 'type': 'long'}, + 'document_count': {'key': 'documentCount', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'collections': {'key': 'collections', 'type': '[MongoDbCollectionInfo]'}, + 'supports_sharding': {'key': 'supportsSharding', 'type': 'bool'}, + } + + def __init__(self, *, average_document_size: int, data_size: int, document_count: int, name: str, qualified_name: str, collections, supports_sharding: bool, **kwargs) -> None: + super(MongoDbDatabaseInfo, self).__init__(average_document_size=average_document_size, data_size=data_size, document_count=document_count, name=name, qualified_name=qualified_name, **kwargs) + self.collections = collections + self.supports_sharding = supports_sharding diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_progress.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_progress.py new file mode 100644 index 000000000000..55fe54fe92a8 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_progress.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. +# -------------------------------------------------------------------------- + +from .mongo_db_progress import MongoDbProgress + + +class MongoDbDatabaseProgress(MongoDbProgress): + """Describes the progress of a database. + + All required parameters must be populated in order to send to Azure. + + :param bytes_copied: Required. The number of document bytes copied during + the Copying stage + :type bytes_copied: long + :param documents_copied: Required. The number of documents copied during + the Copying stage + :type documents_copied: long + :param elapsed_time: Required. The elapsed time in the format + [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + :type elapsed_time: str + :param errors: Required. The errors and warnings that have occurred for + the current object. The keys are the error codes. + :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :param events_pending: Required. The number of oplog events awaiting + replay + :type events_pending: long + :param events_replayed: Required. The number of oplog events replayed so + far + :type events_replayed: long + :param last_event_time: The timestamp of the last oplog event received, or + null if no oplog event has been received yet + :type last_event_time: datetime + :param last_replay_time: The timestamp of the last oplog event replayed, + or null if no oplog event has been replayed yet + :type last_replay_time: datetime + :param name: The name of the progress object. For a collection, this is + the unqualified collection name. For a database, this is the database + name. For the overall migration, this is null. + :type name: str + :param qualified_name: The qualified name of the progress object. For a + collection, this is the database-qualified name. For a database, this is + the database name. For the overall migration, this is null. + :type qualified_name: str + :param result_type: Required. The type of progress object. Possible values + include: 'Migration', 'Database', 'Collection' + :type result_type: str or ~azure.mgmt.datamigration.models.enum + :param state: Required. Possible values include: 'NotStarted', + 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', + 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', + 'Failed' + :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :param total_bytes: Required. The total number of document bytes on the + source at the beginning of the Copying stage, or -1 if the total size was + unknown + :type total_bytes: long + :param total_documents: Required. The total number of documents on the + source at the beginning of the Copying stage, or -1 if the total count was + unknown + :type total_documents: long + :param collections: The progress of the collections in the database. The + keys are the unqualified names of the collections + :type collections: dict[str, + ~azure.mgmt.datamigration.models.MongoDbCollectionProgress] + """ + + _validation = { + 'bytes_copied': {'required': True}, + 'documents_copied': {'required': True}, + 'elapsed_time': {'required': True}, + 'errors': {'required': True}, + 'events_pending': {'required': True}, + 'events_replayed': {'required': True}, + 'result_type': {'required': True}, + 'state': {'required': True}, + 'total_bytes': {'required': True}, + 'total_documents': {'required': True}, + } + + _attribute_map = { + 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, + 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, + 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, + 'events_pending': {'key': 'eventsPending', 'type': 'long'}, + 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, + 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, + 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'result_type': {'key': 'resultType', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, + 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, + 'collections': {'key': 'collections', 'type': '{MongoDbCollectionProgress}'}, + } + + def __init__(self, **kwargs): + super(MongoDbDatabaseProgress, self).__init__(**kwargs) + self.collections = kwargs.get('collections', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_progress_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_progress_py3.py new file mode 100644 index 000000000000..2df655e78d05 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_progress_py3.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. +# -------------------------------------------------------------------------- + +from .mongo_db_progress_py3 import MongoDbProgress + + +class MongoDbDatabaseProgress(MongoDbProgress): + """Describes the progress of a database. + + All required parameters must be populated in order to send to Azure. + + :param bytes_copied: Required. The number of document bytes copied during + the Copying stage + :type bytes_copied: long + :param documents_copied: Required. The number of documents copied during + the Copying stage + :type documents_copied: long + :param elapsed_time: Required. The elapsed time in the format + [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + :type elapsed_time: str + :param errors: Required. The errors and warnings that have occurred for + the current object. The keys are the error codes. + :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :param events_pending: Required. The number of oplog events awaiting + replay + :type events_pending: long + :param events_replayed: Required. The number of oplog events replayed so + far + :type events_replayed: long + :param last_event_time: The timestamp of the last oplog event received, or + null if no oplog event has been received yet + :type last_event_time: datetime + :param last_replay_time: The timestamp of the last oplog event replayed, + or null if no oplog event has been replayed yet + :type last_replay_time: datetime + :param name: The name of the progress object. For a collection, this is + the unqualified collection name. For a database, this is the database + name. For the overall migration, this is null. + :type name: str + :param qualified_name: The qualified name of the progress object. For a + collection, this is the database-qualified name. For a database, this is + the database name. For the overall migration, this is null. + :type qualified_name: str + :param result_type: Required. The type of progress object. Possible values + include: 'Migration', 'Database', 'Collection' + :type result_type: str or ~azure.mgmt.datamigration.models.enum + :param state: Required. Possible values include: 'NotStarted', + 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', + 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', + 'Failed' + :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :param total_bytes: Required. The total number of document bytes on the + source at the beginning of the Copying stage, or -1 if the total size was + unknown + :type total_bytes: long + :param total_documents: Required. The total number of documents on the + source at the beginning of the Copying stage, or -1 if the total count was + unknown + :type total_documents: long + :param collections: The progress of the collections in the database. The + keys are the unqualified names of the collections + :type collections: dict[str, + ~azure.mgmt.datamigration.models.MongoDbCollectionProgress] + """ + + _validation = { + 'bytes_copied': {'required': True}, + 'documents_copied': {'required': True}, + 'elapsed_time': {'required': True}, + 'errors': {'required': True}, + 'events_pending': {'required': True}, + 'events_replayed': {'required': True}, + 'result_type': {'required': True}, + 'state': {'required': True}, + 'total_bytes': {'required': True}, + 'total_documents': {'required': True}, + } + + _attribute_map = { + 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, + 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, + 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, + 'events_pending': {'key': 'eventsPending', 'type': 'long'}, + 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, + 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, + 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'result_type': {'key': 'resultType', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, + 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, + 'collections': {'key': 'collections', 'type': '{MongoDbCollectionProgress}'}, + } + + def __init__(self, *, bytes_copied: int, documents_copied: int, elapsed_time: str, errors, events_pending: int, events_replayed: int, result_type, state, total_bytes: int, total_documents: int, last_event_time=None, last_replay_time=None, name: str=None, qualified_name: str=None, collections=None, **kwargs) -> None: + super(MongoDbDatabaseProgress, self).__init__(bytes_copied=bytes_copied, documents_copied=documents_copied, elapsed_time=elapsed_time, errors=errors, events_pending=events_pending, events_replayed=events_replayed, last_event_time=last_event_time, last_replay_time=last_replay_time, name=name, qualified_name=qualified_name, result_type=result_type, state=state, total_bytes=total_bytes, total_documents=total_documents, **kwargs) + self.collections = collections diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_settings.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_settings.py new file mode 100644 index 000000000000..bf175ec1a767 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_settings.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 MongoDbDatabaseSettings(Model): + """Describes how an individual MongoDB database should be migrated. + + All required parameters must be populated in order to send to Azure. + + :param collections: Required. The collections on the source database to + migrate to the target. The keys are the unqualified names of the + collections. + :type collections: dict[str, + ~azure.mgmt.datamigration.models.MongoDbCollectionSettings] + :param target_rus: The RUs that should be configured on a CosmosDB target, + or null to use the default, or 0 if throughput should not be provisioned + for the database. This has no effect on non-CosmosDB targets. + :type target_rus: int + """ + + _validation = { + 'collections': {'required': True}, + } + + _attribute_map = { + 'collections': {'key': 'collections', 'type': '{MongoDbCollectionSettings}'}, + 'target_rus': {'key': 'targetRUs', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(MongoDbDatabaseSettings, self).__init__(**kwargs) + self.collections = kwargs.get('collections', None) + self.target_rus = kwargs.get('target_rus', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_settings_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_settings_py3.py new file mode 100644 index 000000000000..718b5bb1e83c --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_database_settings_py3.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 MongoDbDatabaseSettings(Model): + """Describes how an individual MongoDB database should be migrated. + + All required parameters must be populated in order to send to Azure. + + :param collections: Required. The collections on the source database to + migrate to the target. The keys are the unqualified names of the + collections. + :type collections: dict[str, + ~azure.mgmt.datamigration.models.MongoDbCollectionSettings] + :param target_rus: The RUs that should be configured on a CosmosDB target, + or null to use the default, or 0 if throughput should not be provisioned + for the database. This has no effect on non-CosmosDB targets. + :type target_rus: int + """ + + _validation = { + 'collections': {'required': True}, + } + + _attribute_map = { + 'collections': {'key': 'collections', 'type': '{MongoDbCollectionSettings}'}, + 'target_rus': {'key': 'targetRUs', 'type': 'int'}, + } + + def __init__(self, *, collections, target_rus: int=None, **kwargs) -> None: + super(MongoDbDatabaseSettings, self).__init__(**kwargs) + self.collections = collections + self.target_rus = target_rus diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_error.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_error.py new file mode 100644 index 000000000000..948069427733 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_error.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 MongoDbError(Model): + """Describes an error or warning that occurred during a MongoDB migration. + + :param code: The non-localized, machine-readable code that describes the + error or warning + :type code: str + :param count: The number of times the error or warning has occurred + :type count: int + :param message: The localized, human-readable message that describes the + error or warning + :type message: str + :param type: The type of error or warning. Possible values include: + 'Error', 'ValidationError', 'Warning' + :type type: str or ~azure.mgmt.datamigration.models.MongoDbErrorType + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MongoDbError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.count = kwargs.get('count', None) + self.message = kwargs.get('message', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_error_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_error_py3.py new file mode 100644 index 000000000000..c0fce6293719 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_error_py3.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 MongoDbError(Model): + """Describes an error or warning that occurred during a MongoDB migration. + + :param code: The non-localized, machine-readable code that describes the + error or warning + :type code: str + :param count: The number of times the error or warning has occurred + :type count: int + :param message: The localized, human-readable message that describes the + error or warning + :type message: str + :param type: The type of error or warning. Possible values include: + 'Error', 'ValidationError', 'Warning' + :type type: str or ~azure.mgmt.datamigration.models.MongoDbErrorType + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, count: int=None, message: str=None, type=None, **kwargs) -> None: + super(MongoDbError, self).__init__(**kwargs) + self.code = code + self.count = count + self.message = message + self.type = type diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_progress.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_progress.py new file mode 100644 index 000000000000..6a4dc415ffc7 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_progress.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. +# -------------------------------------------------------------------------- + +from .mongo_db_progress import MongoDbProgress + + +class MongoDbMigrationProgress(MongoDbProgress): + """Describes the progress of the overall migration. + + All required parameters must be populated in order to send to Azure. + + :param bytes_copied: Required. The number of document bytes copied during + the Copying stage + :type bytes_copied: long + :param documents_copied: Required. The number of documents copied during + the Copying stage + :type documents_copied: long + :param elapsed_time: Required. The elapsed time in the format + [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + :type elapsed_time: str + :param errors: Required. The errors and warnings that have occurred for + the current object. The keys are the error codes. + :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :param events_pending: Required. The number of oplog events awaiting + replay + :type events_pending: long + :param events_replayed: Required. The number of oplog events replayed so + far + :type events_replayed: long + :param last_event_time: The timestamp of the last oplog event received, or + null if no oplog event has been received yet + :type last_event_time: datetime + :param last_replay_time: The timestamp of the last oplog event replayed, + or null if no oplog event has been replayed yet + :type last_replay_time: datetime + :param name: The name of the progress object. For a collection, this is + the unqualified collection name. For a database, this is the database + name. For the overall migration, this is null. + :type name: str + :param qualified_name: The qualified name of the progress object. For a + collection, this is the database-qualified name. For a database, this is + the database name. For the overall migration, this is null. + :type qualified_name: str + :param result_type: Required. The type of progress object. Possible values + include: 'Migration', 'Database', 'Collection' + :type result_type: str or ~azure.mgmt.datamigration.models.enum + :param state: Required. Possible values include: 'NotStarted', + 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', + 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', + 'Failed' + :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :param total_bytes: Required. The total number of document bytes on the + source at the beginning of the Copying stage, or -1 if the total size was + unknown + :type total_bytes: long + :param total_documents: Required. The total number of documents on the + source at the beginning of the Copying stage, or -1 if the total count was + unknown + :type total_documents: long + :param databases: The progress of the databases in the migration. The keys + are the names of the databases + :type databases: dict[str, + ~azure.mgmt.datamigration.models.MongoDbDatabaseProgress] + """ + + _validation = { + 'bytes_copied': {'required': True}, + 'documents_copied': {'required': True}, + 'elapsed_time': {'required': True}, + 'errors': {'required': True}, + 'events_pending': {'required': True}, + 'events_replayed': {'required': True}, + 'result_type': {'required': True}, + 'state': {'required': True}, + 'total_bytes': {'required': True}, + 'total_documents': {'required': True}, + } + + _attribute_map = { + 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, + 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, + 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, + 'events_pending': {'key': 'eventsPending', 'type': 'long'}, + 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, + 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, + 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'result_type': {'key': 'resultType', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, + 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, + 'databases': {'key': 'databases', 'type': '{MongoDbDatabaseProgress}'}, + } + + def __init__(self, **kwargs): + super(MongoDbMigrationProgress, self).__init__(**kwargs) + self.databases = kwargs.get('databases', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_progress_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_progress_py3.py new file mode 100644 index 000000000000..7dac4064b5f8 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_progress_py3.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. +# -------------------------------------------------------------------------- + +from .mongo_db_progress_py3 import MongoDbProgress + + +class MongoDbMigrationProgress(MongoDbProgress): + """Describes the progress of the overall migration. + + All required parameters must be populated in order to send to Azure. + + :param bytes_copied: Required. The number of document bytes copied during + the Copying stage + :type bytes_copied: long + :param documents_copied: Required. The number of documents copied during + the Copying stage + :type documents_copied: long + :param elapsed_time: Required. The elapsed time in the format + [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + :type elapsed_time: str + :param errors: Required. The errors and warnings that have occurred for + the current object. The keys are the error codes. + :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :param events_pending: Required. The number of oplog events awaiting + replay + :type events_pending: long + :param events_replayed: Required. The number of oplog events replayed so + far + :type events_replayed: long + :param last_event_time: The timestamp of the last oplog event received, or + null if no oplog event has been received yet + :type last_event_time: datetime + :param last_replay_time: The timestamp of the last oplog event replayed, + or null if no oplog event has been replayed yet + :type last_replay_time: datetime + :param name: The name of the progress object. For a collection, this is + the unqualified collection name. For a database, this is the database + name. For the overall migration, this is null. + :type name: str + :param qualified_name: The qualified name of the progress object. For a + collection, this is the database-qualified name. For a database, this is + the database name. For the overall migration, this is null. + :type qualified_name: str + :param result_type: Required. The type of progress object. Possible values + include: 'Migration', 'Database', 'Collection' + :type result_type: str or ~azure.mgmt.datamigration.models.enum + :param state: Required. Possible values include: 'NotStarted', + 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', + 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', + 'Failed' + :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :param total_bytes: Required. The total number of document bytes on the + source at the beginning of the Copying stage, or -1 if the total size was + unknown + :type total_bytes: long + :param total_documents: Required. The total number of documents on the + source at the beginning of the Copying stage, or -1 if the total count was + unknown + :type total_documents: long + :param databases: The progress of the databases in the migration. The keys + are the names of the databases + :type databases: dict[str, + ~azure.mgmt.datamigration.models.MongoDbDatabaseProgress] + """ + + _validation = { + 'bytes_copied': {'required': True}, + 'documents_copied': {'required': True}, + 'elapsed_time': {'required': True}, + 'errors': {'required': True}, + 'events_pending': {'required': True}, + 'events_replayed': {'required': True}, + 'result_type': {'required': True}, + 'state': {'required': True}, + 'total_bytes': {'required': True}, + 'total_documents': {'required': True}, + } + + _attribute_map = { + 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, + 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, + 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, + 'events_pending': {'key': 'eventsPending', 'type': 'long'}, + 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, + 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, + 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'result_type': {'key': 'resultType', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, + 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, + 'databases': {'key': 'databases', 'type': '{MongoDbDatabaseProgress}'}, + } + + def __init__(self, *, bytes_copied: int, documents_copied: int, elapsed_time: str, errors, events_pending: int, events_replayed: int, result_type, state, total_bytes: int, total_documents: int, last_event_time=None, last_replay_time=None, name: str=None, qualified_name: str=None, databases=None, **kwargs) -> None: + super(MongoDbMigrationProgress, self).__init__(bytes_copied=bytes_copied, documents_copied=documents_copied, elapsed_time=elapsed_time, errors=errors, events_pending=events_pending, events_replayed=events_replayed, last_event_time=last_event_time, last_replay_time=last_replay_time, name=name, qualified_name=qualified_name, result_type=result_type, state=state, total_bytes=total_bytes, total_documents=total_documents, **kwargs) + self.databases = databases diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_settings.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_settings.py new file mode 100644 index 000000000000..927f525673ee --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_settings.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 MongoDbMigrationSettings(Model): + """Describes how a MongoDB data migration should be performed. + + All required parameters must be populated in order to send to Azure. + + :param boost_rus: The RU limit on a CosmosDB target that collections will + be temporarily increased to (if lower) during the initial copy of a + migration, from 10,000 to 1,000,000, or 0 to use the default boost (which + is generally the maximum), or null to not boost the RUs. This setting has + no effect on non-CosmosDB targets. + :type boost_rus: int + :param databases: Required. The databases on the source cluster to migrate + to the target. The keys are the names of the databases. + :type databases: dict[str, + ~azure.mgmt.datamigration.models.MongoDbDatabaseSettings] + :param replication: Describes how changes will be replicated from the + source to the target. The default is OneTime. Possible values include: + 'Disabled', 'OneTime', 'Continuous' + :type replication: str or + ~azure.mgmt.datamigration.models.MongoDbReplication + :param source: Required. Settings used to connect to the source cluster + :type source: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :param target: Required. Settings used to connect to the target cluster + :type target: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :param throttling: Settings used to limit the resource usage of the + migration + :type throttling: + ~azure.mgmt.datamigration.models.MongoDbThrottlingSettings + """ + + _validation = { + 'databases': {'required': True}, + 'source': {'required': True}, + 'target': {'required': True}, + } + + _attribute_map = { + 'boost_rus': {'key': 'boostRUs', 'type': 'int'}, + 'databases': {'key': 'databases', 'type': '{MongoDbDatabaseSettings}'}, + 'replication': {'key': 'replication', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'MongoDbConnectionInfo'}, + 'target': {'key': 'target', 'type': 'MongoDbConnectionInfo'}, + 'throttling': {'key': 'throttling', 'type': 'MongoDbThrottlingSettings'}, + } + + def __init__(self, **kwargs): + super(MongoDbMigrationSettings, self).__init__(**kwargs) + self.boost_rus = kwargs.get('boost_rus', None) + self.databases = kwargs.get('databases', None) + self.replication = kwargs.get('replication', None) + self.source = kwargs.get('source', None) + self.target = kwargs.get('target', None) + self.throttling = kwargs.get('throttling', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_settings_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_settings_py3.py new file mode 100644 index 000000000000..171f8298388f --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_migration_settings_py3.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 MongoDbMigrationSettings(Model): + """Describes how a MongoDB data migration should be performed. + + All required parameters must be populated in order to send to Azure. + + :param boost_rus: The RU limit on a CosmosDB target that collections will + be temporarily increased to (if lower) during the initial copy of a + migration, from 10,000 to 1,000,000, or 0 to use the default boost (which + is generally the maximum), or null to not boost the RUs. This setting has + no effect on non-CosmosDB targets. + :type boost_rus: int + :param databases: Required. The databases on the source cluster to migrate + to the target. The keys are the names of the databases. + :type databases: dict[str, + ~azure.mgmt.datamigration.models.MongoDbDatabaseSettings] + :param replication: Describes how changes will be replicated from the + source to the target. The default is OneTime. Possible values include: + 'Disabled', 'OneTime', 'Continuous' + :type replication: str or + ~azure.mgmt.datamigration.models.MongoDbReplication + :param source: Required. Settings used to connect to the source cluster + :type source: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :param target: Required. Settings used to connect to the target cluster + :type target: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo + :param throttling: Settings used to limit the resource usage of the + migration + :type throttling: + ~azure.mgmt.datamigration.models.MongoDbThrottlingSettings + """ + + _validation = { + 'databases': {'required': True}, + 'source': {'required': True}, + 'target': {'required': True}, + } + + _attribute_map = { + 'boost_rus': {'key': 'boostRUs', 'type': 'int'}, + 'databases': {'key': 'databases', 'type': '{MongoDbDatabaseSettings}'}, + 'replication': {'key': 'replication', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'MongoDbConnectionInfo'}, + 'target': {'key': 'target', 'type': 'MongoDbConnectionInfo'}, + 'throttling': {'key': 'throttling', 'type': 'MongoDbThrottlingSettings'}, + } + + def __init__(self, *, databases, source, target, boost_rus: int=None, replication=None, throttling=None, **kwargs) -> None: + super(MongoDbMigrationSettings, self).__init__(**kwargs) + self.boost_rus = boost_rus + self.databases = databases + self.replication = replication + self.source = source + self.target = target + self.throttling = throttling diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_object_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_object_info.py new file mode 100644 index 000000000000..9a63db308564 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_object_info.py @@ -0,0 +1,58 @@ +# 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 MongoDbObjectInfo(Model): + """Describes a database or collection within a MongoDB data source. + + All required parameters must be populated in order to send to Azure. + + :param average_document_size: Required. The average document size, or -1 + if the average size is unknown + :type average_document_size: long + :param data_size: Required. The estimated total data size, in bytes, or -1 + if the size is unknown. + :type data_size: long + :param document_count: Required. The estimated total number of documents, + or -1 if the document count is unknown + :type document_count: long + :param name: Required. The unqualified name of the database or collection + :type name: str + :param qualified_name: Required. The qualified name of the database or + collection. For a collection, this is the database-qualified name. + :type qualified_name: str + """ + + _validation = { + 'average_document_size': {'required': True}, + 'data_size': {'required': True}, + 'document_count': {'required': True}, + 'name': {'required': True}, + 'qualified_name': {'required': True}, + } + + _attribute_map = { + 'average_document_size': {'key': 'averageDocumentSize', 'type': 'long'}, + 'data_size': {'key': 'dataSize', 'type': 'long'}, + 'document_count': {'key': 'documentCount', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MongoDbObjectInfo, self).__init__(**kwargs) + self.average_document_size = kwargs.get('average_document_size', None) + self.data_size = kwargs.get('data_size', None) + self.document_count = kwargs.get('document_count', None) + self.name = kwargs.get('name', None) + self.qualified_name = kwargs.get('qualified_name', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_object_info_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_object_info_py3.py new file mode 100644 index 000000000000..4efc616c9997 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_object_info_py3.py @@ -0,0 +1,58 @@ +# 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 MongoDbObjectInfo(Model): + """Describes a database or collection within a MongoDB data source. + + All required parameters must be populated in order to send to Azure. + + :param average_document_size: Required. The average document size, or -1 + if the average size is unknown + :type average_document_size: long + :param data_size: Required. The estimated total data size, in bytes, or -1 + if the size is unknown. + :type data_size: long + :param document_count: Required. The estimated total number of documents, + or -1 if the document count is unknown + :type document_count: long + :param name: Required. The unqualified name of the database or collection + :type name: str + :param qualified_name: Required. The qualified name of the database or + collection. For a collection, this is the database-qualified name. + :type qualified_name: str + """ + + _validation = { + 'average_document_size': {'required': True}, + 'data_size': {'required': True}, + 'document_count': {'required': True}, + 'name': {'required': True}, + 'qualified_name': {'required': True}, + } + + _attribute_map = { + 'average_document_size': {'key': 'averageDocumentSize', 'type': 'long'}, + 'data_size': {'key': 'dataSize', 'type': 'long'}, + 'document_count': {'key': 'documentCount', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + } + + def __init__(self, *, average_document_size: int, data_size: int, document_count: int, name: str, qualified_name: str, **kwargs) -> None: + super(MongoDbObjectInfo, self).__init__(**kwargs) + self.average_document_size = average_document_size + self.data_size = data_size + self.document_count = document_count + self.name = name + self.qualified_name = qualified_name diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_progress.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_progress.py new file mode 100644 index 000000000000..2ea6a350f76d --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_progress.py @@ -0,0 +1,115 @@ +# 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 MongoDbProgress(Model): + """Base class for MongoDB migration outputs. + + All required parameters must be populated in order to send to Azure. + + :param bytes_copied: Required. The number of document bytes copied during + the Copying stage + :type bytes_copied: long + :param documents_copied: Required. The number of documents copied during + the Copying stage + :type documents_copied: long + :param elapsed_time: Required. The elapsed time in the format + [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + :type elapsed_time: str + :param errors: Required. The errors and warnings that have occurred for + the current object. The keys are the error codes. + :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :param events_pending: Required. The number of oplog events awaiting + replay + :type events_pending: long + :param events_replayed: Required. The number of oplog events replayed so + far + :type events_replayed: long + :param last_event_time: The timestamp of the last oplog event received, or + null if no oplog event has been received yet + :type last_event_time: datetime + :param last_replay_time: The timestamp of the last oplog event replayed, + or null if no oplog event has been replayed yet + :type last_replay_time: datetime + :param name: The name of the progress object. For a collection, this is + the unqualified collection name. For a database, this is the database + name. For the overall migration, this is null. + :type name: str + :param qualified_name: The qualified name of the progress object. For a + collection, this is the database-qualified name. For a database, this is + the database name. For the overall migration, this is null. + :type qualified_name: str + :param result_type: Required. The type of progress object. Possible values + include: 'Migration', 'Database', 'Collection' + :type result_type: str or ~azure.mgmt.datamigration.models.enum + :param state: Required. Possible values include: 'NotStarted', + 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', + 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', + 'Failed' + :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :param total_bytes: Required. The total number of document bytes on the + source at the beginning of the Copying stage, or -1 if the total size was + unknown + :type total_bytes: long + :param total_documents: Required. The total number of documents on the + source at the beginning of the Copying stage, or -1 if the total count was + unknown + :type total_documents: long + """ + + _validation = { + 'bytes_copied': {'required': True}, + 'documents_copied': {'required': True}, + 'elapsed_time': {'required': True}, + 'errors': {'required': True}, + 'events_pending': {'required': True}, + 'events_replayed': {'required': True}, + 'result_type': {'required': True}, + 'state': {'required': True}, + 'total_bytes': {'required': True}, + 'total_documents': {'required': True}, + } + + _attribute_map = { + 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, + 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, + 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, + 'events_pending': {'key': 'eventsPending', 'type': 'long'}, + 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, + 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, + 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'result_type': {'key': 'resultType', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, + 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(MongoDbProgress, self).__init__(**kwargs) + self.bytes_copied = kwargs.get('bytes_copied', None) + self.documents_copied = kwargs.get('documents_copied', None) + self.elapsed_time = kwargs.get('elapsed_time', None) + self.errors = kwargs.get('errors', None) + self.events_pending = kwargs.get('events_pending', None) + self.events_replayed = kwargs.get('events_replayed', None) + self.last_event_time = kwargs.get('last_event_time', None) + self.last_replay_time = kwargs.get('last_replay_time', None) + self.name = kwargs.get('name', None) + self.qualified_name = kwargs.get('qualified_name', None) + self.result_type = kwargs.get('result_type', None) + self.state = kwargs.get('state', None) + self.total_bytes = kwargs.get('total_bytes', None) + self.total_documents = kwargs.get('total_documents', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_progress_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_progress_py3.py new file mode 100644 index 000000000000..ff70dcff00d4 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_progress_py3.py @@ -0,0 +1,115 @@ +# 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 MongoDbProgress(Model): + """Base class for MongoDB migration outputs. + + All required parameters must be populated in order to send to Azure. + + :param bytes_copied: Required. The number of document bytes copied during + the Copying stage + :type bytes_copied: long + :param documents_copied: Required. The number of documents copied during + the Copying stage + :type documents_copied: long + :param elapsed_time: Required. The elapsed time in the format + [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + :type elapsed_time: str + :param errors: Required. The errors and warnings that have occurred for + the current object. The keys are the error codes. + :type errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError] + :param events_pending: Required. The number of oplog events awaiting + replay + :type events_pending: long + :param events_replayed: Required. The number of oplog events replayed so + far + :type events_replayed: long + :param last_event_time: The timestamp of the last oplog event received, or + null if no oplog event has been received yet + :type last_event_time: datetime + :param last_replay_time: The timestamp of the last oplog event replayed, + or null if no oplog event has been replayed yet + :type last_replay_time: datetime + :param name: The name of the progress object. For a collection, this is + the unqualified collection name. For a database, this is the database + name. For the overall migration, this is null. + :type name: str + :param qualified_name: The qualified name of the progress object. For a + collection, this is the database-qualified name. For a database, this is + the database name. For the overall migration, this is null. + :type qualified_name: str + :param result_type: Required. The type of progress object. Possible values + include: 'Migration', 'Database', 'Collection' + :type result_type: str or ~azure.mgmt.datamigration.models.enum + :param state: Required. Possible values include: 'NotStarted', + 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', + 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', + 'Failed' + :type state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState + :param total_bytes: Required. The total number of document bytes on the + source at the beginning of the Copying stage, or -1 if the total size was + unknown + :type total_bytes: long + :param total_documents: Required. The total number of documents on the + source at the beginning of the Copying stage, or -1 if the total count was + unknown + :type total_documents: long + """ + + _validation = { + 'bytes_copied': {'required': True}, + 'documents_copied': {'required': True}, + 'elapsed_time': {'required': True}, + 'errors': {'required': True}, + 'events_pending': {'required': True}, + 'events_replayed': {'required': True}, + 'result_type': {'required': True}, + 'state': {'required': True}, + 'total_bytes': {'required': True}, + 'total_documents': {'required': True}, + } + + _attribute_map = { + 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, + 'documents_copied': {'key': 'documentsCopied', 'type': 'long'}, + 'elapsed_time': {'key': 'elapsedTime', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '{MongoDbError}'}, + 'events_pending': {'key': 'eventsPending', 'type': 'long'}, + 'events_replayed': {'key': 'eventsReplayed', 'type': 'long'}, + 'last_event_time': {'key': 'lastEventTime', 'type': 'iso-8601'}, + 'last_replay_time': {'key': 'lastReplayTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'result_type': {'key': 'resultType', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, + 'total_documents': {'key': 'totalDocuments', 'type': 'long'}, + } + + def __init__(self, *, bytes_copied: int, documents_copied: int, elapsed_time: str, errors, events_pending: int, events_replayed: int, result_type, state, total_bytes: int, total_documents: int, last_event_time=None, last_replay_time=None, name: str=None, qualified_name: str=None, **kwargs) -> None: + super(MongoDbProgress, self).__init__(**kwargs) + self.bytes_copied = bytes_copied + self.documents_copied = documents_copied + self.elapsed_time = elapsed_time + self.errors = errors + self.events_pending = events_pending + self.events_replayed = events_replayed + self.last_event_time = last_event_time + self.last_replay_time = last_replay_time + self.name = name + self.qualified_name = qualified_name + self.result_type = result_type + self.state = state + self.total_bytes = total_bytes + self.total_documents = total_documents diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_field.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_field.py new file mode 100644 index 000000000000..f73dbda467ec --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_field.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 MongoDbShardKeyField(Model): + """Describes a field reference within a MongoDB shard key. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the field + :type name: str + :param order: Required. The field ordering. Possible values include: + 'Forward', 'Reverse', 'Hashed' + :type order: str or ~azure.mgmt.datamigration.models.MongoDbShardKeyOrder + """ + + _validation = { + 'name': {'required': True}, + 'order': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MongoDbShardKeyField, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.order = kwargs.get('order', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_field_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_field_py3.py new file mode 100644 index 000000000000..12955a73ff02 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_field_py3.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 MongoDbShardKeyField(Model): + """Describes a field reference within a MongoDB shard key. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the field + :type name: str + :param order: Required. The field ordering. Possible values include: + 'Forward', 'Reverse', 'Hashed' + :type order: str or ~azure.mgmt.datamigration.models.MongoDbShardKeyOrder + """ + + _validation = { + 'name': {'required': True}, + 'order': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'str'}, + } + + def __init__(self, *, name: str, order, **kwargs) -> None: + super(MongoDbShardKeyField, self).__init__(**kwargs) + self.name = name + self.order = order diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_info.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_info.py new file mode 100644 index 000000000000..456d4c7db8bd --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_info.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 MongoDbShardKeyInfo(Model): + """Describes a MongoDB shard key. + + All required parameters must be populated in order to send to Azure. + + :param fields: Required. The fields within the shard key + :type fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] + :param is_unique: Required. Whether the shard key is unique + :type is_unique: bool + """ + + _validation = { + 'fields': {'required': True}, + 'is_unique': {'required': True}, + } + + _attribute_map = { + 'fields': {'key': 'fields', 'type': '[MongoDbShardKeyField]'}, + 'is_unique': {'key': 'isUnique', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(MongoDbShardKeyInfo, self).__init__(**kwargs) + self.fields = kwargs.get('fields', None) + self.is_unique = kwargs.get('is_unique', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_info_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_info_py3.py new file mode 100644 index 000000000000..c8f8a53233da --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_info_py3.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 MongoDbShardKeyInfo(Model): + """Describes a MongoDB shard key. + + All required parameters must be populated in order to send to Azure. + + :param fields: Required. The fields within the shard key + :type fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] + :param is_unique: Required. Whether the shard key is unique + :type is_unique: bool + """ + + _validation = { + 'fields': {'required': True}, + 'is_unique': {'required': True}, + } + + _attribute_map = { + 'fields': {'key': 'fields', 'type': '[MongoDbShardKeyField]'}, + 'is_unique': {'key': 'isUnique', 'type': 'bool'}, + } + + def __init__(self, *, fields, is_unique: bool, **kwargs) -> None: + super(MongoDbShardKeyInfo, self).__init__(**kwargs) + self.fields = fields + self.is_unique = is_unique diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_setting.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_setting.py new file mode 100644 index 000000000000..d77546e97a4d --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_setting.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 MongoDbShardKeySetting(Model): + """Describes a MongoDB shard key. + + All required parameters must be populated in order to send to Azure. + + :param fields: Required. The fields within the shard key + :type fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] + :param is_unique: Required. Whether the shard key is unique + :type is_unique: bool + """ + + _validation = { + 'fields': {'required': True}, + 'is_unique': {'required': True}, + } + + _attribute_map = { + 'fields': {'key': 'fields', 'type': '[MongoDbShardKeyField]'}, + 'is_unique': {'key': 'isUnique', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(MongoDbShardKeySetting, self).__init__(**kwargs) + self.fields = kwargs.get('fields', None) + self.is_unique = kwargs.get('is_unique', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_setting_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_setting_py3.py new file mode 100644 index 000000000000..13221f2812bb --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_shard_key_setting_py3.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 MongoDbShardKeySetting(Model): + """Describes a MongoDB shard key. + + All required parameters must be populated in order to send to Azure. + + :param fields: Required. The fields within the shard key + :type fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField] + :param is_unique: Required. Whether the shard key is unique + :type is_unique: bool + """ + + _validation = { + 'fields': {'required': True}, + 'is_unique': {'required': True}, + } + + _attribute_map = { + 'fields': {'key': 'fields', 'type': '[MongoDbShardKeyField]'}, + 'is_unique': {'key': 'isUnique', 'type': 'bool'}, + } + + def __init__(self, *, fields, is_unique: bool, **kwargs) -> None: + super(MongoDbShardKeySetting, self).__init__(**kwargs) + self.fields = fields + self.is_unique = is_unique diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_throttling_settings.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_throttling_settings.py new file mode 100644 index 000000000000..d3f2541326a3 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_throttling_settings.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 MongoDbThrottlingSettings(Model): + """Specifies resource limits for the migration. + + :param min_free_cpu: The percentage of CPU time that the migrator will try + to avoid using, from 0 to 100 + :type min_free_cpu: int + :param min_free_memory_mb: The number of megabytes of RAM that the + migrator will try to avoid using + :type min_free_memory_mb: int + :param max_parallelism: The maximum number of work items (e.g. collection + copies) that will be processed in parallel + :type max_parallelism: int + """ + + _attribute_map = { + 'min_free_cpu': {'key': 'minFreeCpu', 'type': 'int'}, + 'min_free_memory_mb': {'key': 'minFreeMemoryMb', 'type': 'int'}, + 'max_parallelism': {'key': 'maxParallelism', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(MongoDbThrottlingSettings, self).__init__(**kwargs) + self.min_free_cpu = kwargs.get('min_free_cpu', None) + self.min_free_memory_mb = kwargs.get('min_free_memory_mb', None) + self.max_parallelism = kwargs.get('max_parallelism', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_throttling_settings_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_throttling_settings_py3.py new file mode 100644 index 000000000000..e80d791f23d1 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_throttling_settings_py3.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 MongoDbThrottlingSettings(Model): + """Specifies resource limits for the migration. + + :param min_free_cpu: The percentage of CPU time that the migrator will try + to avoid using, from 0 to 100 + :type min_free_cpu: int + :param min_free_memory_mb: The number of megabytes of RAM that the + migrator will try to avoid using + :type min_free_memory_mb: int + :param max_parallelism: The maximum number of work items (e.g. collection + copies) that will be processed in parallel + :type max_parallelism: int + """ + + _attribute_map = { + 'min_free_cpu': {'key': 'minFreeCpu', 'type': 'int'}, + 'min_free_memory_mb': {'key': 'minFreeMemoryMb', 'type': 'int'}, + 'max_parallelism': {'key': 'maxParallelism', 'type': 'int'}, + } + + def __init__(self, *, min_free_cpu: int=None, min_free_memory_mb: int=None, max_parallelism: int=None, **kwargs) -> None: + super(MongoDbThrottlingSettings, self).__init__(**kwargs) + self.min_free_cpu = min_free_cpu + self.min_free_memory_mb = min_free_memory_mb + self.max_parallelism = max_parallelism diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project.py index 67d6c2c87466..32952b8ae734 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project.py @@ -31,12 +31,13 @@ class Project(TrackedResource): :param location: Required. Resource location. :type location: str :param source_platform: Required. Source platform for the project. - Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'Unknown' + Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', + 'Unknown' :type source_platform: str or ~azure.mgmt.datamigration.models.ProjectSourcePlatform :param target_platform: Required. Target platform for the project. Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', - 'AzureDbForPostgreSql', 'Unknown' + 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' :type target_platform: str or ~azure.mgmt.datamigration.models.ProjectTargetPlatform :ivar creation_time: UTC Date and time when project was created diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file.py new file mode 100644 index 000000000000..4375bd149b20 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file.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 ProjectFile(Resource): + """A file resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param etag: HTTP strong entity tag value. This is ignored if submitted. + :type etag: str + :param properties: Custom file properties + :type properties: ~azure.mgmt.datamigration.models.ProjectFileProperties + """ + + _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': 'ProjectFileProperties'}, + } + + def __init__(self, **kwargs): + super(ProjectFile, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_paged.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_paged.py new file mode 100644 index 000000000000..05b7153634e8 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_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 ProjectFilePaged(Paged): + """ + A paging container for iterating over a list of :class:`ProjectFile ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ProjectFile]'} + } + + def __init__(self, *args, **kwargs): + + super(ProjectFilePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties.py new file mode 100644 index 000000000000..1321ae12f150 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties.py @@ -0,0 +1,55 @@ +# 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 ProjectFileProperties(Model): + """Base class for file properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param extension: Optional File extension. If submitted it should not have + a leading period and must match the extension from filePath. + :type extension: str + :param file_path: Relative path of this file resource. This property can + be set when creating or updating the file resource. + :type file_path: str + :ivar last_modified: Modification DateTime. + :vartype last_modified: datetime + :param media_type: File content type. This propery can be modified to + reflect the file content type. + :type media_type: str + :ivar size: File size. + :vartype size: long + """ + + _validation = { + 'last_modified': {'readonly': True}, + 'size': {'readonly': True}, + } + + _attribute_map = { + 'extension': {'key': 'extension', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'media_type': {'key': 'mediaType', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(ProjectFileProperties, self).__init__(**kwargs) + self.extension = kwargs.get('extension', None) + self.file_path = kwargs.get('file_path', None) + self.last_modified = None + self.media_type = kwargs.get('media_type', None) + self.size = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties_py3.py new file mode 100644 index 000000000000..f7250920aa8c --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties_py3.py @@ -0,0 +1,55 @@ +# 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 ProjectFileProperties(Model): + """Base class for file properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param extension: Optional File extension. If submitted it should not have + a leading period and must match the extension from filePath. + :type extension: str + :param file_path: Relative path of this file resource. This property can + be set when creating or updating the file resource. + :type file_path: str + :ivar last_modified: Modification DateTime. + :vartype last_modified: datetime + :param media_type: File content type. This propery can be modified to + reflect the file content type. + :type media_type: str + :ivar size: File size. + :vartype size: long + """ + + _validation = { + 'last_modified': {'readonly': True}, + 'size': {'readonly': True}, + } + + _attribute_map = { + 'extension': {'key': 'extension', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'media_type': {'key': 'mediaType', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + } + + def __init__(self, *, extension: str=None, file_path: str=None, media_type: str=None, **kwargs) -> None: + super(ProjectFileProperties, self).__init__(**kwargs) + self.extension = extension + self.file_path = file_path + self.last_modified = None + self.media_type = media_type + self.size = None diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_py3.py new file mode 100644 index 000000000000..16df2bac54c4 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_py3.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_py3 import Resource + + +class ProjectFile(Resource): + """A file resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param etag: HTTP strong entity tag value. This is ignored if submitted. + :type etag: str + :param properties: Custom file properties + :type properties: ~azure.mgmt.datamigration.models.ProjectFileProperties + """ + + _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': 'ProjectFileProperties'}, + } + + def __init__(self, *, etag: str=None, properties=None, **kwargs) -> None: + super(ProjectFile, self).__init__(**kwargs) + self.etag = etag + self.properties = properties diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_py3.py index e70f1fe8ff11..0030ce2627f8 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_py3.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_py3.py @@ -31,12 +31,13 @@ class Project(TrackedResource): :param location: Required. Resource location. :type location: str :param source_platform: Required. Source platform for the project. - Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'Unknown' + Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', + 'Unknown' :type source_platform: str or ~azure.mgmt.datamigration.models.ProjectSourcePlatform :param target_platform: Required. Target platform for the project. Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', - 'AzureDbForPostgreSql', 'Unknown' + 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' :type target_platform: str or ~azure.mgmt.datamigration.models.ProjectTargetPlatform :ivar creation_time: UTC Date and time when project was created 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 index bf9f28aafbfd..4cd809b81b17 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_properties.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_properties.py @@ -18,18 +18,20 @@ class ProjectTaskProperties(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: GetTdeCertificatesSqlTaskProperties, + ValidateMongoDbTaskProperties, ValidateMigrationInputSqlServerSqlMITaskProperties, ValidateMigrationInputSqlServerSqlDbSyncTaskProperties, MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties, MigrateMySqlAzureDbForMySqlSyncTaskProperties, MigrateSqlServerSqlDbSyncTaskProperties, MigrateSqlServerSqlDbTaskProperties, MigrateSqlServerSqlMITaskProperties, - ConnectToTargetAzureDbForMySqlTaskProperties, + MigrateMongoDbTaskProperties, ConnectToTargetAzureDbForMySqlTaskProperties, ConnectToTargetSqlMITaskProperties, GetUserTablesSqlSyncTaskProperties, GetUserTablesSqlTaskProperties, ConnectToTargetSqlSqlDbSyncTaskProperties, ConnectToTargetSqlDbTaskProperties, ConnectToSourceSqlServerSyncTaskProperties, - ConnectToSourceSqlServerTaskProperties, ConnectToSourceMySqlTaskProperties, + ConnectToSourceSqlServerTaskProperties, ConnectToMongoDbTaskProperties, + ConnectToSourceMySqlTaskProperties, MigrateSchemaSqlServerSqlDbTaskProperties Variables are only populated by the server, and will be ignored when @@ -65,7 +67,7 @@ class ProjectTaskProperties(Model): } _subtype_map = { - 'task_type': {'GetTDECertificates.Sql': 'GetTdeCertificatesSqlTaskProperties', 'ValidateMigrationInput.SqlServer.AzureSqlDbMI': 'ValidateMigrationInputSqlServerSqlMITaskProperties', 'ValidateMigrationInput.SqlServer.SqlDb.Sync': 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties', 'Migrate.PostgreSql.AzureDbForPostgreSql.Sync': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties', 'Migrate.MySql.AzureDbForMySql.Sync': 'MigrateMySqlAzureDbForMySqlSyncTaskProperties', 'Migrate.SqlServer.AzureSqlDb.Sync': 'MigrateSqlServerSqlDbSyncTaskProperties', 'Migrate.SqlServer.SqlDb': 'MigrateSqlServerSqlDbTaskProperties', 'Migrate.SqlServer.AzureSqlDbMI': 'MigrateSqlServerSqlMITaskProperties', 'ConnectToTarget.AzureDbForMySql': 'ConnectToTargetAzureDbForMySqlTaskProperties', 'ConnectToTarget.AzureSqlDbMI': 'ConnectToTargetSqlMITaskProperties', 'GetUserTables.AzureSqlDb.Sync': 'GetUserTablesSqlSyncTaskProperties', 'GetUserTables.Sql': 'GetUserTablesSqlTaskProperties', 'ConnectToTarget.SqlDb.Sync': 'ConnectToTargetSqlSqlDbSyncTaskProperties', 'ConnectToTarget.SqlDb': 'ConnectToTargetSqlDbTaskProperties', 'ConnectToSource.SqlServer.Sync': 'ConnectToSourceSqlServerSyncTaskProperties', 'ConnectToSource.SqlServer': 'ConnectToSourceSqlServerTaskProperties', 'ConnectToSource.MySql': 'ConnectToSourceMySqlTaskProperties', 'MigrateSchemaSqlServerSqlDb': 'MigrateSchemaSqlServerSqlDbTaskProperties'} + 'task_type': {'GetTDECertificates.Sql': 'GetTdeCertificatesSqlTaskProperties', 'Validate.MongoDb': 'ValidateMongoDbTaskProperties', 'ValidateMigrationInput.SqlServer.AzureSqlDbMI': 'ValidateMigrationInputSqlServerSqlMITaskProperties', 'ValidateMigrationInput.SqlServer.SqlDb.Sync': 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties', 'Migrate.PostgreSql.AzureDbForPostgreSql.Sync': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties', 'Migrate.MySql.AzureDbForMySql.Sync': 'MigrateMySqlAzureDbForMySqlSyncTaskProperties', 'Migrate.SqlServer.AzureSqlDb.Sync': 'MigrateSqlServerSqlDbSyncTaskProperties', 'Migrate.SqlServer.SqlDb': 'MigrateSqlServerSqlDbTaskProperties', 'Migrate.SqlServer.AzureSqlDbMI': 'MigrateSqlServerSqlMITaskProperties', 'Migrate.MongoDb': 'MigrateMongoDbTaskProperties', 'ConnectToTarget.AzureDbForMySql': 'ConnectToTargetAzureDbForMySqlTaskProperties', 'ConnectToTarget.AzureSqlDbMI': 'ConnectToTargetSqlMITaskProperties', 'GetUserTables.AzureSqlDb.Sync': 'GetUserTablesSqlSyncTaskProperties', 'GetUserTables.Sql': 'GetUserTablesSqlTaskProperties', 'ConnectToTarget.SqlDb.Sync': 'ConnectToTargetSqlSqlDbSyncTaskProperties', 'ConnectToTarget.SqlDb': 'ConnectToTargetSqlDbTaskProperties', 'ConnectToSource.SqlServer.Sync': 'ConnectToSourceSqlServerSyncTaskProperties', 'ConnectToSource.SqlServer': 'ConnectToSourceSqlServerTaskProperties', 'Connect.MongoDb': 'ConnectToMongoDbTaskProperties', 'ConnectToSource.MySql': 'ConnectToSourceMySqlTaskProperties', 'MigrateSchemaSqlServerSqlDb': 'MigrateSchemaSqlServerSqlDbTaskProperties'} } def __init__(self, **kwargs): diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_properties_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_properties_py3.py index 1bc6c86fec40..7bee86ae6e56 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_properties_py3.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_task_properties_py3.py @@ -18,18 +18,20 @@ class ProjectTaskProperties(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: GetTdeCertificatesSqlTaskProperties, + ValidateMongoDbTaskProperties, ValidateMigrationInputSqlServerSqlMITaskProperties, ValidateMigrationInputSqlServerSqlDbSyncTaskProperties, MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties, MigrateMySqlAzureDbForMySqlSyncTaskProperties, MigrateSqlServerSqlDbSyncTaskProperties, MigrateSqlServerSqlDbTaskProperties, MigrateSqlServerSqlMITaskProperties, - ConnectToTargetAzureDbForMySqlTaskProperties, + MigrateMongoDbTaskProperties, ConnectToTargetAzureDbForMySqlTaskProperties, ConnectToTargetSqlMITaskProperties, GetUserTablesSqlSyncTaskProperties, GetUserTablesSqlTaskProperties, ConnectToTargetSqlSqlDbSyncTaskProperties, ConnectToTargetSqlDbTaskProperties, ConnectToSourceSqlServerSyncTaskProperties, - ConnectToSourceSqlServerTaskProperties, ConnectToSourceMySqlTaskProperties, + ConnectToSourceSqlServerTaskProperties, ConnectToMongoDbTaskProperties, + ConnectToSourceMySqlTaskProperties, MigrateSchemaSqlServerSqlDbTaskProperties Variables are only populated by the server, and will be ignored when @@ -65,7 +67,7 @@ class ProjectTaskProperties(Model): } _subtype_map = { - 'task_type': {'GetTDECertificates.Sql': 'GetTdeCertificatesSqlTaskProperties', 'ValidateMigrationInput.SqlServer.AzureSqlDbMI': 'ValidateMigrationInputSqlServerSqlMITaskProperties', 'ValidateMigrationInput.SqlServer.SqlDb.Sync': 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties', 'Migrate.PostgreSql.AzureDbForPostgreSql.Sync': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties', 'Migrate.MySql.AzureDbForMySql.Sync': 'MigrateMySqlAzureDbForMySqlSyncTaskProperties', 'Migrate.SqlServer.AzureSqlDb.Sync': 'MigrateSqlServerSqlDbSyncTaskProperties', 'Migrate.SqlServer.SqlDb': 'MigrateSqlServerSqlDbTaskProperties', 'Migrate.SqlServer.AzureSqlDbMI': 'MigrateSqlServerSqlMITaskProperties', 'ConnectToTarget.AzureDbForMySql': 'ConnectToTargetAzureDbForMySqlTaskProperties', 'ConnectToTarget.AzureSqlDbMI': 'ConnectToTargetSqlMITaskProperties', 'GetUserTables.AzureSqlDb.Sync': 'GetUserTablesSqlSyncTaskProperties', 'GetUserTables.Sql': 'GetUserTablesSqlTaskProperties', 'ConnectToTarget.SqlDb.Sync': 'ConnectToTargetSqlSqlDbSyncTaskProperties', 'ConnectToTarget.SqlDb': 'ConnectToTargetSqlDbTaskProperties', 'ConnectToSource.SqlServer.Sync': 'ConnectToSourceSqlServerSyncTaskProperties', 'ConnectToSource.SqlServer': 'ConnectToSourceSqlServerTaskProperties', 'ConnectToSource.MySql': 'ConnectToSourceMySqlTaskProperties', 'MigrateSchemaSqlServerSqlDb': 'MigrateSchemaSqlServerSqlDbTaskProperties'} + 'task_type': {'GetTDECertificates.Sql': 'GetTdeCertificatesSqlTaskProperties', 'Validate.MongoDb': 'ValidateMongoDbTaskProperties', 'ValidateMigrationInput.SqlServer.AzureSqlDbMI': 'ValidateMigrationInputSqlServerSqlMITaskProperties', 'ValidateMigrationInput.SqlServer.SqlDb.Sync': 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties', 'Migrate.PostgreSql.AzureDbForPostgreSql.Sync': 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties', 'Migrate.MySql.AzureDbForMySql.Sync': 'MigrateMySqlAzureDbForMySqlSyncTaskProperties', 'Migrate.SqlServer.AzureSqlDb.Sync': 'MigrateSqlServerSqlDbSyncTaskProperties', 'Migrate.SqlServer.SqlDb': 'MigrateSqlServerSqlDbTaskProperties', 'Migrate.SqlServer.AzureSqlDbMI': 'MigrateSqlServerSqlMITaskProperties', 'Migrate.MongoDb': 'MigrateMongoDbTaskProperties', 'ConnectToTarget.AzureDbForMySql': 'ConnectToTargetAzureDbForMySqlTaskProperties', 'ConnectToTarget.AzureSqlDbMI': 'ConnectToTargetSqlMITaskProperties', 'GetUserTables.AzureSqlDb.Sync': 'GetUserTablesSqlSyncTaskProperties', 'GetUserTables.Sql': 'GetUserTablesSqlTaskProperties', 'ConnectToTarget.SqlDb.Sync': 'ConnectToTargetSqlSqlDbSyncTaskProperties', 'ConnectToTarget.SqlDb': 'ConnectToTargetSqlDbTaskProperties', 'ConnectToSource.SqlServer.Sync': 'ConnectToSourceSqlServerSyncTaskProperties', 'ConnectToSource.SqlServer': 'ConnectToSourceSqlServerTaskProperties', 'Connect.MongoDb': 'ConnectToMongoDbTaskProperties', 'ConnectToSource.MySql': 'ConnectToSourceMySqlTaskProperties', 'MigrateSchemaSqlServerSqlDb': 'MigrateSchemaSqlServerSqlDbTaskProperties'} } def __init__(self, **kwargs) -> None: diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/validate_mongo_db_task_properties.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/validate_mongo_db_task_properties.py new file mode 100644 index 000000000000..10a93f4e5ae5 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/validate_mongo_db_task_properties.py @@ -0,0 +1,63 @@ +# 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 ValidateMongoDbTaskProperties(ProjectTaskProperties): + """Properties for the task that validates a migration between MongoDB data + sources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the task. This is ignored if submitted. Possible + values include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', + 'Failed', 'FailedInputValidation', 'Faulted' + :vartype state: str or ~azure.mgmt.datamigration.models.TaskState + :ivar commands: Array of command properties. + :vartype commands: + list[~azure.mgmt.datamigration.models.CommandProperties] + :param task_type: Required. Constant filled by server. + :type task_type: str + :param input: + :type input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings + :ivar output: An array containing a single MongoDbMigrationProgress object + :vartype output: + list[~azure.mgmt.datamigration.models.MongoDbMigrationProgress] + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'commands': {'readonly': True}, + 'task_type': {'required': True}, + 'output': {'readonly': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbMigrationSettings'}, + 'output': {'key': 'output', 'type': '[MongoDbMigrationProgress]'}, + } + + def __init__(self, **kwargs): + super(ValidateMongoDbTaskProperties, self).__init__(**kwargs) + self.input = kwargs.get('input', None) + self.output = None + self.task_type = 'Validate.MongoDb' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/validate_mongo_db_task_properties_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/validate_mongo_db_task_properties_py3.py new file mode 100644 index 000000000000..740ed03d1d14 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/validate_mongo_db_task_properties_py3.py @@ -0,0 +1,63 @@ +# 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_py3 import ProjectTaskProperties + + +class ValidateMongoDbTaskProperties(ProjectTaskProperties): + """Properties for the task that validates a migration between MongoDB data + sources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the task. This is ignored if submitted. Possible + values include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', + 'Failed', 'FailedInputValidation', 'Faulted' + :vartype state: str or ~azure.mgmt.datamigration.models.TaskState + :ivar commands: Array of command properties. + :vartype commands: + list[~azure.mgmt.datamigration.models.CommandProperties] + :param task_type: Required. Constant filled by server. + :type task_type: str + :param input: + :type input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings + :ivar output: An array containing a single MongoDbMigrationProgress object + :vartype output: + list[~azure.mgmt.datamigration.models.MongoDbMigrationProgress] + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'commands': {'readonly': True}, + 'task_type': {'required': True}, + 'output': {'readonly': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'commands': {'key': 'commands', 'type': '[CommandProperties]'}, + 'task_type': {'key': 'taskType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbMigrationSettings'}, + 'output': {'key': 'output', 'type': '[MongoDbMigrationProgress]'}, + } + + def __init__(self, *, input=None, **kwargs) -> None: + super(ValidateMongoDbTaskProperties, self).__init__(**kwargs) + self.input = input + self.output = None + self.task_type = 'Validate.MongoDb' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py index dae6a3120660..b06ecfce78cc 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/__init__.py @@ -15,6 +15,7 @@ from .projects_operations import ProjectsOperations from .usages_operations import UsagesOperations from .operations import Operations +from .files_operations import FilesOperations __all__ = [ 'ResourceSkusOperations', @@ -23,4 +24,5 @@ 'ProjectsOperations', 'UsagesOperations', 'Operations', + 'FilesOperations', ] diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/files_operations.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/files_operations.py new file mode 100644 index 000000000000..25033e3714bc --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/files_operations.py @@ -0,0 +1,548 @@ +# 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 FilesOperations(object): + """FilesOperations 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: "2018-07-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-15-preview" + + self.config = config + + def list( + self, group_name, service_name, project_name, custom_headers=None, raw=False, **operation_config): + """Get files in a project. + + The project resource is a nested resource representing a stored + migration project. This method returns a list of files owned by a + project 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 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: An iterator like instance of ProjectFile + :rtype: + ~azure.mgmt.datamigration.models.ProjectFilePaged[~azure.mgmt.datamigration.models.ProjectFile] + :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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProjectFilePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProjectFilePaged(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}/files'} + + def get( + self, group_name, service_name, project_name, file_name, custom_headers=None, raw=False, **operation_config): + """Get file information. + + The files resource is a nested, proxy-only resource representing a file + stored under the project resource. This method retrieves information + about a file. + + :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 file_name: Name of the File + :type file_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: ProjectFile or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.ProjectFile 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'), + 'fileName': self._serialize.url("file_name", file_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ProjectFile', 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}/files/{fileName}'} + + def create_or_update( + self, group_name, service_name, project_name, file_name, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Create a file resource. + + The PUT method creates a new file or updates an existing 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 file_name: Name of the File + :type file_name: str + :param etag: HTTP strong entity tag value. This is ignored if + submitted. + :type etag: str + :param properties: Custom file properties + :type properties: + ~azure.mgmt.datamigration.models.ProjectFileProperties + :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: ProjectFile or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.ProjectFile or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + parameters = models.ProjectFile(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'), + 'fileName': self._serialize.url("file_name", file_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['Accept'] = 'application/json' + 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, 'ProjectFile') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ProjectFile', response) + if response.status_code == 201: + deserialized = self._deserialize('ProjectFile', 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}/files/{fileName}'} + + def delete( + self, group_name, service_name, project_name, file_name, custom_headers=None, raw=False, **operation_config): + """Delete file. + + This method deletes a file. + + :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 file_name: Name of the File + :type file_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: 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'), + 'fileName': self._serialize.url("file_name", file_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 = {} + 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, header_parameters) + response = self._client.send(request, 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}/files/{fileName}'} + + def update( + self, group_name, service_name, project_name, file_name, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Update a file. + + This method updates an existing file. + + :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 file_name: Name of the File + :type file_name: str + :param etag: HTTP strong entity tag value. This is ignored if + submitted. + :type etag: str + :param properties: Custom file properties + :type properties: + ~azure.mgmt.datamigration.models.ProjectFileProperties + :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: ProjectFile or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.ProjectFile or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + parameters = models.ProjectFile(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'), + 'fileName': self._serialize.url("file_name", file_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['Accept'] = 'application/json' + 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, 'ProjectFile') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ProjectFile', 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}/files/{fileName}'} + + def read( + self, group_name, service_name, project_name, file_name, custom_headers=None, raw=False, **operation_config): + """Request storage information for downloading the file content. + + This method is used for requesting storage information using which + contents of the file can be downloaded. + + :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 file_name: Name of the File + :type file_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: FileStorageInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.FileStorageInfo or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.read.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'), + 'fileName': self._serialize.url("file_name", file_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('FileStorageInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + read.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/read'} + + def read_write( + self, group_name, service_name, project_name, file_name, custom_headers=None, raw=False, **operation_config): + """Request information for reading and writing file content. + + This method is used for requesting information for reading and writing + the file content. + + :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 file_name: Name of the File + :type file_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: FileStorageInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datamigration.models.FileStorageInfo or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # Construct URL + url = self.read_write.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'), + 'fileName': self._serialize.url("file_name", file_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('FileStorageInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + read_write.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/readwrite'} From 866545b67f20de89a43554314a40005ef4f491e7 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 2 Nov 2018 11:29:23 -0700 Subject: [PATCH 3/4] Generated from c2b76af4ead5dd8be9ffdc07366e9701b1317f0b (#3716) Update readme.md --- .../mgmt/datamigration/models/__init__.py | 15 ++++++ .../models/command_properties.py | 5 +- .../models/command_properties_py3.py | 5 +- .../models/mongo_db_cancel_command.py | 51 +++++++++++++++++++ .../models/mongo_db_cancel_command_py3.py | 51 +++++++++++++++++++ .../models/mongo_db_command_input.py | 30 +++++++++++ .../models/mongo_db_command_input_py3.py | 30 +++++++++++ .../models/mongo_db_finish_command.py | 51 +++++++++++++++++++ .../models/mongo_db_finish_command_input.py | 40 +++++++++++++++ .../mongo_db_finish_command_input_py3.py | 40 +++++++++++++++ .../models/mongo_db_finish_command_py3.py | 51 +++++++++++++++++++ .../models/mongo_db_restart_command.py | 51 +++++++++++++++++++ .../models/mongo_db_restart_command_py3.py | 51 +++++++++++++++++++ 13 files changed, 467 insertions(+), 4 deletions(-) create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cancel_command.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cancel_command_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_command_input.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_command_input_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_input.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_input_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_py3.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_restart_command.py create mode 100644 azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_restart_command_py3.py diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py index c4d6afeb19c5..4c2058abc869 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/__init__.py @@ -183,6 +183,11 @@ from .migrate_schema_sql_server_sql_db_task_output_database_level_py3 import MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel from .migrate_schema_sql_server_sql_db_task_output_error_py3 import MigrateSchemaSqlServerSqlDbTaskOutputError from .migrate_schema_sql_task_output_error_py3 import MigrateSchemaSqlTaskOutputError + from .mongo_db_command_input_py3 import MongoDbCommandInput + from .mongo_db_cancel_command_py3 import MongoDbCancelCommand + from .mongo_db_finish_command_input_py3 import MongoDbFinishCommandInput + from .mongo_db_finish_command_py3 import MongoDbFinishCommand + from .mongo_db_restart_command_py3 import MongoDbRestartCommand from .database_py3 import Database from .database_object_name_py3 import DatabaseObjectName from .migration_table_metadata_py3 import MigrationTableMetadata @@ -369,6 +374,11 @@ from .migrate_schema_sql_server_sql_db_task_output_database_level import MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel from .migrate_schema_sql_server_sql_db_task_output_error import MigrateSchemaSqlServerSqlDbTaskOutputError from .migrate_schema_sql_task_output_error import MigrateSchemaSqlTaskOutputError + from .mongo_db_command_input import MongoDbCommandInput + from .mongo_db_cancel_command import MongoDbCancelCommand + from .mongo_db_finish_command_input import MongoDbFinishCommandInput + from .mongo_db_finish_command import MongoDbFinishCommand + from .mongo_db_restart_command import MongoDbRestartCommand from .database import Database from .database_object_name import DatabaseObjectName from .migration_table_metadata import MigrationTableMetadata @@ -606,6 +616,11 @@ 'MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel', 'MigrateSchemaSqlServerSqlDbTaskOutputError', 'MigrateSchemaSqlTaskOutputError', + 'MongoDbCommandInput', + 'MongoDbCancelCommand', + 'MongoDbFinishCommandInput', + 'MongoDbFinishCommand', + 'MongoDbRestartCommand', 'Database', 'DatabaseObjectName', 'MigrationTableMetadata', diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/command_properties.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/command_properties.py index 74947a116cde..098e974de48e 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/command_properties.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/command_properties.py @@ -17,7 +17,8 @@ class CommandProperties(Model): 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: MigrateSyncCompleteCommandProperties + sub-classes are: MigrateSyncCompleteCommandProperties, + MongoDbCancelCommand, MongoDbFinishCommand, MongoDbRestartCommand Variables are only populated by the server, and will be ignored when sending a request. @@ -47,7 +48,7 @@ class CommandProperties(Model): } _subtype_map = { - 'command_type': {'Migrate.Sync.Complete.Database': 'MigrateSyncCompleteCommandProperties'} + 'command_type': {'Migrate.Sync.Complete.Database': 'MigrateSyncCompleteCommandProperties', 'cancel': 'MongoDbCancelCommand', 'finish': 'MongoDbFinishCommand', 'restart': 'MongoDbRestartCommand'} } def __init__(self, **kwargs): diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/command_properties_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/command_properties_py3.py index 1e050060e555..cda890206d25 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/command_properties_py3.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/command_properties_py3.py @@ -17,7 +17,8 @@ class CommandProperties(Model): 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: MigrateSyncCompleteCommandProperties + sub-classes are: MigrateSyncCompleteCommandProperties, + MongoDbCancelCommand, MongoDbFinishCommand, MongoDbRestartCommand Variables are only populated by the server, and will be ignored when sending a request. @@ -47,7 +48,7 @@ class CommandProperties(Model): } _subtype_map = { - 'command_type': {'Migrate.Sync.Complete.Database': 'MigrateSyncCompleteCommandProperties'} + 'command_type': {'Migrate.Sync.Complete.Database': 'MigrateSyncCompleteCommandProperties', 'cancel': 'MongoDbCancelCommand', 'finish': 'MongoDbFinishCommand', 'restart': 'MongoDbRestartCommand'} } def __init__(self, **kwargs) -> None: diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cancel_command.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cancel_command.py new file mode 100644 index 000000000000..4643f63dcacc --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cancel_command.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 .command_properties import CommandProperties + + +class MongoDbCancelCommand(CommandProperties): + """Properties for the command that cancels a migration in whole or in part. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the command. This is ignored if submitted. + Possible values include: 'Unknown', 'Accepted', 'Running', 'Succeeded', + 'Failed' + :vartype state: str or ~azure.mgmt.datamigration.models.CommandState + :param command_type: Required. Constant filled by server. + :type command_type: str + :param input: Command input + :type input: ~azure.mgmt.datamigration.models.MongoDbCommandInput + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'command_type': {'required': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'command_type': {'key': 'commandType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbCommandInput'}, + } + + def __init__(self, **kwargs): + super(MongoDbCancelCommand, self).__init__(**kwargs) + self.input = kwargs.get('input', None) + self.command_type = 'cancel' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cancel_command_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cancel_command_py3.py new file mode 100644 index 000000000000..83971c52855f --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_cancel_command_py3.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 .command_properties_py3 import CommandProperties + + +class MongoDbCancelCommand(CommandProperties): + """Properties for the command that cancels a migration in whole or in part. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the command. This is ignored if submitted. + Possible values include: 'Unknown', 'Accepted', 'Running', 'Succeeded', + 'Failed' + :vartype state: str or ~azure.mgmt.datamigration.models.CommandState + :param command_type: Required. Constant filled by server. + :type command_type: str + :param input: Command input + :type input: ~azure.mgmt.datamigration.models.MongoDbCommandInput + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'command_type': {'required': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'command_type': {'key': 'commandType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbCommandInput'}, + } + + def __init__(self, *, input=None, **kwargs) -> None: + super(MongoDbCancelCommand, self).__init__(**kwargs) + self.input = input + self.command_type = 'cancel' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_command_input.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_command_input.py new file mode 100644 index 000000000000..62ee1e513304 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_command_input.py @@ -0,0 +1,30 @@ +# 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 MongoDbCommandInput(Model): + """Describes the input to the 'cancel' and 'restart' MongoDB migration + commands. + + :param object_name: The qualified name of a database or collection to act + upon, or null to act upon the entire migration + :type object_name: str + """ + + _attribute_map = { + 'object_name': {'key': 'objectName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MongoDbCommandInput, self).__init__(**kwargs) + self.object_name = kwargs.get('object_name', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_command_input_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_command_input_py3.py new file mode 100644 index 000000000000..4581858b8e1a --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_command_input_py3.py @@ -0,0 +1,30 @@ +# 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 MongoDbCommandInput(Model): + """Describes the input to the 'cancel' and 'restart' MongoDB migration + commands. + + :param object_name: The qualified name of a database or collection to act + upon, or null to act upon the entire migration + :type object_name: str + """ + + _attribute_map = { + 'object_name': {'key': 'objectName', 'type': 'str'}, + } + + def __init__(self, *, object_name: str=None, **kwargs) -> None: + super(MongoDbCommandInput, self).__init__(**kwargs) + self.object_name = object_name diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command.py new file mode 100644 index 000000000000..6b6c4ba6de5c --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command.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 .command_properties import CommandProperties + + +class MongoDbFinishCommand(CommandProperties): + """Properties for the command that finishes a migration in whole or in part. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the command. This is ignored if submitted. + Possible values include: 'Unknown', 'Accepted', 'Running', 'Succeeded', + 'Failed' + :vartype state: str or ~azure.mgmt.datamigration.models.CommandState + :param command_type: Required. Constant filled by server. + :type command_type: str + :param input: Command input + :type input: ~azure.mgmt.datamigration.models.MongoDbFinishCommandInput + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'command_type': {'required': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'command_type': {'key': 'commandType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbFinishCommandInput'}, + } + + def __init__(self, **kwargs): + super(MongoDbFinishCommand, self).__init__(**kwargs) + self.input = kwargs.get('input', None) + self.command_type = 'finish' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_input.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_input.py new file mode 100644 index 000000000000..e8c14aee170f --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_input.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 .mongo_db_command_input import MongoDbCommandInput + + +class MongoDbFinishCommandInput(MongoDbCommandInput): + """Describes the input to the 'finish' MongoDB migration command. + + All required parameters must be populated in order to send to Azure. + + :param object_name: The qualified name of a database or collection to act + upon, or null to act upon the entire migration + :type object_name: str + :param immediate: Required. If true, replication for the affected objects + will be stopped immediately. If false, the migrator will finish replaying + queued events before finishing the replication. + :type immediate: bool + """ + + _validation = { + 'immediate': {'required': True}, + } + + _attribute_map = { + 'object_name': {'key': 'objectName', 'type': 'str'}, + 'immediate': {'key': 'immediate', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(MongoDbFinishCommandInput, self).__init__(**kwargs) + self.immediate = kwargs.get('immediate', None) diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_input_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_input_py3.py new file mode 100644 index 000000000000..49e561fc90fa --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_input_py3.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 .mongo_db_command_input_py3 import MongoDbCommandInput + + +class MongoDbFinishCommandInput(MongoDbCommandInput): + """Describes the input to the 'finish' MongoDB migration command. + + All required parameters must be populated in order to send to Azure. + + :param object_name: The qualified name of a database or collection to act + upon, or null to act upon the entire migration + :type object_name: str + :param immediate: Required. If true, replication for the affected objects + will be stopped immediately. If false, the migrator will finish replaying + queued events before finishing the replication. + :type immediate: bool + """ + + _validation = { + 'immediate': {'required': True}, + } + + _attribute_map = { + 'object_name': {'key': 'objectName', 'type': 'str'}, + 'immediate': {'key': 'immediate', 'type': 'bool'}, + } + + def __init__(self, *, immediate: bool, object_name: str=None, **kwargs) -> None: + super(MongoDbFinishCommandInput, self).__init__(object_name=object_name, **kwargs) + self.immediate = immediate diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_py3.py new file mode 100644 index 000000000000..6c52da153511 --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_finish_command_py3.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 .command_properties_py3 import CommandProperties + + +class MongoDbFinishCommand(CommandProperties): + """Properties for the command that finishes a migration in whole or in part. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the command. This is ignored if submitted. + Possible values include: 'Unknown', 'Accepted', 'Running', 'Succeeded', + 'Failed' + :vartype state: str or ~azure.mgmt.datamigration.models.CommandState + :param command_type: Required. Constant filled by server. + :type command_type: str + :param input: Command input + :type input: ~azure.mgmt.datamigration.models.MongoDbFinishCommandInput + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'command_type': {'required': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'command_type': {'key': 'commandType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbFinishCommandInput'}, + } + + def __init__(self, *, input=None, **kwargs) -> None: + super(MongoDbFinishCommand, self).__init__(**kwargs) + self.input = input + self.command_type = 'finish' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_restart_command.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_restart_command.py new file mode 100644 index 000000000000..bdd9ffd455fb --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_restart_command.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 .command_properties import CommandProperties + + +class MongoDbRestartCommand(CommandProperties): + """Properties for the command that restarts a migration in whole or in part. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the command. This is ignored if submitted. + Possible values include: 'Unknown', 'Accepted', 'Running', 'Succeeded', + 'Failed' + :vartype state: str or ~azure.mgmt.datamigration.models.CommandState + :param command_type: Required. Constant filled by server. + :type command_type: str + :param input: Command input + :type input: ~azure.mgmt.datamigration.models.MongoDbCommandInput + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'command_type': {'required': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'command_type': {'key': 'commandType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbCommandInput'}, + } + + def __init__(self, **kwargs): + super(MongoDbRestartCommand, self).__init__(**kwargs) + self.input = kwargs.get('input', None) + self.command_type = 'restart' diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_restart_command_py3.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_restart_command_py3.py new file mode 100644 index 000000000000..4f61d3606e8e --- /dev/null +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/models/mongo_db_restart_command_py3.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 .command_properties_py3 import CommandProperties + + +class MongoDbRestartCommand(CommandProperties): + """Properties for the command that restarts a migration in whole or in part. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar errors: Array of errors. This is ignored if submitted. + :vartype errors: list[~azure.mgmt.datamigration.models.ODataError] + :ivar state: The state of the command. This is ignored if submitted. + Possible values include: 'Unknown', 'Accepted', 'Running', 'Succeeded', + 'Failed' + :vartype state: str or ~azure.mgmt.datamigration.models.CommandState + :param command_type: Required. Constant filled by server. + :type command_type: str + :param input: Command input + :type input: ~azure.mgmt.datamigration.models.MongoDbCommandInput + """ + + _validation = { + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'command_type': {'required': True}, + } + + _attribute_map = { + 'errors': {'key': 'errors', 'type': '[ODataError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'command_type': {'key': 'commandType', 'type': 'str'}, + 'input': {'key': 'input', 'type': 'MongoDbCommandInput'}, + } + + def __init__(self, *, input=None, **kwargs) -> None: + super(MongoDbRestartCommand, self).__init__(**kwargs) + self.input = input + self.command_type = 'restart' From 518631df78a9b28caf566399a5e096e801e577b2 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 5 Nov 2018 11:36:26 -0800 Subject: [PATCH 4/4] Datamigration 2.1.0 --- azure-mgmt-datamigration/HISTORY.rst | 9 +++++++++ .../azure/mgmt/datamigration/version.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/azure-mgmt-datamigration/HISTORY.rst b/azure-mgmt-datamigration/HISTORY.rst index 06ca9cf7f5ea..da20ba9cfd00 100644 --- a/azure-mgmt-datamigration/HISTORY.rst +++ b/azure-mgmt-datamigration/HISTORY.rst @@ -3,6 +3,15 @@ Release History =============== +2.1.0 (2018-11-05) +++++++++++++++++++ + +**Features** + +- Model MigrateSchemaSqlServerSqlDbDatabaseInput has a new parameter name +- Added operation group FilesOperations +- Add MongoDB support + 2.0.0 (2018-09-07) ++++++++++++++++++ diff --git a/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py b/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py index e0ec669828cb..be75d8eae586 100644 --- a/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py +++ b/azure-mgmt-datamigration/azure/mgmt/datamigration/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "2.1.0"