/// <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);
 }
        /// <summary>
        /// Calls to list all the data masking rules for a specific database
        /// </summary>
        public IList <DataMaskingRule> ListDataMaskingRules(string resourceGroupName, string serverName, string databaseName, string clientRequestId)
        {
            IDataMaskingOperations      operations = GetCurrentSqlClient(clientRequestId).DataMasking;
            DataMaskingRuleListResponse response   = operations.List(resourceGroupName, serverName, databaseName);

            return(response.DataMaskingRules);
        }
        /// <summary>
        /// Get the data masking policy for a specific database
        /// </summary>
        public DataMaskingPolicy GetDatabaseDataMaskingPolicy(string resourceGroupName, string serverName, string databaseName, string clientRequestId)
        {
            IDataMaskingOperations       operations = GetCurrentSqlClient(clientRequestId).DataMasking;
            DataMaskingPolicyGetResponse response   = operations.GetPolicy(resourceGroupName, serverName, databaseName);

            return(response.DataMaskingPolicy);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Creates or updates an Azure SQL Database data masking policy
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.LegacySdk.IDataMaskingOperations.
 /// </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='databaseName'>
 /// Required. The name of the Azure SQL Database for which the data
 /// masking rule applies.
 /// </param>
 /// <param name='parameters'>
 /// Required. The required parameters for createing or updating a
 /// firewall rule.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse CreateOrUpdatePolicy(this IDataMaskingOperations operations, string resourceGroupName, string serverName, string databaseName, DataMaskingPolicyCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDataMaskingOperations)s).CreateOrUpdatePolicyAsync(resourceGroupName, serverName, databaseName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 5
0
 /// <summary>
 /// Returns a list of Azure SQL Database data masking rules.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.LegacySdk.IDataMaskingOperations.
 /// </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='databaseName'>
 /// Required. The name of the Azure SQL Database for which the data
 /// masking rules applies.
 /// </param>
 /// <returns>
 /// Represents the response to a List data masking rules request.
 /// </returns>
 public static DataMaskingRuleListResponse List(this IDataMaskingOperations operations, string resourceGroupName, string serverName, string databaseName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDataMaskingOperations)s).ListAsync(resourceGroupName, serverName, databaseName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the SqlManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public SqlManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._databases        = new DatabaseOperations(this);
     this._dataMasking      = new DataMaskingOperations(this);
     this._firewallRules    = new FirewallRuleOperations(this);
     this._databaseSecurity = new SecurityOperations(this);
     this._servers          = new ServerOperations(this);
     this._apiVersion       = "2014-04-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Initializes a new instance of the SqlManagementClient class.
 /// </summary>
 public SqlManagementClient()
     : base()
 {
     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);
 }
 /// <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);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Returns a list of Azure SQL Database data masking rules.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.LegacySdk.IDataMaskingOperations.
 /// </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='databaseName'>
 /// Required. The name of the Azure SQL Database for which the data
 /// masking rules applies.
 /// </param>
 /// <returns>
 /// Represents the response to a List data masking rules request.
 /// </returns>
 public static Task <DataMaskingRuleListResponse> ListAsync(this IDataMaskingOperations operations, string resourceGroupName, string serverName, string databaseName)
 {
     return(operations.ListAsync(resourceGroupName, serverName, databaseName, CancellationToken.None));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Deletes an Azure SQL Server data masking rule.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.LegacySdk.IDataMaskingOperations.
 /// </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='databaseName'>
 /// Required. The name of the Azure SQL Database for which the data
 /// masking rule applies.
 /// </param>
 /// <param name='dataMaskingRule'>
 /// Required. The name of the Azure SQL Database  data masking rule.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this IDataMaskingOperations operations, string resourceGroupName, string serverName, string databaseName, string dataMaskingRule)
 {
     return(operations.DeleteAsync(resourceGroupName, serverName, databaseName, dataMaskingRule, CancellationToken.None));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Creates or updates an Azure SQL Database Server Firewall rule.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.LegacySdk.IDataMaskingOperations.
 /// </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='databaseName'>
 /// Required. The name of the Azure SQL Database for which the data
 /// masking rule applies.
 /// </param>
 /// <param name='dataMaskingRule'>
 /// Required. The name of the Azure SQL Database data masking rule.
 /// </param>
 /// <param name='parameters'>
 /// Required. The required parameters for createing or updating a data
 /// masking rule.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> CreateOrUpdateRuleAsync(this IDataMaskingOperations operations, string resourceGroupName, string serverName, string databaseName, string dataMaskingRule, DataMaskingRuleCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateRuleAsync(resourceGroupName, serverName, databaseName, dataMaskingRule, parameters, CancellationToken.None));
 }
        /// <summary>
        /// Sets the data masking rules for a specific database
        /// </summary>
        public void SetDatabaseDataMaskingRule(string resourceGroupName, string serverName, string databaseName, string ruleId, string clientRequestId, DataMaskingRuleCreateOrUpdateParameters parameters)
        {
            IDataMaskingOperations operations = GetCurrentSqlClient(clientRequestId).DataMasking;

            operations.CreateOrUpdateRule(resourceGroupName, serverName, databaseName, ruleId, parameters);
        }
        /// <summary>
        /// Deletes a data masking rule from the list of rules of a specific database
        /// </summary>
        public void DeleteDataMaskingRule(string resourceGroupName, string serverName, string databaseName, string ruleId, string clientRequestId)
        {
            IDataMaskingOperations operations = GetCurrentSqlClient(clientRequestId).DataMasking;

            operations.Delete(resourceGroupName, serverName, databaseName, ruleId);
        }
        /// <summary>
        /// Set (or create) the data masking policy for a specific database
        /// </summary>
        public void SetDatabaseDataMaskingPolicy(string resourceGroupName, string serverName, string databaseName, DataMaskingPolicyCreateOrUpdateParameters parameters)
        {
            IDataMaskingOperations operations = GetCurrentSqlClient().DataMasking;

            operations.CreateOrUpdatePolicy(resourceGroupName, serverName, databaseName, parameters);
        }