/// <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='databaseName'> /// The name of the database. /// </param> /// <param name='parameters'> /// The database import request parameters. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ImportExportOperationResult> ImportAsync(this IImportExportOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ImportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes a new instance of the SqlManagementClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public SqlManagementClient(HttpClient httpClient) : base(httpClient) { this._auditingPolicy = new AuditingPolicyOperations(this); this._capabilities = new CapabilitiesOperations(this); this._databaseActivation = new DatabaseActivationOperations(this); this._databaseBackup = new DatabaseBackupOperations(this); this._databases = new DatabaseOperations(this); this._dataMasking = new DataMaskingOperations(this); this._elasticPools = new ElasticPoolOperations(this); this._firewallRules = new FirewallRuleOperations(this); this._importExport = new ImportExportOperations(this); this._jobAccounts = new JobAccountOperations(this); this._recommendedElasticPools = new RecommendedElasticPoolOperations(this); this._recommendedIndexes = new RecommendedIndexOperations(this); this._databaseReplicationLinks = new ReplicationLinkOperations(this); this._secureConnection = new SecureConnectionPolicyOperations(this); this._securityAlertPolicy = new SecurityAlertPolicyOperations(this); this._serverAdministrators = new ServerAdministratorOperations(this); this._communicationLinks = new ServerCommunicationLinkOperations(this); this._serverDisasterRecoveryConfigurations = new ServerDisasterRecoveryConfigurationOperations(this); this._servers = new ServerOperations(this); this._serverUpgrades = new ServerUpgradeOperations(this); this._serviceObjectives = new ServiceObjectiveOperations(this); this._serviceTierAdvisors = new ServiceTierAdvisorOperations(this); this._transparentDataEncryption = new TransparentDataEncryptionOperations(this); this._apiVersion = "2014-04-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Exports a Azure SQL Database to bacpac. To determine the status of /// the operation call GetImportExportOperationStatus. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.LegacySdk.IImportExportOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the Resource Group to which the Azure SQL /// Server belongs. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Server on which the database is /// hosted. /// </param> /// <param name='databaseName'> /// Required. The name of the Azure SQL Database to export. /// </param> /// <param name='parameters'> /// Required. The required parameters for exporting a database. /// </param> /// <returns> /// Response Azure Sql Import/Export operations. /// </returns> public static ImportExportResponse Export(this IImportExportOperations operations, string resourceGroupName, string serverName, string databaseName, ExportRequestParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IImportExportOperations)s).ExportAsync(resourceGroupName, serverName, databaseName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Exports a Azure SQL Database to bacpac. To determine the status of /// the operation call GetImportExportOperationStatus. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.LegacySdk.IImportExportOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the Resource Group to which the Azure SQL /// Server belongs. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Server on which the database is /// hosted. /// </param> /// <param name='databaseName'> /// Required. The name of the Azure SQL Database to export. /// </param> /// <param name='parameters'> /// Required. The required parameters for exporting a database. /// </param> /// <returns> /// Response Azure Sql Import/Export operations. /// </returns> public static Task <ImportExportResponse> ExportAsync(this IImportExportOperations operations, string resourceGroupName, string serverName, string databaseName, ExportRequestParameters parameters) { return(operations.ExportAsync(resourceGroupName, serverName, databaseName, parameters, CancellationToken.None)); }
/// <summary> /// Gets the status of an Azure Sql Database import/export operation. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.LegacySdk.IImportExportOperations. /// </param> /// <param name='operationStatusLink'> /// Required. Location value returned by the Begin operation /// </param> /// <returns> /// Response for Azure Sql Import/Export Status operation. /// </returns> public static Task <ImportExportOperationStatusResponse> GetImportExportOperationStatusAsync(this IImportExportOperations operations, string operationStatusLink) { return(operations.GetImportExportOperationStatusAsync(operationStatusLink, CancellationToken.None)); }
/// <summary> /// Gets the status of an Azure Sql Database import/export operation. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.LegacySdk.IImportExportOperations. /// </param> /// <param name='operationStatusLink'> /// Required. Location value returned by the Begin operation /// </param> /// <returns> /// Response for Azure Sql Import/Export Status operation. /// </returns> public static ImportExportOperationStatusResponse GetImportExportOperationStatus(this IImportExportOperations operations, string operationStatusLink) { return(Task.Factory.StartNew((object s) => { return ((IImportExportOperations)s).GetImportExportOperationStatusAsync(operationStatusLink); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <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='databaseName'> /// The name of the database. /// </param> /// <param name='parameters'> /// The database import request parameters. /// </param> public static ImportExportOperationResult BeginImport(this IImportExportOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters) { return(operations.BeginImportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult()); }