예제 #1
0
        ///GENMHASH:9557699E7EE892CCCC89A074E0915333:A55D3CBCED3C2D7241CB8E96C4D3F217
        public async Task BeforeGroupCreateOrUpdateAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            if (this.importRequestInner != null && this.storageAccount != null)
            {
                var storageKeys = await storageAccount.GetKeysAsync(cancellationToken);

                if (storageKeys == null || storageKeys.Count == 0)
                {
                    throw new Exception("Failed to retrieve Storage Account Keys");
                }
                var storageAccountKey = storageKeys[0].Value;
                this.importRequestInner.StorageUri     = $"{this.storageAccount?.EndPoints?.Primary?.Blob}{this.importRequestInner.StorageUri}";
                this.importRequestInner.StorageKeyType = StorageKeyType.StorageAccessKey;
                this.importRequestInner.StorageKey     = storageAccountKey;
            }

            if (this.sqlElasticPoolCreatable != null)
            {
                this.parentSqlElasticPool = (SqlElasticPoolImpl)await this.sqlElasticPoolCreatable.CreateAsync(cancellationToken);
            }
            else if (this.Inner.ElasticPoolName != null && this.importRequestInner != null)
            {
                this.parentSqlElasticPool = (SqlElasticPoolImpl)await this.sqlServerManager.SqlServers.ElasticPools
                                            .GetBySqlServerAsync(this.resourceGroupName, this.sqlServerName, this.Inner.ElasticPoolName, cancellationToken);
            }
        }
예제 #2
0
        ///GENMHASH:4A64D79C205DE76E07E6A3581CF5E14B:D4B4008CD0FC6AC7097FB9303C5C92E3
        public SqlElasticPoolImpl DefineElasticPool(string name)
        {
            var elasticPoolItem = new SqlElasticPoolImpl(name, this, new ElasticPoolInner(), this.Manager);

            this.sqlElasticPoolsToCreateOrUpdate.Add(elasticPoolItem);
            return(elasticPoolItem);
        }
예제 #3
0
        ///GENMHASH:15C6DE336A70D5E1EDFAC74C3066EED7:9C29DD32907A6122759FBE531E3E19EA
        public SqlServerImpl WithNewElasticPool(string elasticPoolName, ElasticPoolEdition elasticPoolEdition)
        {
            var elasticPoolItem = new SqlElasticPoolImpl(elasticPoolName, this, new ElasticPoolInner(), this.Manager);

            elasticPoolItem.WithEdition(elasticPoolEdition);
            this.sqlElasticPoolsToCreateOrUpdate.Add(elasticPoolItem);
            return(this);
        }
예제 #4
0
 ///GENMHASH:4A64D79C205DE76E07E6A3581CF5E14B:1A9338236EC82827DA9F8F8293BE39FE
 public SqlElasticPoolForDatabaseImpl DefineElasticPool(string elasticPoolName)
 {
     this.parentSqlElasticPool                = new SqlElasticPoolImpl(this.resourceGroupName, this.sqlServerName, this.sqlServerLocation, elasticPoolName, new ElasticPoolInner(), this.sqlServerManager);
     this.sqlElasticPoolCreatable             = this.parentSqlElasticPool;
     this.Inner.Edition                       = null;
     this.Inner.RequestedServiceObjectiveId   = null;
     this.Inner.RequestedServiceObjectiveName = null;
     this.Inner.ElasticPoolName               = elasticPoolName;
     return(new SqlElasticPoolForDatabaseImpl(this, this.parentSqlElasticPool));
 }
예제 #5
0
 ///GENMHASH:94B2A7575EE3CF64212EB088C1EFC127:589F854B24F8D93EDC08EE794DA63869
 internal SqlDatabaseForElasticPoolImpl(SqlElasticPoolImpl sqlElasticPool, SqlDatabaseImpl sqlDatabase)
 {
     this.sqlDatabase    = sqlDatabase ?? throw new ArgumentNullException("sqlDatabase");
     this.sqlElasticPool = sqlElasticPool ?? throw new ArgumentNullException("sqlElasticPool");
     if (sqlDatabase.Inner == null)
     {
         throw new ArgumentNullException("sqlDatabase.Inner");
     }
     this.sqlDatabase.Inner.Location                      = this.sqlElasticPool.RegionName();
     this.sqlDatabase.Inner.ElasticPoolName               = this.sqlElasticPool.Name();
     this.sqlDatabase.Inner.Edition                       = null;
     this.sqlDatabase.Inner.RequestedServiceObjectiveId   = null;
     this.sqlDatabase.Inner.RequestedServiceObjectiveName = null;
 }
예제 #6
0
        ///GENMHASH:495111B1D55D7AA3C4EA4E49042FA05A:018B4F53394EF9D955345603E5AF968D
        public SqlDatabaseImpl WithNewElasticPool(ICreatable <Microsoft.Azure.Management.Sql.Fluent.ISqlElasticPool> sqlElasticPool)
        {
            if (sqlElasticPool == null)
            {
                throw new ArgumentNullException("sqlElasticPool");
            }
            this.sqlElasticPoolCreatable             = sqlElasticPool;
            this.parentSqlElasticPool                = (SqlElasticPoolImpl)sqlElasticPool;
            this.Inner.Edition                       = null;
            this.Inner.RequestedServiceObjectiveId   = null;
            this.Inner.RequestedServiceObjectiveName = null;
            this.Inner.ElasticPoolName               = parentSqlElasticPool.Name();

            // future dependency tracking note
            //$ this.AddDependency(sqlElasticPool);

            return(this);
        }
 ///GENMHASH:99B56B1A2FDEAC4D03C59DAC1D782ED1:E4E38E8B6802746236C5E7DCE3C6C88C
 internal SqlElasticPoolForDatabaseImpl(SqlDatabaseImpl sqlDatabase, SqlElasticPoolImpl sqlElasticPool)
 {
     this.sqlDatabase    = sqlDatabase ?? throw new ArgumentNullException("sqlDatabase");
     this.sqlElasticPool = sqlElasticPool ?? throw new ArgumentNullException("sqlElasticPool");
 }
예제 #8
0
        ///GENMHASH:8ACFB0E23F5F24AD384313679B65F404:CEB5A71557A5E0E3652D4FFCD5033B00
        public SqlElasticPoolImpl Define(string name)
        {
            SqlElasticPoolImpl result = new SqlElasticPoolImpl(name, new Models.ElasticPoolInner(), this.sqlServerManager);

            return((this.sqlServer != null) ? result.WithExistingSqlServer(this.sqlServer) : result);
        }