pub struct RemediationEngine { /* private fields */ }Expand description
Auto-remediation engine
Implementations§
Source§impl RemediationEngine
impl RemediationEngine
Sourcepub fn with_config(config: RemediationConfig) -> Self
pub fn with_config(config: RemediationConfig) -> Self
Create with custom configuration
Sourcepub fn update_config(&self, config: RemediationConfig)
pub fn update_config(&self, config: RemediationConfig)
Update configuration
Sourcepub fn get_config(&self) -> RemediationConfig
pub fn get_config(&self) -> RemediationConfig
Get current configuration
Sourcepub fn process_recommendation(
&self,
recommendation: &Recommendation,
) -> Result<String, String>
pub fn process_recommendation( &self, recommendation: &Recommendation, ) -> Result<String, String>
Process a recommendation for auto-remediation
Sourcepub fn get_approval_queue(&self) -> Vec<ApprovalRequest>
pub fn get_approval_queue(&self) -> Vec<ApprovalRequest>
Get pending approval requests
Sourcepub fn approve_action(
&self,
action_id: &str,
approver: &str,
) -> Result<(), String>
pub fn approve_action( &self, action_id: &str, approver: &str, ) -> Result<(), String>
Approve a remediation action
Sourcepub fn reject_action(&self, action_id: &str, reason: &str) -> Result<(), String>
pub fn reject_action(&self, action_id: &str, reason: &str) -> Result<(), String>
Reject a remediation action
Sourcepub fn rollback_action(&self, action_id: &str) -> Result<(), String>
pub fn rollback_action(&self, action_id: &str) -> Result<(), String>
Rollback a remediation action
Sourcepub fn record_effectiveness(
&self,
recommendation_id: &str,
action_id: &str,
before: SystemMetrics,
after: SystemMetrics,
measurement_period_hours: i64,
)
pub fn record_effectiveness( &self, recommendation_id: &str, action_id: &str, before: SystemMetrics, after: SystemMetrics, measurement_period_hours: i64, )
Record effectiveness metrics
Sourcepub fn get_effectiveness(&self, action_id: &str) -> Option<EffectivenessMetrics>
pub fn get_effectiveness(&self, action_id: &str) -> Option<EffectivenessMetrics>
Get effectiveness metrics for an action
Sourcepub fn get_all_effectiveness(&self) -> Vec<EffectivenessMetrics>
pub fn get_all_effectiveness(&self) -> Vec<EffectivenessMetrics>
Get all effectiveness metrics
Sourcepub fn get_action(&self, action_id: &str) -> Option<RemediationAction>
pub fn get_action(&self, action_id: &str) -> Option<RemediationAction>
Get action by ID
Sourcepub fn get_active_actions(&self) -> Vec<RemediationAction>
pub fn get_active_actions(&self) -> Vec<RemediationAction>
Get all active actions
Sourcepub fn get_history(&self, limit: usize) -> Vec<RemediationAction>
pub fn get_history(&self, limit: usize) -> Vec<RemediationAction>
Get action history
Sourcepub fn get_stats(&self) -> RemediationStats
pub fn get_stats(&self) -> RemediationStats
Get statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RemediationEngine
impl !RefUnwindSafe for RemediationEngine
impl Send for RemediationEngine
impl Sync for RemediationEngine
impl Unpin for RemediationEngine
impl !UnwindSafe for RemediationEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request