SqlDatabase Interface

public interface SqlDatabase extends IndependentChildResource<SqlServerManager, DatabaseInner>,Refreshable,Updatable<SqlDatabase.Update>,ExternalChildResource<SqlDatabase, SqlServer>,HasInner,HasResourceGroup,Refreshable,Updatable<SqlDatabase.Update>

An immutable client-side representation of an Azure SQL Server Database.

An immutable client-side representation of an Azure SQL Database.

Method Summary

Modifier and Type Method and Description
SqlWarehouse asWarehouse()
String collation()
DateTime creationDate()
UUID currentServiceObjectiveId()
String databaseId()
String defaultSecondaryLocation()
SqlDatabaseThreatDetectionPolicy.DefinitionStages.Blank defineThreatDetectionPolicy(String policyName)

Begins a definition for a security alert policy.

void delete()

Deletes the database from the server.

Completable deleteAsync()

Deletes the database asynchronously.

DateTime earliestRestoreDate()
DatabaseEdition edition()
String elasticPoolName()
SqlDatabaseExportRequest.DefinitionStages.WithAuthenticationTypeAndLoginPassword exportTo(Creatable<StorageAccount> storageAccountCreatable, String containerName, String fileName)

Exports the current database to a new storage account and relative path.

SqlDatabaseExportRequest.DefinitionStages.WithAuthenticationTypeAndLoginPassword exportTo(StorageAccount storageAccount, String containerName, String fileName)

Exports the current database to an existing storage account and relative path.

SqlDatabaseExportRequest.DefinitionStages.WithStorageTypeAndKey exportTo(String storageUri)

Exports the current database to a specified URI path.

SqlDatabaseAutomaticTuning getDatabaseAutomaticTuning()

Gets a SQL database automatic tuning state and options.

SqlDatabaseThreatDetectionPolicy getThreatDetectionPolicy()

Gets a SQL database threat detection policy.

TransparentDataEncryption getTransparentDataEncryption()

Gets an Azure SQL Database Transparent Data Encryption for this database.

Observable<TransparentDataEncryption> getTransparentDataEncryptionAsync()

Gets an Azure SQL Database Transparent Data Encryption for this database.

UpgradeHintInterface getUpgradeHint()
SqlDatabaseImportRequest.DefinitionStages.WithAuthenticationTypeAndLoginPassword importBacpac(StorageAccount storageAccount, String containerName, String fileName)

Imports into the current database from an existing storage account and relative path; the current database must be empty.

SqlDatabaseImportRequest.DefinitionStages.WithStorageTypeAndKey importBacpac(String storageUri)

Imports into the current database from a specified URI path; the current database must be empty.

boolean isDataWarehouse()
List<SqlDatabaseMetricDefinition> listMetricDefinitions()
Observable<SqlDatabaseMetricDefinition> listMetricDefinitionsAsync()
List<SqlDatabaseMetric> listMetrics(String filter)
Observable<SqlDatabaseMetric> listMetricsAsync(String filter)
Map<String, ReplicationLink> listReplicationLinks()
Observable<ReplicationLink> listReplicationLinksAsync()
List<RestorePoint> listRestorePoints()
Observable<RestorePoint> listRestorePointsAsync()
Map<String, ServiceTierAdvisor> listServiceTierAdvisors()
Observable<ServiceTierAdvisor> listServiceTierAdvisorsAsync()
List<SqlDatabaseUsageMetric> listUsageMetrics()

Lists the SQL database usage metrics.

Observable<SqlDatabaseUsageMetric> listUsageMetricsAsync()

Asynchronously lists the SQL database usage metrics.

List<DatabaseMetric> listUsages()
long maxSizeBytes()
String parentId()
Region region()
String regionName()
SqlDatabase rename(String newDatabaseName)

Renames the database.

Observable<SqlDatabase> renameAsync(String newDatabaseName)

Renames the database asynchronously.

UUID requestedServiceObjectiveId()
ServiceObjectiveName requestedServiceObjectiveName()
ServiceObjectiveName serviceLevelObjective()
String sqlServerName()
String status()
SqlSyncGroupOperations.SqlSyncGroupActionsDefinition syncGroups()

Inherited Members

Method Details

asWarehouse

public SqlWarehouse asWarehouse()

Returns:

SqlWarehouse instance for more operations

collation

public String collation()

Returns:

the collation of the Azure SQL Database

creationDate

public DateTime creationDate()

Returns:

the creation date of the Azure SQL Database

currentServiceObjectiveId

public UUID currentServiceObjectiveId()

Returns:

the current Service Level Objective Id of the Azure SQL Database, this is the Id of the Service Level Objective that is currently active

databaseId

public String databaseId()

Returns:

the Id of the Azure SQL Database

defaultSecondaryLocation

public String defaultSecondaryLocation()

Returns:

the defaultSecondaryLocation value

defineThreatDetectionPolicy

public SqlDatabaseThreatDetectionPolicy.DefinitionStages.Blank defineThreatDetectionPolicy(String policyName)

Begins a definition for a security alert policy.

Parameters:

policyName - the name of the security alert policy

Returns:

the first stage of the SqlDatabaseThreatDetectionPolicy definition

delete

public void delete()

Deletes the database from the server.

deleteAsync

public Completable deleteAsync()

Deletes the database asynchronously.

Returns:

a representation of the deferred computation of this call

earliestRestoreDate

public DateTime earliestRestoreDate()

Returns:

the recovery period start date of the Azure SQL Database. This records the start date and time when recovery is available for this Azure SQL Database.

edition

public DatabaseEdition edition()

Returns:

the edition of the Azure SQL Database

elasticPoolName

public String elasticPoolName()

Returns:

the elasticPoolName value

exportTo

public SqlDatabaseExportRequest.DefinitionStages.WithAuthenticationTypeAndLoginPassword exportTo(Creatable storageAccountCreatable, String containerName, String fileName)

Exports the current database to a new storage account and relative path.

Parameters:

storageAccountCreatable - a storage account to be created as part of this execution flow
containerName - the container name within the storage account to use
fileName - the exported database file name

Returns:

response object

exportTo

public SqlDatabaseExportRequest.DefinitionStages.WithAuthenticationTypeAndLoginPassword exportTo(StorageAccount storageAccount, String containerName, String fileName)

Exports the current database to an existing storage account and relative path.

Parameters:

storageAccount - an existing storage account to be used
containerName - the container name within the storage account to use
fileName - the exported database file name

Returns:

response object

exportTo

public SqlDatabaseExportRequest.DefinitionStages.WithStorageTypeAndKey exportTo(String storageUri)

Exports the current database to a specified URI path.

Parameters:

storageUri - the storage URI to use

Returns:

response object

getDatabaseAutomaticTuning

public SqlDatabaseAutomaticTuning getDatabaseAutomaticTuning()

Gets a SQL database automatic tuning state and options.

Returns:

the SQL database automatic tuning state and options

getThreatDetectionPolicy

public SqlDatabaseThreatDetectionPolicy getThreatDetectionPolicy()

Gets a SQL database threat detection policy.

Returns:

the SQL database threat detection policy for the current database

getTransparentDataEncryption

public TransparentDataEncryption getTransparentDataEncryption()

Gets an Azure SQL Database Transparent Data Encryption for this database.

Returns:

an Azure SQL Database Transparent Data Encryption for this database

getTransparentDataEncryptionAsync

public Observable getTransparentDataEncryptionAsync()

Gets an Azure SQL Database Transparent Data Encryption for this database.

Returns:

a representation of the deferred computation of an Azure SQL Database Transparent Data Encryption for this database

getUpgradeHint

public UpgradeHintInterface getUpgradeHint()

Returns:

the upgradeHint value

importBacpac

public SqlDatabaseImportRequest.DefinitionStages.WithAuthenticationTypeAndLoginPassword importBacpac(StorageAccount storageAccount, String containerName, String fileName)

Imports into the current database from an existing storage account and relative path; the current database must be empty.

Parameters:

storageAccount - an existing storage account to be used
containerName - the container name within the storage account to use
fileName - the exported database file name

Returns:

response object

importBacpac

public SqlDatabaseImportRequest.DefinitionStages.WithStorageTypeAndKey importBacpac(String storageUri)

Imports into the current database from a specified URI path; the current database must be empty.

Parameters:

storageUri - the storage URI to use

Returns:

response object

isDataWarehouse

public boolean isDataWarehouse()

Returns:

true if this Database is SqlWarehouse

listMetricDefinitions

public List listMetricDefinitions()

Returns:

the list of metric definitions for this database

listMetricDefinitionsAsync

public Observable listMetricDefinitionsAsync()

Returns:

a representation of the deferred computation of the metric definitions for this database

listMetrics

public List listMetrics(String filter)

Parameters:

filter - an OData filter expression that describes a subset of metrics to return.

Returns:

the list of metrics for this database

listMetricsAsync

public Observable listMetricsAsync(String filter)

Parameters:

filter - an OData filter expression that describes a subset of metrics to return.

Returns:

a representation of the deferred computation of the metrics for this database

listReplicationLinks

public Map listReplicationLinks()

Returns:

all the replication links associated with this database

listReplicationLinksAsync

public Observable listReplicationLinksAsync()

Returns:

a representation of the deferred computation of all the replication links associated with this database

listRestorePoints

public List listRestorePoints()

Returns:

the list of all restore points on this database

listRestorePointsAsync

public Observable listRestorePointsAsync()

Returns:

the list of all restore points on this database

listServiceTierAdvisors

public Map listServiceTierAdvisors()

Returns:

information about service tier advisors for the current database

listServiceTierAdvisorsAsync

public Observable listServiceTierAdvisorsAsync()

Returns:

a representation of the deferred computation of the information about service tier advisors for this database

listUsageMetrics

public List listUsageMetrics()

Lists the SQL database usage metrics.

Returns:

the SQL database usage metrics

listUsageMetricsAsync

public Observable listUsageMetricsAsync()

Asynchronously lists the SQL database usage metrics.

Returns:

a representation of the deferred computation of this call returning the SQL database usage metrics

listUsages

public List listUsages()

Returns:

the list of usages (DatabaseMetrics) of this database

maxSizeBytes

public long maxSizeBytes()

Returns:

the max size of the Azure SQL Database expressed in bytes.

parentId

public String parentId()

Returns:

the parent SQL server ID

region

public Region region()

Returns:

the region the resource is in

regionName

public String regionName()

Returns:

the name of the region the resource is in

rename

public SqlDatabase rename(String newDatabaseName)

Renames the database.

Parameters:

newDatabaseName - the new name for the database

Returns:

the renamed SQL database

renameAsync

public Observable renameAsync(String newDatabaseName)

Renames the database asynchronously.

Parameters:

newDatabaseName - the new name for the database

Returns:

a representation of the deferred computation of this call

requestedServiceObjectiveId

public UUID requestedServiceObjectiveId()

Returns:

the configured Service Level Objective Id of the Azure SQL Database, this is the Service Level Objective that is being applied to the Azure SQL Database

requestedServiceObjectiveName

public ServiceObjectiveName requestedServiceObjectiveName()

Returns:

the name of the configured Service Level Objective of the Azure SQL Database, this is the Service Level Objective that is being applied to the Azure SQL Database

serviceLevelObjective

public ServiceObjectiveName serviceLevelObjective()

Returns:

the Service Level Objective of the Azure SQL Database.

sqlServerName

public String sqlServerName()

Returns:

name of the SQL Server to which this database belongs

status

public String status()

Returns:

the status of the Azure SQL Database

syncGroups

public SqlSyncGroupOperations.SqlSyncGroupActionsDefinition syncGroups()

Returns:

the SQL Sync Group entry point for the current database

Applies to