/// <summary> /// Gets the database auditing policy for the given database in the given database server in the given resource group /// </summary> public DatabaseAuditingPolicy GetDatabaseAuditingPolicy(string resourceGroupName, string serverName, string databaseName, string clientRequestId) { IAuditingPolicyOperations operations = GetCurrentSqlClient(clientRequestId).AuditingPolicy; DatabaseAuditingPolicyGetResponse response = operations.GetDatabasePolicy(resourceGroupName, serverName, databaseName); return(response.AuditingPolicy); }
/// <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> /// Gets the database server auditing policy for the given database server in the given resource group /// </summary> public void GetServerAuditingPolicy(string resourceGroupName, string serverName, string clientRequestId, out ServerAuditingPolicy policy) { IAuditingPolicyOperations operations = GetCurrentSqlClient(clientRequestId).AuditingPolicy; ServerAuditingPolicyGetResponse response = operations.GetServerPolicy(resourceGroupName, serverName); policy = response.AuditingPolicy; }
/// <summary> /// Gets the database auditing policy for the given database in the given database server in the given resource group /// </summary> public void GetDatabaseAuditingPolicy(string resourceGroupName, string serverName, string databaseName, out DatabaseAuditingPolicy policy) { IAuditingPolicyOperations operations = GetCurrentSqlClient().AuditingPolicy; DatabaseAuditingPolicyGetResponse response = operations.GetDatabasePolicy(resourceGroupName, serverName, databaseName); policy = response.AuditingPolicy; }
/// <summary> /// Creates or updates an Azure SQL Database auditing policy. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations. /// </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 auditing /// policy applies. /// </param> /// <param name='parameters'> /// Required. The required parameters for createing or updating a Azure /// SQL Database auditing policy. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static AzureOperationResponse CreateOrUpdateDatabasePolicy(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseAuditingPolicyCreateOrUpdateParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IAuditingPolicyOperations)s).CreateOrUpdateDatabasePolicyAsync(resourceGroupName, serverName, databaseName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Returns an Azure SQL Database server auditing policy. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations. /// </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 get database auditing policy request. /// </returns> public static ServerAuditingPolicyGetResponse GetServerPolicy(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName) { return(Task.Factory.StartNew((object s) => { return ((IAuditingPolicyOperations)s).GetServerPolicyAsync(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> 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); }
/// <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); }
/// <summary> /// Sets the database server auditing policy of the given database server in the given resource group /// </summary> public void SetServerAuditingPolicy(string resourceGroupName, string serverName, string clientRequestId, ServerAuditingPolicyCreateOrUpdateParameters parameters) { IAuditingPolicyOperations operations = GetCurrentSqlClient(clientRequestId).AuditingPolicy; operations.CreateOrUpdateServerPolicy(resourceGroupName, serverName, parameters); }
/// <summary> /// Returns an Azure SQL Database server auditing policy. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations. /// </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 get database auditing policy request. /// </returns> public static Task <ServerAuditingPolicyGetResponse> GetServerPolicyAsync(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName) { return(operations.GetServerPolicyAsync(resourceGroupName, serverName, CancellationToken.None)); }
/// <summary> /// Creates or updates an Azure SQL Database Server auditing policy. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations. /// </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='parameters'> /// Required. The required parameters for createing or updating a Azure /// SQL Database Server auditing policy. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> CreateOrUpdateServerPolicyAsync(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName, ServerAuditingPolicyCreateOrUpdateParameters parameters) { return(operations.CreateOrUpdateServerPolicyAsync(resourceGroupName, serverName, parameters, CancellationToken.None)); }
/// <summary> /// Calls the set audit APIs for the database auditing policy for the given database in the given database server in the given resource group /// </summary> public void SetDatabaseAuditingPolicy(string resourceGroupName, string serverName, string databaseName, DatabaseAuditingPolicyCreateOrUpdateParameters parameters) { IAuditingPolicyOperations operations = GetCurrentSqlClient().AuditingPolicy; operations.CreateOrUpdateDatabasePolicy(resourceGroupName, serverName, databaseName, parameters); }
/// <summary> /// Returns an Azure SQL Database auditing policy. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations. /// </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 auditing /// policy applies. /// </param> /// <returns> /// Represents the response to a get database auditing policy request. /// </returns> public static Task<DatabaseAuditingPolicyGetResponse> GetDatabasePolicyAsync(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName, string databaseName) { return operations.GetDatabasePolicyAsync(resourceGroupName, serverName, databaseName, CancellationToken.None); }