Skip to main content

migrations

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

Overview​

Namemigrations
TypeResource
Idazure.postgresql_flexible_servers.migrations

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringName of the migration to check for validity and availability. Required.
messagestringMigration name availability message.
nameAvailablebooleanIndicates if the migration name is available.
reasonstringMigration name availability reason. Known values are: "Invalid" and "AlreadyExists". (Invalid, AlreadyExists)
typestringType of resource. Required.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
check_name_availabilityselectresource_group_name, server_name, subscription_idCheck the validity and availability of the given name, to assign it to a new migration. Checks if a proposed migration name is valid and available.
getselectresource_group_name, server_name, migration_name, subscription_idGets information about a migration.
list_by_target_serverselectresource_group_name, server_name, subscription_idmigrationListFilterLists all migrations of a target flexible server.
createinsertresource_group_name, server_name, migration_name, subscription_id, locationCreates a new migration.
updateupdateresource_group_name, server_name, migration_name, subscription_idUpdates 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.
canceldeleteresource_group_name, server_name, migration_name, subscription_idCancels an active migration.

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 migration. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
server_namestringThe name of the server. Required.
subscription_idstring
migrationListFilterstringMigration list filter. Indicates if the request should retrieve only active migrations or all migrations. Defaults to Active. Known values are: "Active" and "All". Default value is None.

SELECT examples​

Check the validity and availability of the given name, to assign it to a new migration. Checks if a proposed migration name is valid and available.

SELECT
name,
message,
nameAvailable,
reason,
type
FROM azure.postgresql_flexible_servers.migrations
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples​

Creates a new migration.

INSERT INTO azure.postgresql_flexible_servers.migrations (
tags,
location,
properties,
resource_group_name,
server_name,
migration_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ resource_group_name }}',
'{{ server_name }}',
'{{ migration_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;

UPDATE examples​

Updates 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.

UPDATE azure.postgresql_flexible_servers.migrations
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND migration_name = '{{ migration_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

DELETE examples​

Cancels an active migration.

DELETE FROM azure.postgresql_flexible_servers.migrations
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND migration_name = '{{ migration_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;