Skip to main content

migrations

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

Overview

Namemigrations
TypeResource
Idazure.postgresql.migrations

Fields

NameDatatypeDescription
canceltextfield from the properties object
current_statustextfield from the properties object
dbs_to_cancel_migration_ontextfield from the properties object
dbs_to_migratetextfield from the properties object
dbs_to_trigger_cutover_ontextfield from the properties object
locationtextThe geo-location where the resource lives
migrate_rolestextfield from the properties object
migrationNametextfield from the properties object
migration_idtextfield from the properties object
migration_instance_resource_idtextfield from the properties object
migration_modetextfield from the properties object
migration_optiontextfield from the properties object
migration_window_end_time_in_utctextfield from the properties object
migration_window_start_time_in_utctextfield from the properties object
overwrite_dbs_in_targettextfield from the properties object
resourceGroupNametextfield from the properties object
secret_parameterstextfield from the properties object
setup_logical_replication_on_source_db_if_neededtextfield from the properties object
source_db_server_fully_qualified_domain_nametextfield from the properties object
source_db_server_metadatatextfield from the properties object
source_db_server_resource_idtextfield from the properties object
source_typetextfield from the properties object
ssl_modetextfield from the properties object
start_data_migrationtextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.
targetDbServerNametextfield from the properties object
target_db_server_fully_qualified_domain_nametextfield from the properties object
target_db_server_metadatatextfield from the properties object
target_db_server_resource_idtextfield from the properties object
trigger_cutovertextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTmigrationName, resourceGroupName, subscriptionId, targetDbServerNameGets details of a migration.
list_by_target_serverSELECTresourceGroupName, subscriptionId, targetDbServerNameList all the migrations on a given target server.
createINSERTmigrationName, resourceGroupName, subscriptionId, targetDbServerNameCreates a new migration.
deleteDELETEmigrationName, resourceGroupName, subscriptionId, targetDbServerNameDeletes a migration.
updateUPDATEmigrationName, resourceGroupName, subscriptionId, targetDbServerNameUpdates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions.

SELECT examples

List all the migrations on a given target server.

SELECT
cancel,
current_status,
dbs_to_cancel_migration_on,
dbs_to_migrate,
dbs_to_trigger_cutover_on,
location,
migrate_roles,
migrationName,
migration_id,
migration_instance_resource_id,
migration_mode,
migration_option,
migration_window_end_time_in_utc,
migration_window_start_time_in_utc,
overwrite_dbs_in_target,
resourceGroupName,
secret_parameters,
setup_logical_replication_on_source_db_if_needed,
source_db_server_fully_qualified_domain_name,
source_db_server_metadata,
source_db_server_resource_id,
source_type,
ssl_mode,
start_data_migration,
subscriptionId,
tags,
targetDbServerName,
target_db_server_fully_qualified_domain_name,
target_db_server_metadata,
target_db_server_resource_id,
trigger_cutover
FROM azure.postgresql.vw_migrations
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND targetDbServerName = '{{ targetDbServerName }}';

INSERT example

Use the following StackQL query and manifest file to create a new migrations resource.

/*+ create */
INSERT INTO azure.postgresql.migrations (
migrationName,
resourceGroupName,
subscriptionId,
targetDbServerName,
properties,
tags,
location
)
SELECT
'{{ migrationName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ targetDbServerName }}',
'{{ properties }}',
'{{ tags }}',
'{{ location }}'
;

UPDATE example

Updates a migrations resource.

/*+ update */
UPDATE azure.postgresql.migrations
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
migrationName = '{{ migrationName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND targetDbServerName = '{{ targetDbServerName }}';

DELETE example

Deletes the specified migrations resource.

/*+ delete */
DELETE FROM azure.postgresql.migrations
WHERE migrationName = '{{ migrationName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND targetDbServerName = '{{ targetDbServerName }}';