Skip to main content

database_migrations_mongo_to_cosmos_db_ru_mongo

Creates, updates, deletes, gets or lists a database_migrations_mongo_to_cosmos_db_ru_mongo resource.

Overview

Namedatabase_migrations_mongo_to_cosmos_db_ru_mongo
TypeResource
Idazure.data_migration.database_migrations_mongo_to_cosmos_db_ru_mongo

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
collectionListarrayList of Mongo Collections to be migrated.
endedOnstring (date-time)Database migration end time.
kindstringRequired. MongoToCosmosDbMongo.
migrationFailureErrorobjectError details in case of migration failure.
migrationOperationIdstringID for current migration operation.
migrationServicestringResource Id of the Migration Service.
migrationStatusstringMigration status.
provisioningErrorstringError message for migration provisioning failure, if any.
provisioningStatestringProvisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and migration has started. Known values are: "Provisioning", "Updating", "Succeeded", "Failed", and "Canceled". (Provisioning, Updating, Succeeded, Failed, Canceled)
scopestringResource Id of the target resource.
sourceMongoConnectionobjectSource Mongo connection details.
startedOnstring (date-time)Database migration start time.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
targetMongoConnectionobjectTarget Cosmos DB Mongo connection details.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, target_resource_name, migration_name, subscription_idGet Database Migration resource.
get_for_scopeselectresource_group_name, target_resource_name, subscription_idGet Database Migration resources for the scope.
createinsertresource_group_name, target_resource_name, migration_name, subscription_idCreate or Update Database Migration resource.
deletedeleteresource_group_name, target_resource_name, migration_name, subscription_idforceDelete Database Migration resource.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
migration_namestringName of the migration. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
target_resource_namestringThe name of the target resource/account. Required.
forcebooleanOptional force delete boolean. If this is provided as true, migration will be deleted even if active. Default value is None.

SELECT examples

Get Database Migration resource.

SELECT
id,
name,
collectionList,
endedOn,
kind,
migrationFailureError,
migrationOperationId,
migrationService,
migrationStatus,
provisioningError,
provisioningState,
scope,
sourceMongoConnection,
startedOn,
systemData,
targetMongoConnection,
type
FROM azure.data_migration.database_migrations_mongo_to_cosmos_db_ru_mongo
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND target_resource_name = '{{ target_resource_name }}' -- required
AND migration_name = '{{ migration_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or Update Database Migration resource.

INSERT INTO azure.data_migration.database_migrations_mongo_to_cosmos_db_ru_mongo (
properties,
resource_group_name,
target_resource_name,
migration_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ target_resource_name }}',
'{{ migration_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

DELETE examples

Delete Database Migration resource.

DELETE FROM azure.data_migration.database_migrations_mongo_to_cosmos_db_ru_mongo
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND target_resource_name = '{{ target_resource_name }}' --required
AND migration_name = '{{ migration_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND force = '{{ force }}'
;