Exemple #1
0
 /// <summary>
 /// Gets the status of the import or export operation in the specified
 /// server with the corresponding request ID.  The request ID is
 /// provided in the responses of the import or export operation.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDacOperations.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the server in which the import or export
 /// operation is taking place.
 /// </param>
 /// <param name='fullyQualifiedServerName'>
 /// Required. The fully qualified domain name of the Azure SQL Database
 /// Server where the operation is taking place. Example:
 /// a9s7f7s9d3.database.windows.net
 /// </param>
 /// <param name='username'>
 /// Required. The administrator username for the Azure SQL Database
 /// Server.
 /// </param>
 /// <param name='password'>
 /// Required. The administrator password for the Azure SQL Database
 /// Server.
 /// </param>
 /// <param name='requestId'>
 /// Required. The request ID of the operation being queried.  The
 /// request ID is obtained from the responses of the import and export
 /// operations.
 /// </param>
 /// <returns>
 /// Represents a list of import or export status values returned from
 /// GetStatus.
 /// </returns>
 public static DacGetStatusResponse GetStatus(this IDacOperations operations, string serverName, string fullyQualifiedServerName, string username, string password, string requestId)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDacOperations)s).GetStatusAsync(serverName, fullyQualifiedServerName, username, password, requestId);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #2
0
 /// <summary>
 /// Exports an Azure SQL Database into a DACPAC file in Azure Blob
 /// Storage.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDacOperations.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Database Server in which the
 /// database to export resides.
 /// </param>
 /// <param name='parameters'>
 /// Optional. The parameters needed to initiate the export request.
 /// </param>
 /// <returns>
 /// Represents the response that the service returns once an import or
 /// export operation has been initiated.
 /// </returns>
 public static DacImportExportResponse Export(this IDacOperations operations, string serverName, DacExportParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDacOperations)s).ExportAsync(serverName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the SqlManagementClient class.
 /// </summary>
 private SqlManagementClient()
     : base()
 {
     this._dac = new DacOperations(this);
     this._databaseOperations = new DatabaseOperationOperations(this);
     this._databases          = new DatabaseOperations(this);
     this._firewallRules      = new FirewallRuleOperations(this);
     this._servers            = new ServerOperations(this);
     this._serviceObjectives  = new ServiceObjectiveOperations(this);
     this.HttpClient.Timeout  = TimeSpan.FromSeconds(300);
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the SqlManagementClient class.
 /// </summary>
 private SqlManagementClient()
     : base()
 {
     this._dac                        = new DacOperations(this);
     this._databaseCopies             = new DatabaseCopyOperations(this);
     this._databaseOperations         = new DatabaseOperationOperations(this);
     this._databases                  = new DatabaseOperations(this);
     this._firewallRules              = new FirewallRuleOperations(this);
     this._quotas                     = new QuotaOperations(this);
     this._recoverableDatabases       = new RecoverableDatabaseOperations(this);
     this._recoverDatabaseOperations  = new RecoverDatabaseOperations(this);
     this._restorableDroppedDatabases = new RestorableDroppedDatabaseOperations(this);
     this._restoreDatabaseOperations  = new RestoreDatabaseOperations(this);
     this._servers                    = new ServerOperations(this);
     this._serviceObjectives          = new ServiceObjectiveOperations(this);
     this.HttpClient.Timeout          = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Export DAC into Windows Azure blob storage.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDacOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the server being exported from.
 /// </param>
 /// <param name='parameters'>
 /// Export parameters.
 /// </param>
 /// <returns>
 /// Response for an DAC Import/Export request.
 /// </returns>
 public static DacImportExportResponse Export(this IDacOperations operations, string serverName, DacExportParameters parameters)
 {
     try
     {
         return(operations.ExportAsync(serverName, parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Gets the status of the DAC.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDacOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the server.
 /// </param>
 /// <param name='fullyQualifiedServerName'>
 /// The fully qualified name of the server.
 /// </param>
 /// <param name='username'>
 /// The server's username.
 /// </param>
 /// <param name='password'>
 /// The server's password.
 /// </param>
 /// <param name='requestId'>
 /// The request ID of the operation being queried.
 /// </param>
 /// <returns>
 /// The response structure for the DAC GetStatus operation.
 /// </returns>
 public static DacGetStatusResponse GetStatus(this IDacOperations operations, string serverName, string fullyQualifiedServerName, string username, string password, string requestId)
 {
     try
     {
         return(operations.GetStatusAsync(serverName, fullyQualifiedServerName, username, password, requestId).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the SqlManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private SqlManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._dac                                = new DacOperations(this);
     this._databaseCopies                     = new DatabaseCopyOperations(this);
     this._databaseOperations                 = new DatabaseOperationOperations(this);
     this._databases                          = new DatabaseOperations(this);
     this._firewallRules                      = new FirewallRuleOperations(this);
     this._quotas                             = new QuotaOperations(this);
     this._recoverableDatabases               = new RecoverableDatabaseOperations(this);
     this._recoverDatabaseOperations          = new RecoverDatabaseOperations(this);
     this._restorableDroppedDatabases         = new RestorableDroppedDatabaseOperations(this);
     this._restoreDatabaseOperations          = new RestoreDatabaseOperations(this);
     this._servers                            = new ServerOperations(this);
     this._serviceObjectives                  = new ServiceObjectiveOperations(this);
     this._apiVersion                         = "2012-03-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout                  = TimeSpan.FromSeconds(300);
 }
Exemple #8
0
 /// <summary>
 /// Exports an Azure SQL Database into a DACPAC file in Azure Blob
 /// Storage.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDacOperations.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Database Server in which the
 /// database to export resides.
 /// </param>
 /// <param name='parameters'>
 /// Optional. The parameters needed to initiate the export request.
 /// </param>
 /// <returns>
 /// Represents the response that the service returns once an import or
 /// export operation has been initiated.
 /// </returns>
 public static Task <DacImportExportResponse> ExportAsync(this IDacOperations operations, string serverName, DacExportParameters parameters)
 {
     return(operations.ExportAsync(serverName, parameters, CancellationToken.None));
 }
Exemple #9
0
 /// <summary>
 /// Gets the status of the import or export operation in the specified
 /// server with the corresponding request ID.  The request ID is
 /// provided in the responses of the import or export operation.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDacOperations.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the server in which the import or export
 /// operation is taking place.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters needed to get the status of an import or
 /// export operation.
 /// </param>
 /// <returns>
 /// Represents a list of import or export status values returned from
 /// GetStatus.
 /// </returns>
 public static Task <DacGetStatusResponse> GetStatusPostAsync(this IDacOperations operations, string serverName, DacGetStatusParameters parameters)
 {
     return(operations.GetStatusPostAsync(serverName, parameters, CancellationToken.None));
 }
Exemple #10
0
 /// <summary>
 /// Gets the status of the import or export operation in the specified
 /// server with the corresponding request ID.  The request ID is
 /// provided in the responses of the import or export operation.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDacOperations.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the server in which the import or export
 /// operation is taking place.
 /// </param>
 /// <param name='fullyQualifiedServerName'>
 /// Required. The fully qualified domain name of the Azure SQL Database
 /// Server where the operation is taking place. Example:
 /// a9s7f7s9d3.database.windows.net
 /// </param>
 /// <param name='username'>
 /// Required. The administrator username for the Azure SQL Database
 /// Server.
 /// </param>
 /// <param name='password'>
 /// Required. The administrator password for the Azure SQL Database
 /// Server.
 /// </param>
 /// <param name='requestId'>
 /// Required. The request ID of the operation being queried.  The
 /// request ID is obtained from the responses of the import and export
 /// operations.
 /// </param>
 /// <returns>
 /// Represents a list of import or export status values returned from
 /// GetStatus.
 /// </returns>
 public static Task <DacGetStatusResponse> GetStatusAsync(this IDacOperations operations, string serverName, string fullyQualifiedServerName, string username, string password, string requestId)
 {
     return(operations.GetStatusAsync(serverName, fullyQualifiedServerName, username, password, requestId, CancellationToken.None));
 }