Search in sources :

Example 6 with SqlDatabase

use of com.microsoft.azure.management.sql.SqlDatabase in project azure-sdk-for-java by Azure.

the class SqlDatabaseImpl method createChildResourceAsync.

@Override
protected Observable<SqlDatabase> createChildResourceAsync() {
    final SqlDatabaseImpl self = this;
    if (this.elasticPoolCreatableKey != null) {
        SqlElasticPool sqlElasticPool = (SqlElasticPool) this.createdResource(this.elasticPoolCreatableKey);
        withExistingElasticPool(sqlElasticPool);
    }
    if (this.inner().elasticPoolName() != null && !this.inner().elasticPoolName().isEmpty()) {
        this.inner().withEdition(new DatabaseEditions(""));
        this.inner().withRequestedServiceObjectiveName(new ServiceObjectiveName(""));
        this.inner().withRequestedServiceObjectiveId(null);
    }
    return this.manager().inner().databases().createOrUpdateAsync(this.resourceGroupName(), this.sqlServerName(), this.name(), this.inner()).map(new Func1<DatabaseInner, SqlDatabase>() {

        @Override
        public SqlDatabase call(DatabaseInner databaseInner) {
            setInner(databaseInner);
            self.elasticPoolCreatableKey = null;
            return self;
        }
    });
}
Also used : ServiceObjectiveName(com.microsoft.azure.management.sql.ServiceObjectiveName) SqlDatabase(com.microsoft.azure.management.sql.SqlDatabase) SqlElasticPool(com.microsoft.azure.management.sql.SqlElasticPool) DatabaseEditions(com.microsoft.azure.management.sql.DatabaseEditions)

Aggregations

SqlDatabase (com.microsoft.azure.management.sql.SqlDatabase)6 SqlServer (com.microsoft.azure.management.sql.SqlServer)5 WebApp (com.microsoft.azure.management.appservice.WebApp)2 SqlElasticPool (com.microsoft.azure.management.sql.SqlElasticPool)2 SqlFirewallRule (com.microsoft.azure.management.sql.SqlFirewallRule)2 VirtualMachine (com.microsoft.azure.management.compute.VirtualMachine)1 Network (com.microsoft.azure.management.network.Network)1 PublicIPAddress (com.microsoft.azure.management.network.PublicIPAddress)1 Region (com.microsoft.azure.management.resources.fluentcore.arm.Region)1 Creatable (com.microsoft.azure.management.resources.fluentcore.model.Creatable)1 DatabaseEditions (com.microsoft.azure.management.sql.DatabaseEditions)1 ElasticPoolActivity (com.microsoft.azure.management.sql.ElasticPoolActivity)1 ElasticPoolDatabaseActivity (com.microsoft.azure.management.sql.ElasticPoolDatabaseActivity)1 ElasticPoolEditions (com.microsoft.azure.management.sql.ElasticPoolEditions)1 ServiceObjectiveName (com.microsoft.azure.management.sql.ServiceObjectiveName)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1