Gets information about a migration.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}?api-version=2024-08-01
URI Parameters
Name |
In |
Required |
Type |
Description |
migrationName
|
path |
True
|
string
pattern: ^[a-z][a-z0-9]*$
|
Name of migration.
|
resourceGroupName
|
path |
True
|
string
pattern: ^[-a-z0-9A-Z._()]+[^.]$
|
Name of resource group of target database server.
|
subscriptionId
|
path |
True
|
string
pattern: ([a-z0-9]){8,8}[-]([a-z0-9]){4,4}[-]([a-z0-9]){4,4}[-]([a-z0-9]){4,4}[-]([a-z0-9]){12,12}
|
Identifier of subscription of target database server.
|
targetDbServerName
|
path |
True
|
string
pattern: ([-a-z0-9]){3,63}
|
Name of target database server.
|
api-version
|
query |
True
|
string
minLength: 1
|
The API version to use for this operation.
|
Responses
Security
azure_auth
Microsoft Entra OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01
/**
* Samples for Migrations Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/
* Migrations_GetMigrationWithSuccessfulValidationAndMigration.json
*/
/**
* Sample code: Migrations_GetMigrationWithSuccessfulValidationAndMigration.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void migrationsGetMigrationWithSuccessfulValidationAndMigration(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.migrations().getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget",
"testmigrationwithsuccessfulvalidationandmigration", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python migrations_get_migration_with_successful_validation_and_migration.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.migrations.get(
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
resource_group_name="testrg",
target_db_server_name="testtarget",
migration_name="testmigrationwithsuccessfulvalidationandmigration",
)
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json
func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationAndMigration() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationandmigration", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{
// Name: to.Ptr("testmigrationwithsuccessfulvalidationandmigration"),
// Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationandmigration"),
// Location: to.Ptr("eastus"),
// Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{
// CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{
// CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{
// CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted),
// DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{
// "testdb3": &armpostgresqlflexibleservers.DbMigrationStatus{
// AppliedChanges: to.Ptr[int32](0),
// CdcDeleteCounter: to.Ptr[int32](0),
// CdcInsertCounter: to.Ptr[int32](0),
// CdcUpdateCounter: to.Ptr[int32](0),
// DatabaseName: to.Ptr("testdb3"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:49.681Z"); return t}()),
// FullLoadCompletedTables: to.Ptr[int32](10),
// FullLoadErroredTables: to.Ptr[int32](0),
// FullLoadLoadingTables: to.Ptr[int32](0),
// FullLoadQueuedTables: to.Ptr[int32](0),
// IncomingChanges: to.Ptr[int32](0),
// Latency: to.Ptr[int32](0),
// MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDbStateSucceeded),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:28.995Z"); return t}()),
// },
// },
// ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{
// DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{
// {
// DatabaseName: to.Ptr("testdb3"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:29.894Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:29.553Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("CollationsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// }},
// ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("AuthenticationAndConnectivityValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("SourceVersionValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ServerParametersValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:00.499Z"); return t}()),
// ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:28.077Z"); return t}()),
// },
// },
// State: to.Ptr(armpostgresqlflexibleservers.MigrationStateSucceeded),
// },
// DbsToMigrate: []*string{
// to.Ptr("testdb3")},
// MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse),
// MigrationID: to.Ptr("f2354e72-2828-4a19-ad20-b4cd9e2673c1"),
// MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline),
// MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate),
// MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:57:30.736Z"); return t}()),
// MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:15.999Z"); return t}()),
// OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue),
// SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue),
// SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"),
// TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"),
// TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets details of a migration.
*
* @summary Gets details of a migration.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json
*/
async function migrationsGetMigrationWithSuccessfulValidationAndMigration() {
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg";
const targetDbServerName = "testtarget";
const migrationName = "testmigrationwithsuccessfulvalidationandmigration";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential);
const result = await client.migrations.get(
subscriptionId,
resourceGroupName,
targetDbServerName,
migrationName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json
// this example is just showing the usage of "Migrations_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlMigrationResource created on azure
// for more information of creating PostgreSqlMigrationResource, please refer to the document of PostgreSqlMigrationResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testrg";
string targetDbServerName = "testtarget";
string migrationName = "testmigrationwithsuccessfulvalidationandmigration";
ResourceIdentifier postgreSqlMigrationResourceId = PostgreSqlMigrationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, targetDbServerName, migrationName);
PostgreSqlMigrationResource postgreSqlMigration = client.GetPostgreSqlMigrationResource(postgreSqlMigrationResourceId);
// invoke the operation
PostgreSqlMigrationResource result = await postgreSqlMigration.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlMigrationData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"migrationId": "f2354e72-2828-4a19-ad20-b4cd9e2673c1",
"currentStatus": {
"state": "Succeeded",
"currentSubStateDetails": {
"currentSubState": "Completed",
"dbDetails": {
"exampledatabase": {
"databaseName": "exampledatabase",
"migrationState": "Succeeded",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"fullLoadErroredTables": 0,
"fullLoadQueuedTables": 0,
"fullLoadLoadingTables": 0,
"fullLoadCompletedTables": 10,
"cdcUpdateCounter": 0,
"cdcDeleteCounter": 0,
"cdcInsertCounter": 0,
"appliedChanges": 0,
"incomingChanges": 0,
"latency": 0
}
},
"validationDetails": {
"status": "Succeeded",
"validationStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
"validationEndTimeInUtc": "2024-08-01T20:30:22.123456Z",
"serverLevelValidationDetails": [
{
"type": "AuthenticationAndConnectivityValidation",
"state": "Succeeded"
},
{
"type": "SourceVersionValidation",
"state": "Succeeded"
},
{
"type": "ServerParametersValidation",
"state": "Succeeded"
}
],
"dbLevelValidationDetails": [
{
"databaseName": "exampledatabase",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
},
{
"type": "CollationsValidation",
"state": "Succeeded"
}
]
}
]
}
}
},
"migrationMode": "Offline",
"migrationWindowEndTimeInUtc": "2024-08-01T20:30:22.123456Z",
"sourceDbServerResourceId": "20.228.214.65:5432@postgres",
"targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
"dbsToMigrate": [
"exampledatabase"
],
"setupLogicalReplicationOnSourceDbIfNeeded": "True",
"overwriteDbsInTarget": "True",
"migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
"triggerCutover": "True",
"migrateRoles": "False",
"migrationOption": "ValidateAndMigrate"
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
"name": "examplemigration",
"type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01
/**
* Samples for Migrations Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/
* Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json
*/
/**
* Sample code: Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void migrationsGetMigrationWithSuccessfulValidationButMigrationFailure(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.migrations().getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget",
"testmigrationwithsuccessfulvalidationbutmigrationfailure", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python migrations_get_migration_with_successful_validation_but_migration_failure.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.migrations.get(
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
resource_group_name="testrg",
target_db_server_name="testtarget",
migration_name="testmigrationwithsuccessfulvalidationbutmigrationfailure",
)
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json
func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationButMigrationFailure() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationbutmigrationfailure", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{
// Name: to.Ptr("testmigrationwithsuccessfulvalidationbutmigrationfailure"),
// Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationbutmigrationfailure"),
// Location: to.Ptr("eastus2"),
// Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{
// CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{
// CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{
// CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted),
// DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{
// "testdb6": &armpostgresqlflexibleservers.DbMigrationStatus{
// AppliedChanges: to.Ptr[int32](0),
// CdcDeleteCounter: to.Ptr[int32](0),
// CdcInsertCounter: to.Ptr[int32](0),
// CdcUpdateCounter: to.Ptr[int32](0),
// DatabaseName: to.Ptr("testdb6"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:09:53.252Z"); return t}()),
// FullLoadCompletedTables: to.Ptr[int32](0),
// FullLoadErroredTables: to.Ptr[int32](0),
// FullLoadLoadingTables: to.Ptr[int32](0),
// FullLoadQueuedTables: to.Ptr[int32](0),
// IncomingChanges: to.Ptr[int32](0),
// Latency: to.Ptr[int32](0),
// Message: to.Ptr("Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration."),
// MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDbStateFailed),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:09:52.922Z"); return t}()),
// },
// },
// ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{
// DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{
// {
// DatabaseName: to.Ptr("address_standardizer"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// }},
// ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("AuthenticationAndConnectivityValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()),
// ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:21.623Z"); return t}()),
// },
// },
// Error: to.Ptr("testdb6: Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration. "),
// State: to.Ptr(armpostgresqlflexibleservers.MigrationStateFailed),
// },
// DbsToMigrate: []*string{
// to.Ptr("testdb6")},
// MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse),
// MigrationID: to.Ptr("da52db29-cfeb-4670-a1ad-683edb14c621"),
// MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline),
// MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate),
// MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()),
// MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()),
// OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue),
// SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue),
// SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{
// Location: to.Ptr("eastus2"),
// SKU: &armpostgresqlflexibleservers.ServerSKU{
// },
// StorageMb: to.Ptr[int32](102400),
// },
// SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/source-rg/providers/Microsoft.DBforPostgreSQL/servers/testsource"),
// TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{
// Location: to.Ptr("East US 2"),
// SKU: &armpostgresqlflexibleservers.ServerSKU{
// Name: to.Ptr("Standard_D2ds_v4"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Standard_D2ds_v4")),
// },
// StorageMb: to.Ptr[int32](131072),
// },
// TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets details of a migration.
*
* @summary Gets details of a migration.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json
*/
async function migrationsGetMigrationWithSuccessfulValidationButMigrationFailure() {
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg";
const targetDbServerName = "testtarget";
const migrationName = "testmigrationwithsuccessfulvalidationbutmigrationfailure";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential);
const result = await client.migrations.get(
subscriptionId,
resourceGroupName,
targetDbServerName,
migrationName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json
// this example is just showing the usage of "Migrations_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlMigrationResource created on azure
// for more information of creating PostgreSqlMigrationResource, please refer to the document of PostgreSqlMigrationResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testrg";
string targetDbServerName = "testtarget";
string migrationName = "testmigrationwithsuccessfulvalidationbutmigrationfailure";
ResourceIdentifier postgreSqlMigrationResourceId = PostgreSqlMigrationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, targetDbServerName, migrationName);
PostgreSqlMigrationResource postgreSqlMigration = client.GetPostgreSqlMigrationResource(postgreSqlMigrationResourceId);
// invoke the operation
PostgreSqlMigrationResource result = await postgreSqlMigration.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlMigrationData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"migrationId": "da52db29-cfeb-4670-a1ad-683edb14c621",
"currentStatus": {
"state": "Failed",
"error": "exampledatabase: Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration.",
"currentSubStateDetails": {
"currentSubState": "Completed",
"dbDetails": {
"exampledatabase": {
"databaseName": "exampledatabase",
"migrationState": "Failed",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"fullLoadErroredTables": 0,
"fullLoadQueuedTables": 0,
"fullLoadLoadingTables": 0,
"fullLoadCompletedTables": 0,
"cdcUpdateCounter": 0,
"cdcDeleteCounter": 0,
"cdcInsertCounter": 0,
"appliedChanges": 0,
"incomingChanges": 0,
"latency": 0,
"message": "Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration."
}
},
"validationDetails": {
"status": "Succeeded",
"validationStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
"validationEndTimeInUtc": "2024-08-01T20:30:22.123456Z",
"serverLevelValidationDetails": [
{
"type": "AuthenticationAndConnectivityValidation",
"state": "Succeeded"
}
],
"dbLevelValidationDetails": [
{
"databaseName": "address_standardizer",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"summary": [
{
"type": "ExtensionsValidation",
"state": "Succeeded"
}
]
}
]
}
}
},
"migrationMode": "Offline",
"migrationWindowEndTimeInUtc": "2024-08-01T20:30:22.123456Z",
"sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/servers/examplesource",
"targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget",
"dbsToMigrate": [
"exampledatabase"
],
"setupLogicalReplicationOnSourceDbIfNeeded": "True",
"overwriteDbsInTarget": "True",
"migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
"sourceDbServerMetadata": {
"location": "westus",
"storageMb": 102400,
"sku": {}
},
"targetDbServerMetadata": {
"location": "westus",
"storageMb": 131072,
"sku": {
"name": "Standard_D2ds_v4",
"tier": "Standard_D2ds_v4"
}
},
"migrateRoles": "False",
"migrationOption": "ValidateAndMigrate"
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
"name": "examplemigration",
"type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01
/**
* Samples for Migrations Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/
* Migrations_GetMigrationWithSuccessfulValidationOnly.json
*/
/**
* Sample code: Migrations_GetMigrationWithSuccessfulValidationOnly.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void migrationsGetMigrationWithSuccessfulValidationOnly(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.migrations().getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget",
"testmigrationwithsuccessfulvalidationonly", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python migrations_get_migration_with_successful_validation_only.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.migrations.get(
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
resource_group_name="testrg",
target_db_server_name="testtarget",
migration_name="testmigrationwithsuccessfulvalidationonly",
)
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json
func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationOnly() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationonly", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{
// Name: to.Ptr("testmigrationwithsuccessfulvalidationonly"),
// Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationonly"),
// Location: to.Ptr("westus"),
// Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{
// CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{
// CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{
// CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted),
// DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{
// },
// ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{
// DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{
// {
// DatabaseName: to.Ptr("UnknownCollationTest"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:39.248Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:38.904Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("CollationsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// }},
// ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("AuthenticationAndConnectivityValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("SourceVersionValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ServerParametersValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:39.666Z"); return t}()),
// ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:35.634Z"); return t}()),
// },
// },
// State: to.Ptr(armpostgresqlflexibleservers.MigrationStateSucceeded),
// },
// DbsToMigrate: []*string{
// to.Ptr("UnknownCollationTest")},
// MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse),
// MigrationID: to.Ptr("77840327-7be8-44b8-adc0-af0ccccfeb36"),
// MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline),
// MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate),
// MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:30:05.885Z"); return t}()),
// MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:28:58.775Z"); return t}()),
// OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue),
// SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue),
// SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"),
// TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"),
// TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets details of a migration.
*
* @summary Gets details of a migration.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json
*/
async function migrationsGetMigrationWithSuccessfulValidationOnly() {
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg";
const targetDbServerName = "testtarget";
const migrationName = "testmigrationwithsuccessfulvalidationonly";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential);
const result = await client.migrations.get(
subscriptionId,
resourceGroupName,
targetDbServerName,
migrationName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json
// this example is just showing the usage of "Migrations_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlMigrationResource created on azure
// for more information of creating PostgreSqlMigrationResource, please refer to the document of PostgreSqlMigrationResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testrg";
string targetDbServerName = "testtarget";
string migrationName = "testmigrationwithsuccessfulvalidationonly";
ResourceIdentifier postgreSqlMigrationResourceId = PostgreSqlMigrationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, targetDbServerName, migrationName);
PostgreSqlMigrationResource postgreSqlMigration = client.GetPostgreSqlMigrationResource(postgreSqlMigrationResourceId);
// invoke the operation
PostgreSqlMigrationResource result = await postgreSqlMigration.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlMigrationData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"migrationId": "77840327-7be8-44b8-adc0-af0ccccfeb36",
"currentStatus": {
"state": "Succeeded",
"currentSubStateDetails": {
"currentSubState": "Completed",
"dbDetails": {},
"validationDetails": {
"status": "Succeeded",
"validationStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
"validationEndTimeInUtc": "2024-08-01T20:30:22.123456Z",
"serverLevelValidationDetails": [
{
"type": "AuthenticationAndConnectivityValidation",
"state": "Succeeded"
},
{
"type": "SourceVersionValidation",
"state": "Succeeded"
},
{
"type": "ServerParametersValidation",
"state": "Succeeded"
}
],
"dbLevelValidationDetails": [
{
"databaseName": "UnknownCollationTest",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
},
{
"type": "CollationsValidation",
"state": "Succeeded"
}
]
}
]
}
}
},
"migrationMode": "Offline",
"migrationWindowEndTimeInUtc": "2024-08-01T20:30:22.123456Z",
"sourceDbServerResourceId": "20.228.214.65:5432@postgres",
"targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
"dbsToMigrate": [
"UnknownCollationTest"
],
"setupLogicalReplicationOnSourceDbIfNeeded": "True",
"overwriteDbsInTarget": "True",
"migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
"triggerCutover": "True",
"migrateRoles": "False",
"migrationOption": "Validate"
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
"name": "examplemigration",
"type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01
/**
* Samples for Migrations Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/
* Migrations_GetMigrationWithValidationFailures.json
*/
/**
* Sample code: Migrations_GetMigrationWithValidationFailures.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void migrationsGetMigrationWithValidationFailures(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.migrations().getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget",
"testmigrationwithvalidationfailure", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python migrations_get_migration_with_validation_failures.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.migrations.get(
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
resource_group_name="testrg",
target_db_server_name="testtarget",
migration_name="testmigrationwithvalidationfailure",
)
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithValidationFailures.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithValidationFailures.json
func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithvalidationfailure", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{
// Name: to.Ptr("testmigrationwithvalidationfailure"),
// Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget/migrations/testmigrationwithvalidationfailure"),
// Location: to.Ptr("East US"),
// Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{
// CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{
// CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{
// CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted),
// DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{
// },
// ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{
// DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{
// {
// DatabaseName: to.Ptr("c.utf-8"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// Messages: []*armpostgresqlflexibleservers.ValidationMessage{
// {
// Message: to.Ptr("Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed),
// }},
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed),
// },
// {
// Type: to.Ptr("CollationsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("postgres"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("CollationsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("readme_to_recover"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("CollationsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("testdb1"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("testdb2"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("testSchema"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("UnknownCollationTest"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// Messages: []*armpostgresqlflexibleservers.ValidationMessage{
// {
// Message: to.Ptr("Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed),
// }},
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed),
// }},
// }},
// ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("AuthenticationAndConnectivityValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("SourceVersionValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ServerParametersValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed),
// ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:33.136Z"); return t}()),
// ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:19:59.917Z"); return t}()),
// },
// },
// State: to.Ptr(armpostgresqlflexibleservers.MigrationStateValidationFailed),
// },
// DbsToMigrate: []*string{
// to.Ptr("c.utf-8"),
// to.Ptr("postgres"),
// to.Ptr("readme_to_recover"),
// to.Ptr("testdb1"),
// to.Ptr("testdb2"),
// to.Ptr("testSchema"),
// to.Ptr("UnknownCollationTest")},
// MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse),
// MigrationID: to.Ptr("a3e2d3cc-b139-4201-9431-e4f3003140fd"),
// MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline),
// MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate),
// MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:21:00.043Z"); return t}()),
// MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:19:47.448Z"); return t}()),
// OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue),
// SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue),
// SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"),
// TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget"),
// TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets details of a migration.
*
* @summary Gets details of a migration.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithValidationFailures.json
*/
async function migrationsGetMigrationWithValidationFailures() {
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg";
const targetDbServerName = "testtarget";
const migrationName = "testmigrationwithvalidationfailure";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential);
const result = await client.migrations.get(
subscriptionId,
resourceGroupName,
targetDbServerName,
migrationName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_GetMigrationWithValidationFailures.json
// this example is just showing the usage of "Migrations_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlMigrationResource created on azure
// for more information of creating PostgreSqlMigrationResource, please refer to the document of PostgreSqlMigrationResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testrg";
string targetDbServerName = "testtarget";
string migrationName = "testmigrationwithvalidationfailure";
ResourceIdentifier postgreSqlMigrationResourceId = PostgreSqlMigrationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, targetDbServerName, migrationName);
PostgreSqlMigrationResource postgreSqlMigration = client.GetPostgreSqlMigrationResource(postgreSqlMigrationResourceId);
// invoke the operation
PostgreSqlMigrationResource result = await postgreSqlMigration.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlMigrationData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"migrationId": "a3e2d3cc-b139-4201-9431-e4f3003140fd",
"currentStatus": {
"state": "ValidationFailed",
"currentSubStateDetails": {
"currentSubState": "Completed",
"dbDetails": {},
"validationDetails": {
"status": "Failed",
"validationStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
"validationEndTimeInUtc": "2024-08-01T20:30:22.123456Z",
"serverLevelValidationDetails": [
{
"type": "AuthenticationAndConnectivityValidation",
"state": "Succeeded"
},
{
"type": "SourceVersionValidation",
"state": "Succeeded"
},
{
"type": "ServerParametersValidation",
"state": "Succeeded"
}
],
"dbLevelValidationDetails": [
{
"databaseName": "exampledatabase1",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Failed",
"messages": [
{
"state": "Failed",
"message": "Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"
}
]
},
{
"type": "CollationsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase2",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
},
{
"type": "CollationsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase3",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
},
{
"type": "CollationsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase4",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase5",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase6",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase7",
"startedOn": "2024-08-01T18:30:22.123456Z",
"endedOn": "2024-08-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Failed",
"messages": [
{
"state": "Failed",
"message": "Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"
}
]
}
]
}
]
}
}
},
"migrationMode": "Offline",
"migrationWindowEndTimeInUtc": "2024-08-01T20:30:22.123456Z",
"sourceDbServerResourceId": "20.228.214.65:5432@postgres",
"targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget",
"dbsToMigrate": [
"exampledatabase1",
"exampledatabase2",
"exampledatabase3",
"exampledatabase4",
"exampledatabase5",
"exampledatabase6",
"exampledatabase7"
],
"setupLogicalReplicationOnSourceDbIfNeeded": "True",
"overwriteDbsInTarget": "True",
"migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
"triggerCutover": "True",
"migrateRoles": "False",
"migrationOption": "Validate"
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration",
"name": "examplemigration",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/migrations"
}
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01
/**
* Samples for Migrations Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get.
* json
*/
/**
* Sample code: Migrations_Get.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void migrationsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.migrations().getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget",
"testmigration", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python migrations_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.migrations.get(
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
resource_group_name="testrg",
target_db_server_name="testtarget",
migration_name="testmigration",
)
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get.json
func ExampleMigrationsClient_Get_migrationsGet() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{
// Name: to.Ptr("testmigration"),
// Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"),
// Location: to.Ptr("westus"),
// Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{
// CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{
// CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{
// CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps),
// },
// Error: to.Ptr(""),
// State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress),
// },
// DbsToMigrate: []*string{
// to.Ptr("db1"),
// to.Ptr("db2"),
// to.Ptr("db3"),
// to.Ptr("db4")},
// MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse),
// MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"),
// MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()),
// OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse),
// SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse),
// SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{
// Location: to.Ptr("westus"),
// SKU: &armpostgresqlflexibleservers.ServerSKU{
// Name: to.Ptr("B_Gen5_2"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")),
// },
// StorageMb: to.Ptr[int32](1024),
// Version: to.Ptr("10"),
// },
// SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"),
// StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse),
// TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{
// Location: to.Ptr("westus"),
// SKU: &armpostgresqlflexibleservers.ServerSKU{
// Name: to.Ptr("Standard_D4s_v3"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose),
// },
// StorageMb: to.Ptr[int32](2048),
// Version: to.Ptr("11"),
// },
// TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"),
// TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets details of a migration.
*
* @summary Gets details of a migration.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get.json
*/
async function migrationsGet() {
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg";
const targetDbServerName = "testtarget";
const migrationName = "testmigration";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential);
const result = await client.migrations.get(
subscriptionId,
resourceGroupName,
targetDbServerName,
migrationName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get.json
// this example is just showing the usage of "Migrations_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlMigrationResource created on azure
// for more information of creating PostgreSqlMigrationResource, please refer to the document of PostgreSqlMigrationResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testrg";
string targetDbServerName = "testtarget";
string migrationName = "testmigration";
ResourceIdentifier postgreSqlMigrationResourceId = PostgreSqlMigrationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, targetDbServerName, migrationName);
PostgreSqlMigrationResource postgreSqlMigration = client.GetPostgreSqlMigrationResource(postgreSqlMigrationResourceId);
// invoke the operation
PostgreSqlMigrationResource result = await postgreSqlMigration.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlMigrationData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
"currentStatus": {
"state": "InProgress",
"error": "",
"currentSubStateDetails": {
"currentSubState": "PerformingPreRequisiteSteps"
}
},
"sourceDbServerMetadata": {
"location": "westus",
"version": "10",
"storageMb": 1024,
"sku": {
"name": "B_Gen5_2",
"tier": "Basic"
}
},
"targetDbServerMetadata": {
"location": "westus",
"version": "16",
"storageMb": 2048,
"sku": {
"tier": "GeneralPurpose",
"name": "Standard_D4ds_v5"
}
},
"sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
"targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
"dbsToMigrate": [
"exampledatabase1",
"exampledatabase2",
"exampledatabase3",
"exampledatabase4"
],
"setupLogicalReplicationOnSourceDbIfNeeded": "False",
"overwriteDbsInTarget": "False",
"migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
"startDataMigration": "False",
"triggerCutover": "False",
"migrateRoles": "False"
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
"name": "examplemigration",
"type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
Definitions
Name |
Description |
AdminCredentials
|
Credentials of administrator users for source and target servers.
|
CancelEnum
|
Indicates if cancel must be triggered for the entire migration.
|
createdByType
|
The type of identity that created the resource.
|
DbLevelValidationStatus
|
Validation status summary for a database.
|
DbMigrationStatus
|
Migration status of a database.
|
DbServerMetadata
|
Database server metadata.
|
ErrorAdditionalInfo
|
The resource management error additional info.
|
ErrorDetail
|
The error detail.
|
ErrorResponse
|
Error response
|
LogicalReplicationOnSourceDbEnum
|
Indicates whether to setup LogicalReplicationOnSourceDb, if needed.
|
MigrateRolesEnum
|
Indicates if roles and permissions must be migrated.
|
MigrationDbState
|
Migration state of a database.
|
MigrationMode
|
Mode used to perform the migration: Online or Offline.
|
MigrationOption
|
Supported option for a migration
|
MigrationResource
|
Migration.
|
MigrationSecretParameters
|
Migration secret parameters.
|
MigrationState
|
State of migration.
|
MigrationStatus
|
State of migration.
|
MigrationSubState
|
Substate of migration.
|
MigrationSubStateDetails
|
Details of migration substate.
|
OverwriteDbsInTargetEnum
|
Indicates if databases on the target server can be overwritten when already present. If set to 'False', when the migration workflow detects that the database already exists on the target server, it will wait for a confirmation.
|
ServerSku
|
Compute information of a flexible server.
|
SkuTier
|
This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.
|
SourceType
|
Source server type used for the migration: ApsaraDB_RDS, AWS, AWS_AURORA, AWS_EC2, AWS_RDS, AzureVM, Crunchy_PostgreSQL, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, EDB, EDB_Oracle_Server, EDB_PostgreSQL, GCP, GCP_AlloyDB, GCP_CloudSQL, GCP_Compute, Heroku_PostgreSQL, Huawei_Compute, Huawei_RDS, OnPremises, PostgreSQLCosmosDB, PostgreSQLFlexibleServer, PostgreSQLSingleServer, or Supabase_PostgreSQL
|
SslMode
|
SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other source types is 'Prefer'.
|
StartDataMigrationEnum
|
Indicates if data migration must start right away.
|
systemData
|
Metadata pertaining to creation and last modification of the resource.
|
TriggerCutoverEnum
|
Indicates if cutover must be triggered for the entire migration.
|
ValidationDetails
|
Details for the validation for migration.
|
ValidationMessage
|
Validation message object.
|
ValidationState
|
Validation status for migration.
|
ValidationSummaryItem
|
Validation summary object.
|
AdminCredentials
Object
Credentials of administrator users for source and target servers.
Name |
Type |
Description |
sourceServerPassword
|
string
|
Password for the user of the source server.
|
targetServerPassword
|
string
|
Password for the user of the target server.
|
CancelEnum
Enumeration
Indicates if cancel must be triggered for the entire migration.
Value |
Description |
False
|
|
True
|
|
createdByType
Enumeration
The type of identity that created the resource.
Value |
Description |
Application
|
|
Key
|
|
ManagedIdentity
|
|
User
|
|
DbLevelValidationStatus
Object
Validation status summary for a database.
Name |
Type |
Description |
databaseName
|
string
|
Name of database.
|
endedOn
|
string
(date-time)
|
End time of a database level validation.
|
startedOn
|
string
(date-time)
|
Start time of a database level validation.
|
summary
|
ValidationSummaryItem[]
|
Summary of database level validations.
|
DbMigrationStatus
Object
Migration status of a database.
Name |
Type |
Description |
appliedChanges
|
integer
(int32)
|
Change Data Capture applied changes counter.
|
cdcDeleteCounter
|
integer
(int32)
|
Change Data Capture delete counter.
|
cdcInsertCounter
|
integer
(int32)
|
Change Data Capture insert counter.
|
cdcUpdateCounter
|
integer
(int32)
|
Change Data Capture update counter.
|
databaseName
|
string
|
Name of database.
|
endedOn
|
string
(date-time)
|
End time of a migration state.
|
fullLoadCompletedTables
|
integer
(int32)
|
Number of tables loaded during the migration of a database.
|
fullLoadErroredTables
|
integer
(int32)
|
Number of tables encountering errors during the migration of a database.
|
fullLoadLoadingTables
|
integer
(int32)
|
Number of tables loading during the migration of a database.
|
fullLoadQueuedTables
|
integer
(int32)
|
Number of tables queued for the migration of a database.
|
incomingChanges
|
integer
(int32)
|
Change Data Capture incoming changes counter.
|
latency
|
integer
(int32)
|
Lag in seconds between source and target during online phase.
|
message
|
string
|
Error message, if any, for the migration state.
|
migrationOperation
|
string
|
Migration operation of a database.
|
migrationState
|
MigrationDbState
|
Migration state of a database.
|
startedOn
|
string
(date-time)
|
Start time of a migration state.
|
Object
Database server metadata.
Name |
Type |
Description |
location
|
string
|
Location of database server.
|
sku
|
ServerSku
|
Compute tier and size of the database server. This object is empty for an Azure Database for PostgreSQL single server.
|
storageMb
|
integer
(int32)
|
Storage size (in MB) for database server.
|
version
|
string
|
Major version of PostgreSQL database engine.
|
ErrorAdditionalInfo
Object
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|
ErrorDetail
Object
The error detail.
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
code
|
string
|
The error code.
|
details
|
ErrorDetail[]
|
The error details.
|
message
|
string
|
The error message.
|
target
|
string
|
The error target.
|
ErrorResponse
Object
Error response
Name |
Type |
Description |
error
|
ErrorDetail
|
The error object.
|
LogicalReplicationOnSourceDbEnum
Enumeration
Indicates whether to setup LogicalReplicationOnSourceDb, if needed.
Value |
Description |
False
|
|
True
|
|
MigrateRolesEnum
Enumeration
Indicates if roles and permissions must be migrated.
Value |
Description |
False
|
|
True
|
|
MigrationDbState
Enumeration
Migration state of a database.
Value |
Description |
Canceled
|
|
Canceling
|
|
Failed
|
|
InProgress
|
|
Succeeded
|
|
WaitingForCutoverTrigger
|
|
MigrationMode
Enumeration
Mode used to perform the migration: Online or Offline.
Value |
Description |
Offline
|
|
Online
|
|
MigrationOption
Enumeration
Supported option for a migration
Value |
Description |
Migrate
|
|
Validate
|
|
ValidateAndMigrate
|
|
MigrationResource
Object
Migration.
Name |
Type |
Description |
id
|
string
(arm-id)
|
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
location
|
string
|
The geo-location where the resource lives
|
name
|
string
|
The name of the resource
|
properties.cancel
|
CancelEnum
|
Indicates if cancel must be triggered for the entire migration.
|
properties.currentStatus
|
MigrationStatus
|
Current status of a migration.
|
properties.dbsToCancelMigrationOn
|
string[]
|
When you want to trigger cancel for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array.
|
properties.dbsToMigrate
|
string[]
|
Names of databases to migrate.
|
properties.dbsToTriggerCutoverOn
|
string[]
|
When you want to trigger cutover for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array.
|
properties.migrateRoles
|
MigrateRolesEnum
|
Indicates if roles and permissions must be migrated.
|
properties.migrationId
|
string
|
Identifier of a migration.
|
properties.migrationInstanceResourceId
|
string
(arm-id)
|
Identifier of the private endpoint migration instance.
|
properties.migrationMode
|
MigrationMode
|
Mode used to perform the migration: Online or Offline.
|
properties.migrationOption
|
MigrationOption
|
Supported option for a migration.
|
properties.migrationWindowEndTimeInUtc
|
string
(date-time)
|
End time (UTC) for migration window.
|
properties.migrationWindowStartTimeInUtc
|
string
(date-time)
|
Start time (UTC) for migration window.
|
properties.overwriteDbsInTarget
|
OverwriteDbsInTargetEnum
|
Indicates if databases on the target server can be overwritten when already present. If set to 'False', when the migration workflow detects that the database already exists on the target server, it will wait for a confirmation.
|
properties.secretParameters
|
MigrationSecretParameters
|
Migration secret parameters.
|
properties.setupLogicalReplicationOnSourceDbIfNeeded
|
LogicalReplicationOnSourceDbEnum
|
Indicates whether to setup LogicalReplicationOnSourceDb, if needed.
|
properties.sourceDbServerFullyQualifiedDomainName
|
string
|
Fully qualified domain name (FQDN) or IP address of the source server. This property is optional. When provided, the migration service will always use it to connect to the source server.
|
properties.sourceDbServerMetadata
|
DbServerMetadata
|
Metadata of source database server.
|
properties.sourceDbServerResourceId
|
string
|
Identifier of the source database server resource, when 'sourceType' is 'PostgreSQLSingleServer'. For other source types this must be set to ipaddress:port@username or hostname:port@username.
|
properties.sourceType
|
SourceType
|
Source server type used for the migration: ApsaraDB_RDS, AWS, AWS_AURORA, AWS_EC2, AWS_RDS, AzureVM, Crunchy_PostgreSQL, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, EDB, EDB_Oracle_Server, EDB_PostgreSQL, GCP, GCP_AlloyDB, GCP_CloudSQL, GCP_Compute, Heroku_PostgreSQL, Huawei_Compute, Huawei_RDS, OnPremises, PostgreSQLCosmosDB, PostgreSQLFlexibleServer, PostgreSQLSingleServer, or Supabase_PostgreSQL
|
properties.sslMode
|
SslMode
|
SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other source types is 'Prefer'.
|
properties.startDataMigration
|
StartDataMigrationEnum
|
Indicates if data migration must start right away.
|
properties.targetDbServerFullyQualifiedDomainName
|
string
|
Fully qualified domain name (FQDN) or IP address of the target server. This property is optional. When provided, the migration service will always use it to connect to the target server.
|
properties.targetDbServerMetadata
|
DbServerMetadata
|
Metadata of target database server.
|
properties.targetDbServerResourceId
|
string
|
Identifier of the target database server resource.
|
properties.triggerCutover
|
TriggerCutoverEnum
|
Indicates if cutover must be triggered for the entire migration.
|
systemData
|
systemData
|
Azure Resource Manager metadata containing createdBy and modifiedBy information.
|
tags
|
object
|
Resource tags.
|
type
|
string
|
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
MigrationSecretParameters
Object
Migration secret parameters.
Name |
Type |
Description |
adminCredentials
|
AdminCredentials
|
Credentials of administrator users for source and target servers.
|
sourceServerUsername
|
string
|
Gets or sets the name of the user for the source server. This user doesn't need to be an administrator.
|
targetServerUsername
|
string
|
Gets or sets the name of the user for the target server. This user doesn't need to be an administrator.
|
MigrationState
Enumeration
State of migration.
Value |
Description |
Canceled
|
|
CleaningUp
|
|
Failed
|
|
InProgress
|
|
Succeeded
|
|
ValidationFailed
|
|
WaitingForUserAction
|
|
MigrationStatus
Object
State of migration.
Name |
Type |
Description |
currentSubStateDetails
|
MigrationSubStateDetails
|
Current migration sub state details.
|
error
|
string
|
Error message, if any, for the migration state.
|
state
|
MigrationState
|
State of migration.
|
MigrationSubState
Enumeration
Substate of migration.
Value |
Description |
CancelingRequestedDBMigrations
|
|
Completed
|
|
CompletingMigration
|
|
MigratingData
|
|
PerformingPreRequisiteSteps
|
|
ValidationInProgress
|
|
WaitingForCutoverTrigger
|
|
WaitingForDBsToMigrateSpecification
|
|
WaitingForDataMigrationScheduling
|
|
WaitingForDataMigrationWindow
|
|
WaitingForLogicalReplicationSetupRequestOnSourceDB
|
|
WaitingForTargetDBOverwriteConfirmation
|
|
MigrationSubStateDetails
Object
Details of migration substate.
OverwriteDbsInTargetEnum
Enumeration
Indicates if databases on the target server can be overwritten when already present. If set to 'False', when the migration workflow detects that the database already exists on the target server, it will wait for a confirmation.
Value |
Description |
False
|
|
True
|
|
ServerSku
Object
Compute information of a flexible server.
Name |
Type |
Description |
name
|
string
|
Compute tier and size of the database server. This object is empty for an Azure Database for PostgreSQL single server.
|
tier
|
SkuTier
|
Tier of the compute assigned to a flexible server.
|
SkuTier
Enumeration
This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.
Value |
Description |
Basic
|
|
Free
|
|
Premium
|
|
Standard
|
|
SourceType
Enumeration
Source server type used for the migration: ApsaraDB_RDS, AWS, AWS_AURORA, AWS_EC2, AWS_RDS, AzureVM, Crunchy_PostgreSQL, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, EDB, EDB_Oracle_Server, EDB_PostgreSQL, GCP, GCP_AlloyDB, GCP_CloudSQL, GCP_Compute, Heroku_PostgreSQL, Huawei_Compute, Huawei_RDS, OnPremises, PostgreSQLCosmosDB, PostgreSQLFlexibleServer, PostgreSQLSingleServer, or Supabase_PostgreSQL
Value |
Description |
AWS
|
|
AWS_AURORA
|
|
AWS_EC2
|
|
AWS_RDS
|
|
AzureVM
|
|
EDB
|
|
GCP
|
|
GCP_AlloyDB
|
|
GCP_CloudSQL
|
|
GCP_Compute
|
|
OnPremises
|
|
PostgreSQLSingleServer
|
|
SslMode
Enumeration
SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other source types is 'Prefer'.
Value |
Description |
Prefer
|
|
Require
|
|
VerifyCA
|
|
VerifyFull
|
|
StartDataMigrationEnum
Enumeration
Indicates if data migration must start right away.
Value |
Description |
False
|
|
True
|
|
systemData
Object
Metadata pertaining to creation and last modification of the resource.
Name |
Type |
Description |
createdAt
|
string
(date-time)
|
The timestamp of resource creation (UTC).
|
createdBy
|
string
|
The identity that created the resource.
|
createdByType
|
createdByType
|
The type of identity that created the resource.
|
lastModifiedAt
|
string
(date-time)
|
The timestamp of resource last modification (UTC)
|
lastModifiedBy
|
string
|
The identity that last modified the resource.
|
lastModifiedByType
|
createdByType
|
The type of identity that last modified the resource.
|
TriggerCutoverEnum
Enumeration
Indicates if cutover must be triggered for the entire migration.
Value |
Description |
False
|
|
True
|
|
ValidationDetails
Object
Details for the validation for migration.
Name |
Type |
Description |
dbLevelValidationDetails
|
DbLevelValidationStatus[]
|
Details of server level validations.
|
serverLevelValidationDetails
|
ValidationSummaryItem[]
|
Details of server level validations.
|
status
|
ValidationState
|
Validation status for migration.
|
validationEndTimeInUtc
|
string
(date-time)
|
End time (UTC) for validation.
|
validationStartTimeInUtc
|
string
(date-time)
|
Start time (UTC) for validation.
|
ValidationMessage
Object
Validation message object.
Name |
Type |
Description |
message
|
string
|
Validation message string.
|
state
|
ValidationState
|
Severity of validation message.
|
ValidationState
Enumeration
Validation status for migration.
Value |
Description |
Failed
|
|
Succeeded
|
|
Warning
|
|
ValidationSummaryItem
Object
Validation summary object.