com.microsoft.azure.management.sql.SqlDatabase Maven / Gradle / Ivy
Show all versions of azure-mgmt-sql Show documentation
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.management.sql;
import com.microsoft.azure.management.apigeneration.Beta;
import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.apigeneration.Method;
import com.microsoft.azure.management.resources.fluentcore.arm.Region;
import com.microsoft.azure.management.resources.fluentcore.arm.models.ExternalChildResource;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasResourceGroup;
import com.microsoft.azure.management.resources.fluentcore.arm.models.Resource;
import com.microsoft.azure.management.resources.fluentcore.model.Appliable;
import com.microsoft.azure.management.resources.fluentcore.model.Attachable;
import com.microsoft.azure.management.resources.fluentcore.model.Creatable;
import com.microsoft.azure.management.resources.fluentcore.model.HasInner;
import com.microsoft.azure.management.resources.fluentcore.model.Refreshable;
import com.microsoft.azure.management.resources.fluentcore.model.Updatable;
import com.microsoft.azure.management.sql.implementation.DatabaseInner;
import com.microsoft.azure.management.storage.StorageAccount;
import org.joda.time.DateTime;
import rx.Completable;
import rx.Observable;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* An immutable client-side representation of an Azure SQL Server Database.
*/
@Fluent
@Beta(Beta.SinceVersion.V1_7_0)
public interface SqlDatabase
extends
ExternalChildResource,
HasInner,
HasResourceGroup,
Refreshable,
Updatable {
/**
* @return name of the SQL Server to which this database belongs
*/
String sqlServerName();
/**
* @return the collation of the Azure SQL Database
*/
String collation();
/**
* @return the creation date of the Azure SQL Database
*/
DateTime creationDate();
/**
* @return the current Service Level Objective Id of the Azure SQL Database, this is the Id of the
* Service Level Objective that is currently active
*/
UUID currentServiceObjectiveId();
/**
* @return the Id of the Azure SQL Database
*/
String databaseId();
/**
* @return 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.
*/
DateTime earliestRestoreDate();
/**
* @return the edition of the Azure SQL Database
*/
DatabaseEdition edition();
/**
*
* @return 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
*/
UUID requestedServiceObjectiveId();
/**
* @return the max size of the Azure SQL Database expressed in bytes.
*/
long maxSizeBytes();
/**
* @return 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
*/
ServiceObjectiveName requestedServiceObjectiveName();
/**
* @return the Service Level Objective of the Azure SQL Database.
*/
ServiceObjectiveName serviceLevelObjective();
/**
* @return the status of the Azure SQL Database
*/
String status();
/**
* @return the elasticPoolName value
*/
String elasticPoolName();
/**
* @return the defaultSecondaryLocation value
*/
String defaultSecondaryLocation();
/**
* @return the parent SQL server ID
*/
String parentId();
/**
* @return the name of the region the resource is in
*/
String regionName();
/**
* @return the region the resource is in
*/
Region region();
/**
* @return true if this Database is SqlWarehouse
*/
boolean isDataWarehouse();
/**
* @return SqlWarehouse instance for more operations
*/
@Method
SqlWarehouse asWarehouse();
/**
* @return the list of all restore points on this database
*/
@Method
List listRestorePoints();
/**
* @return the list of all restore points on this database
*/
@Method
@Beta(Beta.SinceVersion.V1_7_0)
Observable listRestorePointsAsync();
/**
* @return the list of usages (DatabaseMetrics) of this database
*/
@Method
@Deprecated
List listUsages();
/**
* @param filter an OData filter expression that describes a subset of metrics to return.
* @return the list of metrics for this database
*/
@Method
@Beta(Beta.SinceVersion.V1_7_0)
List listMetrics(String filter);
/**
* @param filter an OData filter expression that describes a subset of metrics to return.
* @return a representation of the deferred computation of the metrics for this database
*/
@Method
@Beta(Beta.SinceVersion.V1_7_0)
Observable listMetricsAsync(String filter);
/**
* @return the list of metric definitions for this database
*/
@Method
@Beta(Beta.SinceVersion.V1_7_0)
List listMetricDefinitions();
/**
* @return a representation of the deferred computation of the metric definitions for this database
*/
@Method
@Beta(Beta.SinceVersion.V1_7_0)
Observable listMetricDefinitionsAsync();
/**
* Gets an Azure SQL Database Transparent Data Encryption for this database.
*
* @return an Azure SQL Database Transparent Data Encryption for this database
*/
@Method
TransparentDataEncryption getTransparentDataEncryption();
/**
* Gets an Azure SQL Database Transparent Data Encryption for this database.
*
* @return a representation of the deferred computation of an Azure SQL Database Transparent Data Encryption for this database
*/
@Method
@Beta(Beta.SinceVersion.V1_7_0)
Observable getTransparentDataEncryptionAsync();
/**
* @return information about service tier advisors for the current database
*/
@Method
Map listServiceTierAdvisors();
/**
* @return a representation of the deferred computation of the information about service tier advisors for this database
*/
@Method
@Beta(Beta.SinceVersion.V1_7_0)
Observable listServiceTierAdvisorsAsync();
/**
* @return all the replication links associated with this database
*/
@Method
Map listReplicationLinks();
/**
* @return a representation of the deferred computation of all the replication links associated with this database
*/
@Method
@Beta(Beta.SinceVersion.V1_7_0)
Observable listReplicationLinksAsync();
/**
* Exports the current database to a specified URI path.
*
* @param storageUri the storage URI to use
* @return response object
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabaseExportRequest.DefinitionStages.WithStorageTypeAndKey exportTo(String storageUri);
/**
* Exports the current database to an existing storage account and relative path.
*
* @param storageAccount an existing storage account to be used
* @param containerName the container name within the storage account to use
* @param fileName the exported database file name
* @return response object
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabaseExportRequest.DefinitionStages.WithAuthenticationTypeAndLoginPassword exportTo(StorageAccount storageAccount, String containerName, String fileName);
/**
* Exports the current database to a new storage account and relative path.
*
* @param storageAccountCreatable a storage account to be created as part of this execution flow
* @param containerName the container name within the storage account to use
* @param fileName the exported database file name
* @return response object
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabaseExportRequest.DefinitionStages.WithAuthenticationTypeAndLoginPassword exportTo(Creatable storageAccountCreatable, String containerName, String fileName);
/**
* Imports into the current database from a specified URI path; the current database must be empty.
*
* @param storageUri the storage URI to use
* @return response object
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabaseImportRequest.DefinitionStages.WithStorageTypeAndKey importBacpac(String storageUri);
/**
* Imports into the current database from an existing storage account and relative path; the current database must be empty.
*
* @param storageAccount an existing storage account to be used
* @param containerName the container name within the storage account to use
* @param fileName the exported database file name
* @return response object
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabaseImportRequest.DefinitionStages.WithAuthenticationTypeAndLoginPassword importBacpac(StorageAccount storageAccount, String containerName, String fileName);
/**
* Begins a definition for a security alert policy.
*
* @param policyName the name of the security alert policy
* @return the first stage of the SqlDatabaseThreatDetectionPolicy definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabaseThreatDetectionPolicy.DefinitionStages.Blank defineThreatDetectionPolicy(String policyName);
/**
* Gets a SQL database threat detection policy.
*
* @return the SQL database threat detection policy for the current database
*/
@Method
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabaseThreatDetectionPolicy getThreatDetectionPolicy();
/**
* Gets a SQL database automatic tuning state and options.
*
* @return the SQL database automatic tuning state and options
*/
@Method
@Beta(Beta.SinceVersion.V1_8_0)
SqlDatabaseAutomaticTuning getDatabaseAutomaticTuning();
/**
* Lists the SQL database usage metrics.
*
* @return the SQL database usage metrics
*/
@Method
@Beta(Beta.SinceVersion.V1_8_0)
List listUsageMetrics();
/**
* Asynchronously lists the SQL database usage metrics.
*
* @return a representation of the deferred computation of this call returning the SQL database usage metrics
*/
@Method
@Beta(Beta.SinceVersion.V1_8_0)
Observable listUsageMetricsAsync();
/**
* Renames the database.
*
* @param newDatabaseName the new name for the database
* @return the renamed SQL database
*/
@Method
@Beta(Beta.SinceVersion.V1_8_0)
SqlDatabase rename(String newDatabaseName);
/**
* Renames the database asynchronously.
*
* @param newDatabaseName the new name for the database
* @return a representation of the deferred computation of this call
*/
@Method
@Beta(Beta.SinceVersion.V1_8_0)
Observable renameAsync(String newDatabaseName);
/**
* Deletes the database from the server.
*/
@Method
void delete();
/**
* Deletes the database asynchronously.
*
* @return a representation of the deferred computation of this call
*/
@Method
@Beta(Beta.SinceVersion.V1_7_0)
Completable deleteAsync();
/**
* @return the SQL Sync Group entry point for the current database
*/
@Beta(Beta.SinceVersion.V1_9_0)
SqlSyncGroupOperations.SqlSyncGroupActionsDefinition syncGroups();
/**************************************************************
* Fluent interfaces to provision a SQL Database
**************************************************************/
/**
* Container interface for all the definitions that need to be implemented.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface SqlDatabaseDefinition extends
SqlDatabase.DefinitionStages.Blank,
SqlDatabase.DefinitionStages.WithAllDifferentOptions,
SqlDatabase.DefinitionStages.WithElasticPoolName,
SqlDatabase.DefinitionStages.WithRestorableDroppedDatabase,
SqlDatabase.DefinitionStages.WithImportFrom,
SqlDatabase.DefinitionStages.WithStorageKey,
SqlDatabase.DefinitionStages.WithAuthentication,
SqlDatabase.DefinitionStages.WithRestorePointDatabase,
SqlDatabase.DefinitionStages.WithSourceDatabaseId,
SqlDatabase.DefinitionStages.WithCreateMode,
SqlDatabase.DefinitionStages.WithAttachAllOptions,
SqlDatabase.DefinitionStages.WithAttachFinal {
}
/**
* Grouping of all the SQL Database definition stages.
*/
interface DefinitionStages {
/**
* The first stage of the SQL Server Firewall rule definition.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface Blank extends
SqlDatabase.DefinitionStages.WithAllDifferentOptions {
}
/**
* The SQL database interface with all starting options for definition.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
interface WithAllDifferentOptions extends
SqlDatabase.DefinitionStages.WithElasticPoolName,
SqlDatabase.DefinitionStages.WithRestorableDroppedDatabase,
SqlDatabase.DefinitionStages.WithImportFrom,
SqlDatabase.DefinitionStages.WithRestorePointDatabase,
SqlDatabase.DefinitionStages.WithSampleDatabase,
SqlDatabase.DefinitionStages.WithSourceDatabaseId,
SqlDatabase.DefinitionStages.WithEditionDefaults,
SqlDatabase.DefinitionStages.WithAttachAllOptions {
}
/**
* The SQL Database definition to set the elastic pool for database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithElasticPoolName {
/**
* Sets the existing elastic pool for the SQLDatabase.
*
* @param elasticPoolName for the SQL Database
* @return The next stage of the definition.
*/
WithExistingDatabaseAfterElasticPool withExistingElasticPool(String elasticPoolName);
/**
* Sets the existing elastic pool for the SQLDatabase.
*
* @param sqlElasticPool for the SQL Database
* @return The next stage of the definition.
*/
WithExistingDatabaseAfterElasticPool withExistingElasticPool(SqlElasticPool sqlElasticPool);
/**
* Sets the new elastic pool for the SQLDatabase, this will create a new elastic pool while creating database.
*
* @param sqlElasticPool creatable definition for new elastic pool to be created for the SQL Database
* @return The next stage of the definition.
*/
WithExistingDatabaseAfterElasticPool withNewElasticPool(Creatable sqlElasticPool);
}
/**
* The stage to decide whether using existing database or not.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithExistingDatabaseAfterElasticPool extends
SqlDatabase.DefinitionStages.WithImportFromAfterElasticPool,
SqlDatabase.DefinitionStages.WithRestorePointDatabaseAfterElasticPool,
SqlDatabase.DefinitionStages.WithSampleDatabaseAfterElasticPool,
SqlDatabase.DefinitionStages.WithSourceDatabaseId,
SqlDatabase.DefinitionStages.WithAttachAfterElasticPoolOptions {
}
/**
* The SQL Database definition to import a BACPAC file as the source database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithImportFrom {
/**
* Creates a new database from a BACPAC file.
*
* @param storageUri the source URI for the database to be imported
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithStorageKey importFrom(String storageUri);
/**
* Creates a new database from a BACPAC file.
*
* @param storageAccount an existing storage account to be used
* @param containerName the container name within the storage account to use
* @param fileName the exported database file name
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAuthentication importFrom(StorageAccount storageAccount, String containerName, String fileName);
}
/**
* Sets the storage key type and value to use.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithStorageKey {
/**
* @param storageAccessKey the storage access key to use
* @return next definition stage
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAuthentication withStorageAccessKey(String storageAccessKey);
/**
* @param sharedAccessKey the shared access key to use; it must be preceded with a "?."
* @return next definition stage
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAuthentication withSharedAccessKey(String sharedAccessKey);
}
/**
* Sets the authentication type and SQL or Active Directory administrator login and password.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithAuthentication {
/**
* @param administratorLogin the SQL administrator login
* @param administratorPassword the SQL administrator password
* @return next definition stage
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAttachAllOptions withSqlAdministratorLoginAndPassword(String administratorLogin, String administratorPassword);
/**
* @param administratorLogin the Active Directory administrator login
* @param administratorPassword the Active Directory administrator password
* @return next definition stage
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAttachAllOptions withActiveDirectoryLoginAndPassword(String administratorLogin, String administratorPassword);
}
/**
* The SQL Database definition to import a BACPAC file as the source database within an elastic pool.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithImportFromAfterElasticPool {
/**
* Creates a new database from a BACPAC file.
*
* @param storageUri the source URI for the database to be imported
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithStorageKeyAfterElasticPool importFrom(String storageUri);
/**
* Creates a new database from a BACPAC file.
*
* @param storageAccount an existing storage account to be used
* @param containerName the container name within the storage account to use
* @param fileName the exported database file name
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAuthenticationAfterElasticPool importFrom(StorageAccount storageAccount, String containerName, String fileName);
}
/**
* Sets the storage key type and value to use.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithStorageKeyAfterElasticPool {
/**
* @param storageAccessKey the storage access key to use
* @return next definition stage
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAuthenticationAfterElasticPool withStorageAccessKey(String storageAccessKey);
/**
* @param sharedAccessKey the shared access key to use; it must be preceded with a "?."
* @return next definition stage
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAuthenticationAfterElasticPool withSharedAccessKey(String sharedAccessKey);
}
/**
* Sets the authentication type and SQL or Active Directory administrator login and password.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithAuthenticationAfterElasticPool {
/**
* @param administratorLogin the SQL administrator login
* @param administratorPassword the SQL administrator password
* @return next definition stage
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAttachFinal withSqlAdministratorLoginAndPassword(String administratorLogin, String administratorPassword);
/**
* @param administratorLogin the Active Directory administrator login
* @param administratorPassword the Active Directory administrator password
* @return next definition stage
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAttachFinal withActiveDirectoryLoginAndPassword(String administratorLogin, String administratorPassword);
}
/**
* The SQL Database definition to set a restorable dropped database as the source database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithRestorableDroppedDatabase {
/**
* Creates a new database from a previously deleted database (see restorable dropped database).
*
* Collation, Edition, and MaxSizeBytes must remain the same while the link is
* active. Values specified for these parameters will be ignored.
*
* @param restorableDroppedDatabase the restorable dropped database
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAttachFinal fromRestorableDroppedDatabase(SqlRestorableDroppedDatabase restorableDroppedDatabase);
}
/**
* The SQL Database definition to set a restore point as the source database within an elastic pool.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithRestorePointDatabaseAfterElasticPool {
/**
* Creates a new database from a restore point.
*
* @param restorePoint the restore point
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAttachAfterElasticPoolOptions fromRestorePoint(RestorePoint restorePoint);
/**
* Creates a new database from a restore point.
*
* @param restorePoint the restore point
* @param restorePointDateTime date and time to restore from
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_8_0)
SqlDatabase.DefinitionStages.WithAttachAfterElasticPoolOptions fromRestorePoint(RestorePoint restorePoint, DateTime restorePointDateTime);
}
/**
* The SQL Database definition to set a restore point as the source database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithRestorePointDatabase {
/**
* Creates a new database from a restore point.
*
* @param restorePoint the restore point
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAttachAllOptions fromRestorePoint(RestorePoint restorePoint);
/**
* Creates a new database from a restore point.
*
* @param restorePoint the restore point
* @param restorePointDateTime date and time to restore from
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_8_0)
SqlDatabase.DefinitionStages.WithAttachAllOptions fromRestorePoint(RestorePoint restorePoint, DateTime restorePointDateTime);
}
/**
* The SQL Database definition to set a sample database as the source database within an elastic pool.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithSampleDatabaseAfterElasticPool {
/**
* Creates a new database from a restore point.
*
* @param sampleName the sample database to use as the source
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAttachAfterElasticPoolOptions fromSample(SampleName sampleName);
}
/**
* The SQL Database definition to set a sample database as the source database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithSampleDatabase {
/**
* Creates a new database from a restore point.
*
* @param sampleName the sample database to use as the source
* @return The next stage of the definition.
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithAttachAllOptions fromSample(SampleName sampleName);
}
/**
* The SQL Database definition to set the source database id for database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithSourceDatabaseId {
/**
* Sets the resource if of source database for the SQL Database.
*
* Collation, Edition, and MaxSizeBytes must remain the same while the link is
* active. Values specified for these parameters will be ignored.
*
* @param sourceDatabaseId id of the source database
* @return The next stage of the definition.
*/
SqlDatabase.DefinitionStages.WithCreateMode withSourceDatabase(String sourceDatabaseId);
/**
* Sets the resource if of source database for the SQL Database.
*
* Collation, Edition, and MaxSizeBytes must remain the same while the link is
* active. Values specified for these parameters will be ignored.
*
* @param sourceDatabase instance of the source database
* @return The next stage of the definition.
*/
SqlDatabase.DefinitionStages.WithCreateMode withSourceDatabase(SqlDatabase sourceDatabase);
}
/**
* The SQL Database definition to set the create mode for database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithCreateMode {
/**
* Sets the create mode for the SQL Database.
*
* @param createMode create mode for the database, should not be default in this flow
* @return The next stage of the definition.
*/
SqlDatabase.DefinitionStages.WithAttachFinal withMode(CreateMode createMode);
}
/**
* The final stage of the SQL Database definition after the SQL Elastic Pool definition.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithAttachAfterElasticPoolOptions extends
SqlDatabase.DefinitionStages.WithCollationAfterElasticPoolOptions,
SqlDatabase.DefinitionStages.WithMaxSizeBytesAfterElasticPoolOptions,
SqlDatabase.DefinitionStages.WithAttachFinal {
}
/**
* The SQL Database definition to set the collation for database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithCollationAfterElasticPoolOptions {
/**
* Sets the collation for the SQL Database.
*
* @param collation collation to be set for database
* @return The next stage of the definition
*/
SqlDatabase.DefinitionStages.WithAttachAfterElasticPoolOptions withCollation(String collation);
}
/**
* The SQL Database definition to set the Max Size in Bytes for database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithMaxSizeBytesAfterElasticPoolOptions {
/**
* Sets the max size in bytes for SQL Database.
*
* @param maxSizeBytes max size of the Azure SQL Database expressed in bytes. Note: Only
* the following sizes are supported (in addition to limitations being
* placed on each edition): { 100 MB | 500 MB |1 GB | 5 GB | 10 GB | 20
* GB | 30 GB … 150 GB | 200 GB … 500 GB }
* @return The next stage of the definition.
*/
SqlDatabase.DefinitionStages.WithAttachAfterElasticPoolOptions withMaxSizeBytes(long maxSizeBytes);
}
/**
* The SQL Database definition to set the edition for database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithEdition {
/**
* Sets the edition for the SQL Database.
*
* @param edition edition to be set for database
* @return The next stage of the definition
*/
@Deprecated
SqlDatabase.DefinitionStages.WithAttachAllOptions withEdition(DatabaseEdition edition);
}
/**
* The SQL Database definition to set the edition default for database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithEditionDefaults extends WithAttachFinal {
/**
* Sets a "Basic" edition for the SQL Database.
*
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithEditionDefaults withBasicEdition();
/**
* Sets a "Basic" edition and maximum storage capacity for the SQL Database.
*
* @param maxStorageCapacity the max storage capacity
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithEditionDefaults withBasicEdition(SqlDatabaseBasicStorage maxStorageCapacity);
/**
* Sets a "Standard" edition for the SQL Database.
*
* @param serviceObjective edition to be set for database
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithEditionDefaults withStandardEdition(SqlDatabaseStandardServiceObjective serviceObjective);
/**
* Sets a "Standard" edition and maximum storage capacity for the SQL Database.
*
* @param serviceObjective edition to be set for database
* @param maxStorageCapacity edition to be set for database
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithEditionDefaults withStandardEdition(SqlDatabaseStandardServiceObjective serviceObjective, SqlDatabaseStandardStorage maxStorageCapacity);
/**
* Sets a "Premium" edition for the SQL Database.
*
* @param serviceObjective edition to be set for database
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithEditionDefaults withPremiumEdition(SqlDatabasePremiumServiceObjective serviceObjective);
/**
* Sets a "Premium" edition and maximum storage capacity for the SQL Database.
*
* @param serviceObjective edition to be set for database
* @param maxStorageCapacity edition to be set for database
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
SqlDatabase.DefinitionStages.WithEditionDefaults withPremiumEdition(SqlDatabasePremiumServiceObjective serviceObjective, SqlDatabasePremiumStorage maxStorageCapacity);
/**
* The SQL Database definition to set the collation for database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithCollation {
/**
* Sets the collation for the SQL Database.
*
* @param collation collation to be set for database
* @return The next stage of the definition
*/
SqlDatabase.DefinitionStages.WithEditionDefaults withCollation(String collation);
}
}
/**
* The SQL Database definition to set the collation for database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithCollation {
/**
* Sets the collation for the SQL Database.
*
* @param collation collation to be set for database
* @return The next stage of the definition
*/
SqlDatabase.DefinitionStages.WithAttachAllOptions withCollation(String collation);
}
/**
* The SQL Database definition to set the Max Size in Bytes for database.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithMaxSizeBytes {
/**
* Sets the max size in bytes for SQL Database.
*
* @param maxSizeBytes max size of the Azure SQL Database expressed in bytes. Note: Only
* the following sizes are supported (in addition to limitations being
* placed on each edition): { 100 MB | 500 MB |1 GB | 5 GB | 10 GB | 20
* GB | 30 GB … 150 GB | 200 GB … 500 GB }
* @return The next stage of the definition.
*/
@Deprecated
SqlDatabase.DefinitionStages.WithAttachAllOptions withMaxSizeBytes(long maxSizeBytes);
}
/**
* The SQL Database definition to set the service level objective.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithServiceObjective {
/**
* Sets the service level objective for the SQL Database.
*
* @param serviceLevelObjective service level objected for the SQL Database
* @return The next stage of the definition.
*/
@Deprecated
SqlDatabase.DefinitionStages.WithAttachAllOptions withServiceObjective(ServiceObjectiveName serviceLevelObjective);
}
/**
* The final stage of the SQL Database definition with all the other options.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithAttachAllOptions extends
SqlDatabase.DefinitionStages.WithServiceObjective,
SqlDatabase.DefinitionStages.WithEdition,
SqlDatabase.DefinitionStages.WithEditionDefaults,
SqlDatabase.DefinitionStages.WithCollation,
SqlDatabase.DefinitionStages.WithMaxSizeBytes,
SqlDatabase.DefinitionStages.WithAttachFinal {
}
/** The final stage of the SQL Database definition.
*
* At this stage, any remaining optional settings can be specified, or the SQL Database definition
* can be attached to the parent SQL Server definition.
*
* @param the stage of the parent definition to return to after attaching this definition
*/
interface WithAttachFinal extends
Attachable.InDefinition {
}
}
/**
* The template for a SqlDatabase update operation, containing all the settings that can be modified.
*/
interface Update extends
UpdateStages.WithEdition,
UpdateStages.WithElasticPoolName,
UpdateStages.WithMaxSizeBytes,
UpdateStages.WithServiceObjective,
Resource.UpdateWithTags,
Appliable {
}
/**
* Grouping of all the SqlDatabase update stages.
*/
interface UpdateStages {
/**
* The SQL Database definition to set the edition for database.
*/
interface WithEdition {
/**
* Sets the edition for the SQL Database.
*
* @param edition edition to be set for database
* @return The next stage of the update.
*/
@Deprecated
Update withEdition(DatabaseEdition edition);
/**
* Sets a "Basic" edition for the SQL Database.
*
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
Update withBasicEdition();
/**
* Sets a "Basic" edition and maximum storage capacity for the SQL Database.
*
* @param maxStorageCapacity the max storage capacity
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
Update withBasicEdition(SqlDatabaseBasicStorage maxStorageCapacity);
/**
* Sets a "Standard" edition for the SQL Database.
*
* @param serviceObjective edition to be set for database
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
Update withStandardEdition(SqlDatabaseStandardServiceObjective serviceObjective);
/**
* Sets a "Standard" edition and maximum storage capacity for the SQL Database.
*
* @param serviceObjective edition to be set for database
* @param maxStorageCapacity edition to be set for database
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
Update withStandardEdition(SqlDatabaseStandardServiceObjective serviceObjective, SqlDatabaseStandardStorage maxStorageCapacity);
/**
* Sets a "Premium" edition for the SQL Database.
*
* @param serviceObjective edition to be set for database
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
Update withPremiumEdition(SqlDatabasePremiumServiceObjective serviceObjective);
/**
* Sets a "Premium" edition and maximum storage capacity for the SQL Database.
*
* @param serviceObjective edition to be set for database
* @param maxStorageCapacity edition to be set for database
* @return The next stage of the definition
*/
@Beta(Beta.SinceVersion.V1_7_0)
Update withPremiumEdition(SqlDatabasePremiumServiceObjective serviceObjective, SqlDatabasePremiumStorage maxStorageCapacity);
}
/**
* The SQL Database definition to set the Max Size in Bytes for database.
*/
interface WithMaxSizeBytes {
/**
* Sets the max size in bytes for SQL Database.
* @param maxSizeBytes max size of the Azure SQL Database expressed in bytes. Note: Only
* the following sizes are supported (in addition to limitations being
* placed on each edition): { 100 MB | 500 MB |1 GB | 5 GB | 10 GB | 20
* GB | 30 GB … 150 GB | 200 GB … 500 GB }
* @return The next stage of the update.
*/
@Deprecated
Update withMaxSizeBytes(long maxSizeBytes);
}
/**
* The SQL Database definition to set the service level objective.
*/
interface WithServiceObjective {
/**
* Sets the service level objective for the SQL Database.
*
* @param serviceLevelObjective service level objected for the SQL Database
* @return The next stage of the update.
*/
@Deprecated
Update withServiceObjective(ServiceObjectiveName serviceLevelObjective);
}
/**
* The SQL Database definition to set the elastic pool for database.
*/
interface WithElasticPoolName {
/**
* Removes database from it's elastic pool.
*
* @return The next stage of the update.
*/
WithEdition withoutElasticPool();
/**
* Sets the existing elastic pool for the SQLDatabase.
*
* @param elasticPoolName for the SQL Database
* @return The next stage of the update.
*/
Update withExistingElasticPool(String elasticPoolName);
/**
* Sets the existing elastic pool for the SQLDatabase.
*
* @param sqlElasticPool for the SQL Database
* @return The next stage of the update.
*/
Update withExistingElasticPool(SqlElasticPool sqlElasticPool);
/**
* Sets the new elastic pool for the SQLDatabase, this will create a new elastic pool while creating database.
*
* @param sqlElasticPool creatable definition for new elastic pool to be created for the SQL Database
* @return The next stage of the update.
*/
Update withNewElasticPool(Creatable sqlElasticPool);
}
}
}