Ejemplo n.º 1
0
        /// <summary>
        /// Transforms the given server policy object to its cmdlet model representation
        /// </summary>
        private void ModelizeServerAuditPolicy(BlobAuditingPolicy policy, ServerBlobAuditingSettingsModel serverPolicyModel)
        {
            var properties = policy.Properties;

            serverPolicyModel.AuditState = ModelizeAuditState(properties.State);
            ModelizeStorageInfo(serverPolicyModel, properties.StorageEndpoint, properties.IsStorageSecondaryKeyInUse);
            ModelizeAuditActionGroups(serverPolicyModel, properties.AuditActionsAndGroups);
            ModelizeRetentionInfo(serverPolicyModel, properties.RetentionDays);
        }
Ejemplo n.º 2
0
        private void ModelizeDatabaseAuditPolicy(BlobAuditingPolicy policy, DatabaseBlobAuditingSettingsModel dbPolicyModel)
        {
            var properties = policy.Properties;

            dbPolicyModel.AuditState = ModelizeAuditState(properties.State);
            ModelizeStorageInfo(dbPolicyModel, properties.StorageEndpoint, properties.IsStorageSecondaryKeyInUse, properties.StorageAccountSubscriptionId);
            ModelizeAuditActionGroups(dbPolicyModel, properties.AuditActionsAndGroups);
            ModelizeAuditActions(dbPolicyModel, properties.AuditActionsAndGroups);
            ModelizeRetentionInfo(dbPolicyModel, properties.RetentionDays);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Transforms the given server policy object to its cmdlet model representation
        /// </summary>
        private ServerBlobAuditingPolicyModel ModelizeServerAuditPolicy(BlobAuditingPolicy policy)
        {
            var serverPolicyModel = new ServerBlobAuditingPolicyModel();
            var properties        = policy.Properties;

            serverPolicyModel.AuditState = ModelizeAuditState(properties.State);
            ModelizeStorageInfo(serverPolicyModel, properties.StorageEndpoint, properties.IsStorageSecondaryKeyInUse);
            ModelizeAuditActionsAndGroupsInfo(serverPolicyModel, properties.AuditActionsAndGroups);
            ModelizeRetentionInfo(serverPolicyModel, properties.RetentionDays);
            return(serverPolicyModel);
        }
Ejemplo n.º 4
0
        private DatabaseBlobAuditingPolicyModel ModelizeDatabaseAuditPolicy(BlobAuditingPolicy policy)
        {
            var dbPolicyModel = new DatabaseBlobAuditingPolicyModel();
            var properties    = policy.Properties;

            dbPolicyModel.AuditState = ModelizeAuditState(properties.State);
            ModelizeStorageInfo(dbPolicyModel, properties.StorageEndpoint);
            ModelizeAuditActionsAndGroupsInfo(dbPolicyModel, properties.AuditActionsAndGroups);
            ModelizeRetentionInfo(dbPolicyModel, properties.RetentionDays);
            return(dbPolicyModel);
        }
        /// <summary>
        /// Gets the database server blob auditing policy for the given database server in the given resource group
        /// </summary>
        public void GetServerAuditingPolicy(string resourceGroupName, string serverName, string clientRequestId, out BlobAuditingPolicy policy)
        {
            var operations = GetCurrentSqlClient(clientRequestId).BlobAuditing;
            var response   = operations.GetServerPolicy(resourceGroupName, serverName);

            policy = response.AuditingPolicy;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Gets the database blob 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 BlobAuditingPolicy policy)
        {
            var operations = GetCurrentSqlClient().BlobAuditing;
            var response   = operations.GetDatabaseBlobAuditingPolicy(resourceGroupName, serverName, databaseName);

            policy = response.AuditingPolicy;
        }