Class DatabaseInner
- java.lang.Object
-
- com.azure.core.management.ProxyResource
-
- com.azure.core.management.Resource
-
- com.azure.resourcemanager.sql.fluent.models.DatabaseInner
-
public class DatabaseInner extends com.azure.core.management.ResourceA database resource.
-
-
Constructor Summary
Constructors Constructor Description DatabaseInner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegerautoPauseDelay()Get the autoPauseDelay property: Time in minutes after which database is automatically paused.CatalogCollationTypecatalogCollation()Get the catalogCollation property: Collation of the metadata catalog.Stringcollation()Get the collation property: The collation of the database.CreateModecreateMode()Get the createMode property: Specifies the mode of database creation.OffsetDateTimecreationDate()Get the creationDate property: The creation date of the database (ISO8601 format).StringcurrentServiceObjectiveName()Get the currentServiceObjectiveName property: The current service level objective name of the database.SkucurrentSku()Get the currentSku property: The name and tier of the SKU.UUIDdatabaseId()Get the databaseId property: The ID of the database.StringdefaultSecondaryLocation()Get the defaultSecondaryLocation property: The default secondary region for this database.OffsetDateTimeearliestRestoreDate()Get the earliestRestoreDate property: This records the earliest start date and time that restore is available for this database (ISO8601 format).StringelasticPoolId()Get the elasticPoolId property: The resource identifier of the elastic pool containing this database.StringfailoverGroupId()Get the failoverGroupId property: Failover Group resource identifier that this database belongs to.Stringkind()Get the kind property: Kind of database.DatabaseLicenseTypelicenseType()Get the licenseType property: The license type to apply for this database.StringlongTermRetentionBackupResourceId()Get the longTermRetentionBackupResourceId property: The resource identifier of the long term retention backup associated with create operation of this database.StringmanagedBy()Get the managedBy property: Resource that manages the database.LongmaxLogSizeBytes()Get the maxLogSizeBytes property: The max log size for this database.LongmaxSizeBytes()Get the maxSizeBytes property: The max size of the database expressed in bytes.DoubleminCapacity()Get the minCapacity property: Minimal capacity that database will always have allocated, if not paused.OffsetDateTimepausedDate()Get the pausedDate property: The date when database was paused by user configuration or action (ISO8601 format).IntegerreadReplicaCount()Get the readReplicaCount property: The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed.DatabaseReadScalereadScale()Get the readScale property: If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica.StringrecoverableDatabaseId()Get the recoverableDatabaseId property: The resource identifier of the recoverable database associated with create operation of this database.StringrecoveryServicesRecoveryPointId()Get the recoveryServicesRecoveryPointId property: The resource identifier of the recovery point associated with create operation of this database.StringrequestedServiceObjectiveName()Get the requestedServiceObjectiveName property: The requested service level objective name of the database.StringrestorableDroppedDatabaseId()Get the restorableDroppedDatabaseId property: The resource identifier of the restorable dropped database associated with create operation of this database.OffsetDateTimerestorePointInTime()Get the restorePointInTime property: Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.OffsetDateTimeresumedDate()Get the resumedDate property: The date when database was resumed by user action or database login (ISO8601 format).SampleNamesampleName()Get the sampleName property: The name of the sample schema to apply when creating this database.Skusku()Get the sku property: The database SKU.OffsetDateTimesourceDatabaseDeletionDate()Get the sourceDatabaseDeletionDate property: Specifies the time that the database was deleted.StringsourceDatabaseId()Get the sourceDatabaseId property: The resource identifier of the source database associated with create operation of this database.DatabaseStatusstatus()Get the status property: The status of the database.voidvalidate()Validates the instance.DatabaseInnerwithAutoPauseDelay(Integer autoPauseDelay)Set the autoPauseDelay property: Time in minutes after which database is automatically paused.DatabaseInnerwithCatalogCollation(CatalogCollationType catalogCollation)Set the catalogCollation property: Collation of the metadata catalog.DatabaseInnerwithCollation(String collation)Set the collation property: The collation of the database.DatabaseInnerwithCreateMode(CreateMode createMode)Set the createMode property: Specifies the mode of database creation.DatabaseInnerwithElasticPoolId(String elasticPoolId)Set the elasticPoolId property: The resource identifier of the elastic pool containing this database.DatabaseInnerwithLicenseType(DatabaseLicenseType licenseType)Set the licenseType property: The license type to apply for this database.DatabaseInnerwithLongTermRetentionBackupResourceId(String longTermRetentionBackupResourceId)Set the longTermRetentionBackupResourceId property: The resource identifier of the long term retention backup associated with create operation of this database.DatabaseInnerwithMaxSizeBytes(Long maxSizeBytes)Set the maxSizeBytes property: The max size of the database expressed in bytes.DatabaseInnerwithMinCapacity(Double minCapacity)Set the minCapacity property: Minimal capacity that database will always have allocated, if not paused.DatabaseInnerwithReadReplicaCount(Integer readReplicaCount)Set the readReplicaCount property: The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed.DatabaseInnerwithReadScale(DatabaseReadScale readScale)Set the readScale property: If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica.DatabaseInnerwithRecoverableDatabaseId(String recoverableDatabaseId)Set the recoverableDatabaseId property: The resource identifier of the recoverable database associated with create operation of this database.DatabaseInnerwithRecoveryServicesRecoveryPointId(String recoveryServicesRecoveryPointId)Set the recoveryServicesRecoveryPointId property: The resource identifier of the recovery point associated with create operation of this database.DatabaseInnerwithRestorableDroppedDatabaseId(String restorableDroppedDatabaseId)Set the restorableDroppedDatabaseId property: The resource identifier of the restorable dropped database associated with create operation of this database.DatabaseInnerwithRestorePointInTime(OffsetDateTime restorePointInTime)Set the restorePointInTime property: Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.DatabaseInnerwithSampleName(SampleName sampleName)Set the sampleName property: The name of the sample schema to apply when creating this database.DatabaseInnerwithSku(Sku sku)Set the sku property: The database SKU.DatabaseInnerwithSourceDatabaseDeletionDate(OffsetDateTime sourceDatabaseDeletionDate)Set the sourceDatabaseDeletionDate property: Specifies the time that the database was deleted.DatabaseInnerwithSourceDatabaseId(String sourceDatabaseId)Set the sourceDatabaseId property: The resource identifier of the source database associated with create operation of this database.DatabaseInnerwithZoneRedundant(Boolean zoneRedundant)Set the zoneRedundant property: Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.BooleanzoneRedundant()Get the zoneRedundant property: Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
-
-
-
Method Detail
-
sku
public Sku sku()
Get the sku property: The database SKU.The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:
```azurecli az sql db list-editions -l <location> -o table ````
```powershell Get-AzSqlServerServiceObjective -Location <location> ````.
- Returns:
- the sku value.
-
withSku
public DatabaseInner withSku(Sku sku)
Set the sku property: The database SKU.The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:
```azurecli az sql db list-editions -l <location> -o table ````
```powershell Get-AzSqlServerServiceObjective -Location <location> ````.
- Parameters:
sku- the sku value to set.- Returns:
- the DatabaseInner object itself.
-
kind
public String kind()
Get the kind property: Kind of database. This is metadata used for the Azure portal experience.- Returns:
- the kind value.
-
managedBy
public String managedBy()
Get the managedBy property: Resource that manages the database.- Returns:
- the managedBy value.
-
createMode
public CreateMode createMode()
Get the createMode property: Specifies the mode of database creation.Default: regular database creation.
Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
- Returns:
- the createMode value.
-
withCreateMode
public DatabaseInner withCreateMode(CreateMode createMode)
Set the createMode property: Specifies the mode of database creation.Default: regular database creation.
Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
- Parameters:
createMode- the createMode value to set.- Returns:
- the DatabaseInner object itself.
-
collation
public String collation()
Get the collation property: The collation of the database.- Returns:
- the collation value.
-
withCollation
public DatabaseInner withCollation(String collation)
Set the collation property: The collation of the database.- Parameters:
collation- the collation value to set.- Returns:
- the DatabaseInner object itself.
-
maxSizeBytes
public Long maxSizeBytes()
Get the maxSizeBytes property: The max size of the database expressed in bytes.- Returns:
- the maxSizeBytes value.
-
withMaxSizeBytes
public DatabaseInner withMaxSizeBytes(Long maxSizeBytes)
Set the maxSizeBytes property: The max size of the database expressed in bytes.- Parameters:
maxSizeBytes- the maxSizeBytes value to set.- Returns:
- the DatabaseInner object itself.
-
sampleName
public SampleName sampleName()
Get the sampleName property: The name of the sample schema to apply when creating this database.- Returns:
- the sampleName value.
-
withSampleName
public DatabaseInner withSampleName(SampleName sampleName)
Set the sampleName property: The name of the sample schema to apply when creating this database.- Parameters:
sampleName- the sampleName value to set.- Returns:
- the DatabaseInner object itself.
-
elasticPoolId
public String elasticPoolId()
Get the elasticPoolId property: The resource identifier of the elastic pool containing this database.- Returns:
- the elasticPoolId value.
-
withElasticPoolId
public DatabaseInner withElasticPoolId(String elasticPoolId)
Set the elasticPoolId property: The resource identifier of the elastic pool containing this database.- Parameters:
elasticPoolId- the elasticPoolId value to set.- Returns:
- the DatabaseInner object itself.
-
sourceDatabaseId
public String sourceDatabaseId()
Get the sourceDatabaseId property: The resource identifier of the source database associated with create operation of this database.- Returns:
- the sourceDatabaseId value.
-
withSourceDatabaseId
public DatabaseInner withSourceDatabaseId(String sourceDatabaseId)
Set the sourceDatabaseId property: The resource identifier of the source database associated with create operation of this database.- Parameters:
sourceDatabaseId- the sourceDatabaseId value to set.- Returns:
- the DatabaseInner object itself.
-
status
public DatabaseStatus status()
Get the status property: The status of the database.- Returns:
- the status value.
-
databaseId
public UUID databaseId()
Get the databaseId property: The ID of the database.- Returns:
- the databaseId value.
-
creationDate
public OffsetDateTime creationDate()
Get the creationDate property: The creation date of the database (ISO8601 format).- Returns:
- the creationDate value.
-
currentServiceObjectiveName
public String currentServiceObjectiveName()
Get the currentServiceObjectiveName property: The current service level objective name of the database.- Returns:
- the currentServiceObjectiveName value.
-
requestedServiceObjectiveName
public String requestedServiceObjectiveName()
Get the requestedServiceObjectiveName property: The requested service level objective name of the database.- Returns:
- the requestedServiceObjectiveName value.
-
defaultSecondaryLocation
public String defaultSecondaryLocation()
Get the defaultSecondaryLocation property: The default secondary region for this database.- Returns:
- the defaultSecondaryLocation value.
-
failoverGroupId
public String failoverGroupId()
Get the failoverGroupId property: Failover Group resource identifier that this database belongs to.- Returns:
- the failoverGroupId value.
-
restorePointInTime
public OffsetDateTime restorePointInTime()
Get the restorePointInTime property: Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.- Returns:
- the restorePointInTime value.
-
withRestorePointInTime
public DatabaseInner withRestorePointInTime(OffsetDateTime restorePointInTime)
Set the restorePointInTime property: Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.- Parameters:
restorePointInTime- the restorePointInTime value to set.- Returns:
- the DatabaseInner object itself.
-
sourceDatabaseDeletionDate
public OffsetDateTime sourceDatabaseDeletionDate()
Get the sourceDatabaseDeletionDate property: Specifies the time that the database was deleted.- Returns:
- the sourceDatabaseDeletionDate value.
-
withSourceDatabaseDeletionDate
public DatabaseInner withSourceDatabaseDeletionDate(OffsetDateTime sourceDatabaseDeletionDate)
Set the sourceDatabaseDeletionDate property: Specifies the time that the database was deleted.- Parameters:
sourceDatabaseDeletionDate- the sourceDatabaseDeletionDate value to set.- Returns:
- the DatabaseInner object itself.
-
recoveryServicesRecoveryPointId
public String recoveryServicesRecoveryPointId()
Get the recoveryServicesRecoveryPointId property: The resource identifier of the recovery point associated with create operation of this database.- Returns:
- the recoveryServicesRecoveryPointId value.
-
withRecoveryServicesRecoveryPointId
public DatabaseInner withRecoveryServicesRecoveryPointId(String recoveryServicesRecoveryPointId)
Set the recoveryServicesRecoveryPointId property: The resource identifier of the recovery point associated with create operation of this database.- Parameters:
recoveryServicesRecoveryPointId- the recoveryServicesRecoveryPointId value to set.- Returns:
- the DatabaseInner object itself.
-
longTermRetentionBackupResourceId
public String longTermRetentionBackupResourceId()
Get the longTermRetentionBackupResourceId property: The resource identifier of the long term retention backup associated with create operation of this database.- Returns:
- the longTermRetentionBackupResourceId value.
-
withLongTermRetentionBackupResourceId
public DatabaseInner withLongTermRetentionBackupResourceId(String longTermRetentionBackupResourceId)
Set the longTermRetentionBackupResourceId property: The resource identifier of the long term retention backup associated with create operation of this database.- Parameters:
longTermRetentionBackupResourceId- the longTermRetentionBackupResourceId value to set.- Returns:
- the DatabaseInner object itself.
-
recoverableDatabaseId
public String recoverableDatabaseId()
Get the recoverableDatabaseId property: The resource identifier of the recoverable database associated with create operation of this database.- Returns:
- the recoverableDatabaseId value.
-
withRecoverableDatabaseId
public DatabaseInner withRecoverableDatabaseId(String recoverableDatabaseId)
Set the recoverableDatabaseId property: The resource identifier of the recoverable database associated with create operation of this database.- Parameters:
recoverableDatabaseId- the recoverableDatabaseId value to set.- Returns:
- the DatabaseInner object itself.
-
restorableDroppedDatabaseId
public String restorableDroppedDatabaseId()
Get the restorableDroppedDatabaseId property: The resource identifier of the restorable dropped database associated with create operation of this database.- Returns:
- the restorableDroppedDatabaseId value.
-
withRestorableDroppedDatabaseId
public DatabaseInner withRestorableDroppedDatabaseId(String restorableDroppedDatabaseId)
Set the restorableDroppedDatabaseId property: The resource identifier of the restorable dropped database associated with create operation of this database.- Parameters:
restorableDroppedDatabaseId- the restorableDroppedDatabaseId value to set.- Returns:
- the DatabaseInner object itself.
-
catalogCollation
public CatalogCollationType catalogCollation()
Get the catalogCollation property: Collation of the metadata catalog.- Returns:
- the catalogCollation value.
-
withCatalogCollation
public DatabaseInner withCatalogCollation(CatalogCollationType catalogCollation)
Set the catalogCollation property: Collation of the metadata catalog.- Parameters:
catalogCollation- the catalogCollation value to set.- Returns:
- the DatabaseInner object itself.
-
zoneRedundant
public Boolean zoneRedundant()
Get the zoneRedundant property: Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.- Returns:
- the zoneRedundant value.
-
withZoneRedundant
public DatabaseInner withZoneRedundant(Boolean zoneRedundant)
Set the zoneRedundant property: Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.- Parameters:
zoneRedundant- the zoneRedundant value to set.- Returns:
- the DatabaseInner object itself.
-
licenseType
public DatabaseLicenseType licenseType()
Get the licenseType property: The license type to apply for this database.- Returns:
- the licenseType value.
-
withLicenseType
public DatabaseInner withLicenseType(DatabaseLicenseType licenseType)
Set the licenseType property: The license type to apply for this database.- Parameters:
licenseType- the licenseType value to set.- Returns:
- the DatabaseInner object itself.
-
maxLogSizeBytes
public Long maxLogSizeBytes()
Get the maxLogSizeBytes property: The max log size for this database.- Returns:
- the maxLogSizeBytes value.
-
earliestRestoreDate
public OffsetDateTime earliestRestoreDate()
Get the earliestRestoreDate property: This records the earliest start date and time that restore is available for this database (ISO8601 format).- Returns:
- the earliestRestoreDate value.
-
readScale
public DatabaseReadScale readScale()
Get the readScale property: If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.- Returns:
- the readScale value.
-
withReadScale
public DatabaseInner withReadScale(DatabaseReadScale readScale)
Set the readScale property: If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.- Parameters:
readScale- the readScale value to set.- Returns:
- the DatabaseInner object itself.
-
readReplicaCount
public Integer readReplicaCount()
Get the readReplicaCount property: The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.- Returns:
- the readReplicaCount value.
-
withReadReplicaCount
public DatabaseInner withReadReplicaCount(Integer readReplicaCount)
Set the readReplicaCount property: The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.- Parameters:
readReplicaCount- the readReplicaCount value to set.- Returns:
- the DatabaseInner object itself.
-
currentSku
public Sku currentSku()
Get the currentSku property: The name and tier of the SKU.- Returns:
- the currentSku value.
-
autoPauseDelay
public Integer autoPauseDelay()
Get the autoPauseDelay property: Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled.- Returns:
- the autoPauseDelay value.
-
withAutoPauseDelay
public DatabaseInner withAutoPauseDelay(Integer autoPauseDelay)
Set the autoPauseDelay property: Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled.- Parameters:
autoPauseDelay- the autoPauseDelay value to set.- Returns:
- the DatabaseInner object itself.
-
minCapacity
public Double minCapacity()
Get the minCapacity property: Minimal capacity that database will always have allocated, if not paused.- Returns:
- the minCapacity value.
-
withMinCapacity
public DatabaseInner withMinCapacity(Double minCapacity)
Set the minCapacity property: Minimal capacity that database will always have allocated, if not paused.- Parameters:
minCapacity- the minCapacity value to set.- Returns:
- the DatabaseInner object itself.
-
pausedDate
public OffsetDateTime pausedDate()
Get the pausedDate property: The date when database was paused by user configuration or action (ISO8601 format). Null if the database is ready.- Returns:
- the pausedDate value.
-
resumedDate
public OffsetDateTime resumedDate()
Get the resumedDate property: The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.- Returns:
- the resumedDate value.
-
validate
public void validate()
Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
-