/// <summary> /// Provides a database Vulnerability Assessment settings model for the given database /// </summary> public DatabaseVulnerabilityAssessmentSettingsModel GetDatabaseVulnerabilityAssessmentSettings(string resourceGroup, string serverName, string databaseName) { var vulnerabilityAssessmentSettings = VulnerabilityAssessmentCommunicator.GetDatabaseVulnerabilityAssessmentSettings(resourceGroup, serverName, databaseName); return(ConvertSettingsToModel(resourceGroup, serverName, databaseName, vulnerabilityAssessmentSettings)); }
/// <summary> /// Provides a Vulnerability Assessment settings model for the given database /// </summary> public VulnerabilityAssessmentSettingsModel GetVulnerabilityAssessmentSettings(string resourceGroup, string serverName, string databaseName, ApplyToType applyToType) { var vulnerabilityAssessmentSettings = (applyToType == ApplyToType.Database) ? VulnerabilityAssessmentCommunicator.GetDatabaseVulnerabilityAssessmentSettings(resourceGroup, serverName, databaseName) : VulnerabilityAssessmentCommunicator.GetManagedDatabaseVulnerabilityAssessmentSettings(resourceGroup, serverName, databaseName); return(ConvertSettingsToModel(resourceGroup, serverName, databaseName, vulnerabilityAssessmentSettings)); }
/// <summary> /// Provides a Vulnerability Assessment settings model for the given database /// </summary> public VulnerabilityAssessmentSettingsModel GetVulnerabilityAssessmentSettings(string resourceGroup, string serverName, string databaseName, ApplyToType applyToType) { switch (applyToType) { case ApplyToType.Database: var vaDbSettings = VulnerabilityAssessmentCommunicator.GetDatabaseVulnerabilityAssessmentSettings(resourceGroup, serverName, databaseName); return(ConvertSettingsToModel(resourceGroup, vaDbSettings.RecurringScans, vaDbSettings.StorageContainerPath)); case ApplyToType.ManagedDatabase: var vaManagedDbSettings = VulnerabilityAssessmentCommunicator.GetManagedDatabaseVulnerabilityAssessmentSettings(resourceGroup, serverName, databaseName); return(ConvertSettingsToModel(resourceGroup, vaManagedDbSettings.RecurringScans, vaManagedDbSettings.StorageContainerPath)); case ApplyToType.Server: var vaServerSettings = VulnerabilityAssessmentCommunicator.GetServerVulnerabilityAssessmentSettings(resourceGroup, serverName); return(ConvertSettingsToModel(resourceGroup, vaServerSettings.RecurringScans, vaServerSettings.StorageContainerPath)); case ApplyToType.ManagedInstance: var vaManagedInstanceSettings = VulnerabilityAssessmentCommunicator.GetManagedInstanceVulnerabilityAssessmentSettings(resourceGroup, serverName); return(ConvertSettingsToModel(resourceGroup, vaManagedInstanceSettings.RecurringScans, vaManagedInstanceSettings.StorageContainerPath)); default: throw new Exception(Properties.Resources.VulnerabilityAssessmentTypeNotSupported); } }