/// <summary> /// Creates an instance of external child resource in-memory. /// </summary> /// <param name="name">The name of this external child resource.</param> /// <param name="innerObject">Reference to the inner object representing this external child resource.</param> /// <param name="sqlServerManager">Reference to the SQL server manager that accesses firewall rule operations.</param> ///GENMHASH:F958650D21263F491EB84C4B1B980363:F9DB363750091A34604F0E5CF4D066EE internal SqlDatabaseImpl(string name, DatabaseInner innerObject, ISqlManager sqlServerManager) : base(innerObject, null) { this.name = name; this.sqlServerManager = sqlServerManager ?? throw new ArgumentNullException("sqlServerManager"); this.isPatchUpdate = false; this.importRequestInner = null; }
///GENMHASH:AC7CC07C6D6A5043B63254841EEBA63A:7F7F8CAB431C433CEC91CF27F54FEFFD public async Task AfterPostRunAsync(CancellationToken cancellationToken = default(CancellationToken)) { if (this.importRequestInner != null && this.parentSqlElasticPool != null) { this.isPatchUpdate = true; await this.UpdateResourceAsync(cancellationToken); } this.isPatchUpdate = false; this.importRequestInner = null; this.storageAccount = null; this.sqlElasticPoolCreatable = null; }
///GENMHASH:6440992F4CBC2FF2069B36419334D933:F5264B18EE7543F8EA9233154894DE3C private void InitializeImportRequestInner() { this.importRequestInner = new ImportRequestInner(); if (this.ElasticPoolName() != null) { this.importRequestInner.Edition = DatabaseEditions.Standard; this.importRequestInner.ServiceObjectiveName = ServiceObjectiveName.S0; this.importRequestInner.MaxSizeBytes = $"{(long)SqlDatabaseStandardStorage.Max250Gb}"; } else { this.WithStandardEdition(SqlDatabaseStandardServiceObjective.S0); } }
/// <summary> /// Creates an instance of external child resource in-memory. /// </summary> /// <param name="name">The name of this external child resource.</param> /// <param name="parent">Reference to the parent of this external child resource.</param> /// <param name="innerObject">Reference to the inner object representing this external child resource.</param> /// <param name="sqlServerManager">Reference to the SQL server manager that accesses firewall rule operations.</param> ///GENMHASH:A35E7EC57FEC5C249FB11AEB50216560:C7DB22944BBAB9F9EBF4DC3ECB3D4098 internal SqlDatabaseImpl(string name, SqlServerImpl parent, DatabaseInner innerObject, ISqlManager sqlServerManager) : base(innerObject, parent) { if (parent == null) { throw new ArgumentNullException("parent"); } this.name = name; this.sqlServerManager = sqlServerManager ?? throw new ArgumentNullException("sqlServerManager"); this.resourceGroupName = parent.ResourceGroupName; this.sqlServerName = parent.Name; this.sqlServerLocation = parent.RegionName; this.isPatchUpdate = false; this.importRequestInner = null; }
/// <summary> /// Imports a bacpac into a new database. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group that contains the resource. You can obtain /// this value from the Azure Resource Manager API or the portal. /// </param> /// <param name='serverName'> /// The name of the server. /// </param> /// <param name='parameters'> /// The required parameters for importing a Bacpac into a database. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ImportExportResponseInner> BeginImportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, ImportRequestInner parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginImportWithHttpMessagesAsync(resourceGroupName, serverName, parameters, SqlManagementClient.SetJsonAcceptHeader(), cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }