共用方式為


SqlDatabase Interface

Implements

public interface SqlDatabase
extends ExternalChildResource<SqlDatabase,SqlServer>, HasInnerModel<DatabaseInner>, HasResourceGroup, Refreshable<SqlDatabase>, Updatable<Update>

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

Method Summary

Modifier and Type Method and Description
abstract SqlWarehouse asWarehouse()

Gets SqlWarehouse instance for more operations.

abstract String collation()

Gets the collation of the Azure SQL Database.

abstract OffsetDateTime creationDate()

Gets the creation date of the Azure SQL Database.

abstract String currentServiceObjectiveName()

Gets the current Service Level Objective Name of the Azure SQL Database.

abstract String databaseId()

Gets the ID of the Azure SQL Database.

abstract String defaultSecondaryLocation()

Gets the default secondary location.

abstract Blank defineThreatDetectionPolicy(SecurityAlertPolicyName policyName)

Begins a definition for a security alert policy.

abstract Blank defineThreatDetectionPolicy(String policyName)

Deprecated

Begins a definition for a security alert policy.

abstract void delete()

Deletes the database from the server.

abstract Mono<Void> deleteAsync()

Deletes the database asynchronously.

abstract OffsetDateTime earliestRestoreDate()

Gets the recovery period start date of the Azure SQL Database.

abstract DatabaseEdition edition()

Gets the edition of the Azure SQL Database.

abstract String elasticPoolId()

Gets ID of the elastic pool.

abstract String elasticPoolName()

Gets name of the elastic pool.

abstract WithAuthenticationTypeAndLoginPassword exportTo(Creatable<StorageAccount> storageAccountCreatable, String containerName, String fileName)

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

abstract WithAuthenticationTypeAndLoginPassword exportTo(StorageAccount storageAccount, String containerName, String fileName)

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

abstract WithStorageTypeAndKey exportTo(String storageUri)

Exports the current database to a specified URI path.

abstract SqlDatabaseAutomaticTuning getDatabaseAutomaticTuning()

Gets a SQL database automatic tuning state and options.

abstract SqlDatabaseThreatDetectionPolicy getThreatDetectionPolicy()

Gets a SQL database threat detection policy.

abstract TransparentDataEncryption getTransparentDataEncryption()

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

abstract Mono<TransparentDataEncryption> getTransparentDataEncryptionAsync()

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

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

abstract WithStorageTypeAndKey importBacpac(String storageUri)

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

abstract boolean isDataWarehouse()

Checks whether this Database is SqlWarehouse.

abstract Map<String,ReplicationLink> listReplicationLinks()

Gets all the replication links associated with this database.

abstract PagedFlux<ReplicationLink> listReplicationLinksAsync()

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

abstract List<RestorePoint> listRestorePoints()

Gets the list of all restore points on this database.

abstract PagedFlux<RestorePoint> listRestorePointsAsync()

Gets the list of all restore points on this database.

abstract List<SqlDatabaseUsageMetric> listUsageMetrics()

Lists the SQL database usage metrics.

abstract PagedFlux<SqlDatabaseUsageMetric> listUsageMetricsAsync()

Asynchronously lists the SQL database usage metrics.

abstract long maxSizeBytes()

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

abstract String parentId()

Gets the parent SQL server ID.

abstract Region region()

Gets the region the resource is in.

abstract String regionName()

Gets the name of the region the resource is in.

abstract SqlDatabase rename(String newDatabaseName)

Renames the database.

abstract Mono<SqlDatabase> renameAsync(String newDatabaseName)

Renames the database asynchronously.

abstract String requestedServiceObjectiveName()

Gets the name of the configured Service Level Objective of the Azure SQL Database.

abstract String sqlServerName()

Gets name of the SQL Server to which this database belongs.

abstract DatabaseStatus status()

Gets the status of the Azure SQL Database.

abstract SqlSyncGroupActionsDefinition syncGroups()

Gets the SQL Sync Group entry point for the current database.

Method Details

asWarehouse

public abstract SqlWarehouse asWarehouse()

Gets SqlWarehouse instance for more operations.

Returns:

SqlWarehouse instance for more operations

collation

public abstract String collation()

Gets the collation of the Azure SQL Database.

Returns:

the collation of the Azure SQL Database

creationDate

public abstract OffsetDateTime creationDate()

Gets the creation date of the Azure SQL Database.

Returns:

the creation date of the Azure SQL Database

currentServiceObjectiveName

public abstract String currentServiceObjectiveName()

Gets the current Service Level Objective Name of the Azure SQL Database.

Returns:

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

databaseId

public abstract String databaseId()

Gets the ID of the Azure SQL Database.

Returns:

the ID of the Azure SQL Database

defaultSecondaryLocation

public abstract String defaultSecondaryLocation()

Gets the default secondary location.

Returns:

the defaultSecondaryLocation value

defineThreatDetectionPolicy

public abstract SqlDatabaseThreatDetectionPolicy.DefinitionStages.Blank defineThreatDetectionPolicy(SecurityAlertPolicyName 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

defineThreatDetectionPolicy

@Deprecated
public abstract SqlDatabaseThreatDetectionPolicy.DefinitionStages.Blank defineThreatDetectionPolicy(String policyName)

Deprecated

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 abstract void delete()

Deletes the database from the server.

deleteAsync

public abstract Mono deleteAsync()

Deletes the database asynchronously.

Returns:

a representation of the deferred computation of this call

earliestRestoreDate

public abstract OffsetDateTime earliestRestoreDate()

Gets the recovery period start date of the Azure SQL Database.

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 abstract DatabaseEdition edition()

Gets the edition of the Azure SQL Database.

Returns:

the edition of the Azure SQL Database

elasticPoolId

public abstract String elasticPoolId()

Gets ID of the elastic pool.

Returns:

the elasticPoolId value

elasticPoolName

public abstract String elasticPoolName()

Gets name of the elastic pool.

Returns:

the elasticPoolName value

exportTo

public abstract 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 abstract 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 abstract 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 abstract SqlDatabaseAutomaticTuning getDatabaseAutomaticTuning()

Gets a SQL database automatic tuning state and options.

Returns:

the SQL database automatic tuning state and options

getThreatDetectionPolicy

public abstract SqlDatabaseThreatDetectionPolicy getThreatDetectionPolicy()

Gets a SQL database threat detection policy.

Returns:

the SQL database threat detection policy for the current database

getTransparentDataEncryption

public abstract 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 abstract Mono 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

importBacpac

public abstract 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 abstract 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 abstract boolean isDataWarehouse()

Checks whether this Database is SqlWarehouse.

Returns:

true if this Database is SqlWarehouse

listReplicationLinks

public abstract Map listReplicationLinks()

Gets all the replication links associated with this database.

Returns:

all the replication links associated with this database

listReplicationLinksAsync

public abstract PagedFlux listReplicationLinksAsync()

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

Returns:

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

listRestorePoints

public abstract List listRestorePoints()

Gets the list of all restore points on this database.

Returns:

the list of all restore points on this database

listRestorePointsAsync

public abstract PagedFlux listRestorePointsAsync()

Gets the list of all restore points on this database.

Returns:

the list of all restore points on this database

listUsageMetrics

public abstract List listUsageMetrics()

Lists the SQL database usage metrics.

Returns:

the SQL database usage metrics

listUsageMetricsAsync

public abstract PagedFlux listUsageMetricsAsync()

Asynchronously lists the SQL database usage metrics.

Returns:

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

maxSizeBytes

public abstract long maxSizeBytes()

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

Returns:

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

parentId

public abstract String parentId()

Gets the parent SQL server ID.

Returns:

the parent SQL server ID

region

public abstract Region region()

Gets the region the resource is in.

Returns:

the region the resource is in

regionName

public abstract String regionName()

Gets the name of the region the resource is in.

Returns:

the name of the region the resource is in

rename

public abstract SqlDatabase rename(String newDatabaseName)

Renames the database.

Parameters:

newDatabaseName - the new name for the database

Returns:

the renamed SQL database

renameAsync

public abstract Mono 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

requestedServiceObjectiveName

public abstract String requestedServiceObjectiveName()

Gets the name of the configured Service Level Objective of the Azure SQL Database.

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

sqlServerName

public abstract String sqlServerName()

Gets name of the SQL Server to which this database belongs.

Returns:

name of the SQL Server to which this database belongs

status

public abstract DatabaseStatus status()

Gets the status of the Azure SQL Database.

Returns:

the status of the Azure SQL Database

syncGroups

public abstract SqlSyncGroupOperations.SqlSyncGroupActionsDefinition syncGroups()

Gets the SQL Sync Group entry point for the current database.

Returns:

the SQL Sync Group entry point for the current database

Applies to