示例#1
0
 /// <summary>
 /// Returns information about one operation on a given operation Guid.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDatabaseOperationOperations.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the SQL Server on which the operation was
 /// executed.
 /// </param>
 /// <param name='operationGuid'>
 /// Required. The Guid of the SQL Server database operation to be
 /// obtained.
 /// </param>
 /// <returns>
 /// Response containing the database operation for a given operation
 /// Guid.
 /// </returns>
 public static DatabaseOperationGetResponse Get(this IDatabaseOperationOperations operations, string serverName, string operationGuid)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDatabaseOperationOperations)s).GetAsync(serverName, operationGuid);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#2
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);
 }
示例#3
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>
 /// Returns information about one operation on a given operation Guid.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDatabaseOperationOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the SQL Server on which the operation was executed.
 /// </param>
 /// <param name='operationGuid'>
 /// The Guid of the SQL Server database operation to be obtained.
 /// </param>
 /// <returns>
 /// Response containing the database operation for a given operation
 /// Guid.
 /// </returns>
 public static DatabaseOperationGetResponse Get(this IDatabaseOperationOperations operations, string serverName, string operationGuid)
 {
     try
     {
         return(operations.GetAsync(serverName, operationGuid).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Returns the list database operations for a given server.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDatabaseOperationOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the SQL Server to be queried.
 /// </param>
 /// <returns>
 /// Response containing the list of database operations for a given
 /// server or database.
 /// </returns>
 public static DatabaseOperationListResponse ListByServer(this IDatabaseOperationOperations operations, string serverName)
 {
     try
     {
         return(operations.ListByServerAsync(serverName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
示例#6
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);
 }
示例#7
0
 /// <summary>
 /// Returns information about one operation on a given operation Guid.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDatabaseOperationOperations.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the SQL Server on which the operation was
 /// executed.
 /// </param>
 /// <param name='operationGuid'>
 /// Required. The Guid of the SQL Server database operation to be
 /// obtained.
 /// </param>
 /// <returns>
 /// Response containing the database operation for a given operation
 /// Guid.
 /// </returns>
 public static Task <DatabaseOperationGetResponse> GetAsync(this IDatabaseOperationOperations operations, string serverName, string operationGuid)
 {
     return(operations.GetAsync(serverName, operationGuid, CancellationToken.None));
 }
示例#8
0
 /// <summary>
 /// Returns the list database operations for a given server.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IDatabaseOperationOperations.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the SQL Server to be queried.
 /// </param>
 /// <returns>
 /// Response containing the list of database operations for a given
 /// server or database.
 /// </returns>
 public static Task <DatabaseOperationListResponse> ListByServerAsync(this IDatabaseOperationOperations operations, string serverName)
 {
     return(operations.ListByServerAsync(serverName, CancellationToken.None));
 }