/// <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._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);
 }
Exemple #2
0
 /// <summary>
 /// Deletes a server-level Firewall Rule from an Azure SQL Database
 /// Server.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Database Server that will have
 /// the Firewall Fule removed from it.
 /// </param>
 /// <param name='ruleName'>
 /// Required. The name of the Firewall Fule to delete.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Delete(this IFirewallRuleOperations operations, string serverName, string ruleName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IFirewallRuleOperations)s).DeleteAsync(serverName, ruleName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #3
0
 /// <summary>
 /// Creates or updates an Azure SQL Database Server Firewall rule.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the server
 /// belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Database Server on which the
 /// database is hosted.
 /// </param>
 /// <param name='firewallRule'>
 /// Required. The name of the Azure SQL Database Server Firewall Rule.
 /// </param>
 /// <param name='parameters'>
 /// Required. The required parameters for createing or updating a
 /// firewall rule.
 /// </param>
 /// <returns>
 /// Represents the response to a List Firewall Rules request.
 /// </returns>
 public static FirewallRuleGetResponse CreateOrUpdate(this IFirewallRuleOperations operations, string resourceGroupName, string serverName, string firewallRule, FirewallRuleCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IFirewallRuleOperations)s).CreateOrUpdateAsync(resourceGroupName, serverName, firewallRule, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #4
0
 /// <summary>
 /// Returns a list of Azure SQL Database Server Firewall rules.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the server
 /// belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Database Server on which the
 /// database is hosted.
 /// </param>
 /// <returns>
 /// Represents the response to a List Firewall Rules request.
 /// </returns>
 public static FirewallRuleListResponse List(this IFirewallRuleOperations operations, string resourceGroupName, string serverName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IFirewallRuleOperations)s).ListAsync(resourceGroupName, serverName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes a new instance of the SqlManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private SqlManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._databases     = new DatabaseOperations(this);
     this._firewallRules = new FirewallRuleOperations(this);
     this._servers       = new ServerOperations(this);
     this._apiVersion    = "2014-04-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Exemple #6
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);
 }
 /// <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._databases         = new DatabaseOperations(this);
     this._dataMasking       = new DataMaskingOperations(this);
     this._firewallRules     = new FirewallRuleOperations(this);
     this._secureConnection  = new SecureConnectionPolicyOperations(this);
     this._servers           = new ServerOperations(this);
     this._serviceObjectives = new ServiceObjectiveOperations(this);
     this._apiVersion        = "2014-04-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Exemple #8
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>
 /// Deletes a server-level firewall rule from a SQL Database server
 /// that belongs to a subscription.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715277.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the server that will be have new firewall rule applied
 /// to it.
 /// </param>
 /// <param name='ruleName'>
 /// The name of the new firewall rule.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse Delete(this IFirewallRuleOperations operations, string serverName, string ruleName)
 {
     try
     {
         return(operations.DeleteAsync(serverName, ruleName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Adds a new server-level firewall rule for a SQL Database server
 /// that belongs to a subscription.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715280.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the SQL database server to which this rule will be
 /// applied.
 /// </param>
 /// <param name='parameters'>
 /// Parameters for the Create Firewall Rule operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static FirewallRuleCreateResponse Create(this IFirewallRuleOperations operations, string serverName, FirewallRuleCreateParameters parameters)
 {
     try
     {
         return(operations.CreateAsync(serverName, parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Returns a list of all the server-level firewall rules for a SQL
 /// Database server that belongs to a subscription.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715278.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the server for which the call is being made.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static FirewallRuleListResponse List(this IFirewallRuleOperations operations, string serverName)
 {
     try
     {
         return(operations.ListAsync(serverName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Exemple #12
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);
 }
 /// <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._databases               = new DatabaseOperations(this);
     this._dataMasking             = new DataMaskingOperations(this);
     this._elasticPools            = new ElasticPoolOperations(this);
     this._firewallRules           = new FirewallRuleOperations(this);
     this._recommendedElasticPools = new RecommendedElasticPoolOperations(this);
     this._secureConnection        = new SecureConnectionPolicyOperations(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);
 }
Exemple #14
0
 /// <summary>
 /// Deletes an Azure SQL Database Server Firewall rule.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the server
 /// belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Database Server on which the
 /// database is hosted.
 /// </param>
 /// <param name='firewallRule'>
 /// Required. The name of the Azure SQL Database Server Firewall Rule.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> DeleteAsync(this IFirewallRuleOperations operations, string resourceGroupName, string serverName, string firewallRule)
 {
     return(operations.DeleteAsync(resourceGroupName, serverName, firewallRule, CancellationToken.None));
 }
Exemple #15
0
 /// <summary>
 /// Creates or updates an Azure SQL Database Server Firewall rule.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the server
 /// belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Database Server on which the
 /// database is hosted.
 /// </param>
 /// <param name='firewallRule'>
 /// Required. The name of the Azure SQL Database Server Firewall Rule.
 /// </param>
 /// <param name='parameters'>
 /// Required. The required parameters for createing or updating a
 /// firewall rule.
 /// </param>
 /// <returns>
 /// Represents the response to a List Firewall Rules request.
 /// </returns>
 public static Task <FirewallRuleGetResponse> CreateOrUpdateAsync(this IFirewallRuleOperations operations, string resourceGroupName, string serverName, string firewallRule, FirewallRuleCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, serverName, firewallRule, parameters, CancellationToken.None));
 }
Exemple #16
0
 /// <summary>
 /// Returns a list of Azure SQL Database Server Firewall rules.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the server
 /// belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Database Server on which the
 /// database is hosted.
 /// </param>
 /// <returns>
 /// Represents the response to a List Firewall Rules request.
 /// </returns>
 public static Task <FirewallRuleListResponse> ListAsync(this IFirewallRuleOperations operations, string resourceGroupName, string serverName)
 {
     return(operations.ListAsync(resourceGroupName, serverName, CancellationToken.None));
 }
 /// <summary>
 /// Updates an existing server-level firewall rule for a SQL Database
 /// server that belongs to a subscription.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715280.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the SQL database server to which this rule will be
 /// applied.
 /// </param>
 /// <param name='ruleName'>
 /// The name of the firewall rule to be updated.
 /// </param>
 /// <param name='parameters'>
 /// Parameters for the Update Firewall Rule operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <FirewallRuleUpdateResponse> UpdateAsync(this IFirewallRuleOperations operations, string serverName, string ruleName, FirewallRuleUpdateParameters parameters)
 {
     return(operations.UpdateAsync(serverName, ruleName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Deletes a server-level firewall rule from a SQL Database server
 /// that belongs to a subscription.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715277.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IFirewallRuleOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the server that will be have new firewall rule applied
 /// to it.
 /// </param>
 /// <param name='ruleName'>
 /// The name of the new firewall rule.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> DeleteAsync(this IFirewallRuleOperations operations, string serverName, string ruleName)
 {
     return(operations.DeleteAsync(serverName, ruleName, CancellationToken.None));
 }