Class MigrationProperties

java.lang.Object
com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationProperties
All Implemented Interfaces:
com.azure.json.JsonSerializable<MigrationProperties>

public final class MigrationProperties extends Object implements com.azure.json.JsonSerializable<MigrationProperties>
Migration.
  • Constructor Details

    • MigrationProperties

      public MigrationProperties()
      Creates an instance of MigrationProperties class.
  • Method Details

    • migrationId

      public String migrationId()
      Get the migrationId property: Identifier of a migration.
      Returns:
      the migrationId value.
    • currentStatus

      public MigrationStatus currentStatus()
      Get the currentStatus property: Current status of a migration.
      Returns:
      the currentStatus value.
    • migrationInstanceResourceId

      public String migrationInstanceResourceId()
      Get the migrationInstanceResourceId property: Identifier of the private endpoint migration instance.
      Returns:
      the migrationInstanceResourceId value.
    • withMigrationInstanceResourceId

      public MigrationProperties withMigrationInstanceResourceId(String migrationInstanceResourceId)
      Set the migrationInstanceResourceId property: Identifier of the private endpoint migration instance.
      Parameters:
      migrationInstanceResourceId - the migrationInstanceResourceId value to set.
      Returns:
      the MigrationProperties object itself.
    • migrationMode

      public MigrationMode migrationMode()
      Get the migrationMode property: Mode used to perform the migration: Online or Offline.
      Returns:
      the migrationMode value.
    • withMigrationMode

      public MigrationProperties withMigrationMode(MigrationMode migrationMode)
      Set the migrationMode property: Mode used to perform the migration: Online or Offline.
      Parameters:
      migrationMode - the migrationMode value to set.
      Returns:
      the MigrationProperties object itself.
    • migrationOption

      public MigrationOption migrationOption()
      Get the migrationOption property: Supported option for a migration.
      Returns:
      the migrationOption value.
    • withMigrationOption

      public MigrationProperties withMigrationOption(MigrationOption migrationOption)
      Set the migrationOption property: Supported option for a migration.
      Parameters:
      migrationOption - the migrationOption value to set.
      Returns:
      the MigrationProperties object itself.
    • sourceType

      public SourceType sourceType()
      Get the sourceType property: 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.
      Returns:
      the sourceType value.
    • withSourceType

      public MigrationProperties withSourceType(SourceType sourceType)
      Set the sourceType property: 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.
      Parameters:
      sourceType - the sourceType value to set.
      Returns:
      the MigrationProperties object itself.
    • sslMode

      public SslMode sslMode()
      Get the sslMode property: SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other source types is 'Prefer'.
      Returns:
      the sslMode value.
    • withSslMode

      public MigrationProperties withSslMode(SslMode sslMode)
      Set the sslMode property: SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other source types is 'Prefer'.
      Parameters:
      sslMode - the sslMode value to set.
      Returns:
      the MigrationProperties object itself.
    • sourceDbServerMetadata

      public DbServerMetadata sourceDbServerMetadata()
      Get the sourceDbServerMetadata property: Metadata of source database server.
      Returns:
      the sourceDbServerMetadata value.
    • targetDbServerMetadata

      public DbServerMetadata targetDbServerMetadata()
      Get the targetDbServerMetadata property: Metadata of target database server.
      Returns:
      the targetDbServerMetadata value.
    • sourceDbServerResourceId

      public String sourceDbServerResourceId()
      Get the sourceDbServerResourceId property: 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.
      Returns:
      the sourceDbServerResourceId value.
    • withSourceDbServerResourceId

      public MigrationProperties withSourceDbServerResourceId(String sourceDbServerResourceId)
      Set the sourceDbServerResourceId property: 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.
      Parameters:
      sourceDbServerResourceId - the sourceDbServerResourceId value to set.
      Returns:
      the MigrationProperties object itself.
    • sourceDbServerFullyQualifiedDomainName

      public String sourceDbServerFullyQualifiedDomainName()
      Get the sourceDbServerFullyQualifiedDomainName property: 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.
      Returns:
      the sourceDbServerFullyQualifiedDomainName value.
    • withSourceDbServerFullyQualifiedDomainName

      public MigrationProperties withSourceDbServerFullyQualifiedDomainName(String sourceDbServerFullyQualifiedDomainName)
      Set the sourceDbServerFullyQualifiedDomainName property: 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.
      Parameters:
      sourceDbServerFullyQualifiedDomainName - the sourceDbServerFullyQualifiedDomainName value to set.
      Returns:
      the MigrationProperties object itself.
    • targetDbServerResourceId

      public String targetDbServerResourceId()
      Get the targetDbServerResourceId property: Identifier of the target database server resource.
      Returns:
      the targetDbServerResourceId value.
    • targetDbServerFullyQualifiedDomainName

      public String targetDbServerFullyQualifiedDomainName()
      Get the targetDbServerFullyQualifiedDomainName property: 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.
      Returns:
      the targetDbServerFullyQualifiedDomainName value.
    • withTargetDbServerFullyQualifiedDomainName

      public MigrationProperties withTargetDbServerFullyQualifiedDomainName(String targetDbServerFullyQualifiedDomainName)
      Set the targetDbServerFullyQualifiedDomainName property: 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.
      Parameters:
      targetDbServerFullyQualifiedDomainName - the targetDbServerFullyQualifiedDomainName value to set.
      Returns:
      the MigrationProperties object itself.
    • secretParameters

      public MigrationSecretParameters secretParameters()
      Get the secretParameters property: Migration secret parameters.
      Returns:
      the secretParameters value.
    • withSecretParameters

      public MigrationProperties withSecretParameters(MigrationSecretParameters secretParameters)
      Set the secretParameters property: Migration secret parameters.
      Parameters:
      secretParameters - the secretParameters value to set.
      Returns:
      the MigrationProperties object itself.
    • dbsToMigrate

      public List<String> dbsToMigrate()
      Get the dbsToMigrate property: Names of databases to migrate.
      Returns:
      the dbsToMigrate value.
    • withDbsToMigrate

      public MigrationProperties withDbsToMigrate(List<String> dbsToMigrate)
      Set the dbsToMigrate property: Names of databases to migrate.
      Parameters:
      dbsToMigrate - the dbsToMigrate value to set.
      Returns:
      the MigrationProperties object itself.
    • setupLogicalReplicationOnSourceDbIfNeeded

      public LogicalReplicationOnSourceServer setupLogicalReplicationOnSourceDbIfNeeded()
      Get the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup logical replication on source server, if needed.
      Returns:
      the setupLogicalReplicationOnSourceDbIfNeeded value.
    • withSetupLogicalReplicationOnSourceDbIfNeeded

      public MigrationProperties withSetupLogicalReplicationOnSourceDbIfNeeded(LogicalReplicationOnSourceServer setupLogicalReplicationOnSourceDbIfNeeded)
      Set the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup logical replication on source server, if needed.
      Parameters:
      setupLogicalReplicationOnSourceDbIfNeeded - the setupLogicalReplicationOnSourceDbIfNeeded value to set.
      Returns:
      the MigrationProperties object itself.
    • overwriteDbsInTarget

      public OverwriteDatabasesOnTargetServer overwriteDbsInTarget()
      Get the overwriteDbsInTarget property: 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.
      Returns:
      the overwriteDbsInTarget value.
    • withOverwriteDbsInTarget

      public MigrationProperties withOverwriteDbsInTarget(OverwriteDatabasesOnTargetServer overwriteDbsInTarget)
      Set the overwriteDbsInTarget property: 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.
      Parameters:
      overwriteDbsInTarget - the overwriteDbsInTarget value to set.
      Returns:
      the MigrationProperties object itself.
    • migrationWindowStartTimeInUtc

      public OffsetDateTime migrationWindowStartTimeInUtc()
      Get the migrationWindowStartTimeInUtc property: Start time (UTC) for migration window.
      Returns:
      the migrationWindowStartTimeInUtc value.
    • withMigrationWindowStartTimeInUtc

      public MigrationProperties withMigrationWindowStartTimeInUtc(OffsetDateTime migrationWindowStartTimeInUtc)
      Set the migrationWindowStartTimeInUtc property: Start time (UTC) for migration window.
      Parameters:
      migrationWindowStartTimeInUtc - the migrationWindowStartTimeInUtc value to set.
      Returns:
      the MigrationProperties object itself.
    • migrationWindowEndTimeInUtc

      public OffsetDateTime migrationWindowEndTimeInUtc()
      Get the migrationWindowEndTimeInUtc property: End time (UTC) for migration window.
      Returns:
      the migrationWindowEndTimeInUtc value.
    • withMigrationWindowEndTimeInUtc

      public MigrationProperties withMigrationWindowEndTimeInUtc(OffsetDateTime migrationWindowEndTimeInUtc)
      Set the migrationWindowEndTimeInUtc property: End time (UTC) for migration window.
      Parameters:
      migrationWindowEndTimeInUtc - the migrationWindowEndTimeInUtc value to set.
      Returns:
      the MigrationProperties object itself.
    • migrateRoles

      public MigrateRolesAndPermissions migrateRoles()
      Get the migrateRoles property: Indicates if roles and permissions must be migrated.
      Returns:
      the migrateRoles value.
    • withMigrateRoles

      public MigrationProperties withMigrateRoles(MigrateRolesAndPermissions migrateRoles)
      Set the migrateRoles property: Indicates if roles and permissions must be migrated.
      Parameters:
      migrateRoles - the migrateRoles value to set.
      Returns:
      the MigrationProperties object itself.
    • startDataMigration

      public StartDataMigration startDataMigration()
      Get the startDataMigration property: Indicates if data migration must start right away.
      Returns:
      the startDataMigration value.
    • withStartDataMigration

      public MigrationProperties withStartDataMigration(StartDataMigration startDataMigration)
      Set the startDataMigration property: Indicates if data migration must start right away.
      Parameters:
      startDataMigration - the startDataMigration value to set.
      Returns:
      the MigrationProperties object itself.
    • triggerCutover

      public TriggerCutover triggerCutover()
      Get the triggerCutover property: Indicates if cutover must be triggered for the entire migration.
      Returns:
      the triggerCutover value.
    • withTriggerCutover

      public MigrationProperties withTriggerCutover(TriggerCutover triggerCutover)
      Set the triggerCutover property: Indicates if cutover must be triggered for the entire migration.
      Parameters:
      triggerCutover - the triggerCutover value to set.
      Returns:
      the MigrationProperties object itself.
    • dbsToTriggerCutoverOn

      public List<String> dbsToTriggerCutoverOn()
      Get the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array.
      Returns:
      the dbsToTriggerCutoverOn value.
    • withDbsToTriggerCutoverOn

      public MigrationProperties withDbsToTriggerCutoverOn(List<String> dbsToTriggerCutoverOn)
      Set the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array.
      Parameters:
      dbsToTriggerCutoverOn - the dbsToTriggerCutoverOn value to set.
      Returns:
      the MigrationProperties object itself.
    • cancel

      public Cancel cancel()
      Get the cancel property: Indicates if cancel must be triggered for the entire migration.
      Returns:
      the cancel value.
    • withCancel

      public MigrationProperties withCancel(Cancel cancel)
      Set the cancel property: Indicates if cancel must be triggered for the entire migration.
      Parameters:
      cancel - the cancel value to set.
      Returns:
      the MigrationProperties object itself.
    • dbsToCancelMigrationOn

      public List<String> dbsToCancelMigrationOn()
      Get the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array.
      Returns:
      the dbsToCancelMigrationOn value.
    • withDbsToCancelMigrationOn

      public MigrationProperties withDbsToCancelMigrationOn(List<String> dbsToCancelMigrationOn)
      Set the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array.
      Parameters:
      dbsToCancelMigrationOn - the dbsToCancelMigrationOn value to set.
      Returns:
      the MigrationProperties object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<MigrationProperties>
      Throws:
      IOException
    • fromJson

      public static MigrationProperties fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of MigrationProperties from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of MigrationProperties if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the MigrationProperties.