pub struct NewAgentPolicy { /* private fields */ }Expand description
An agent policy definition for Fleet::create_agent_policy and
Fleet::update_agent_policy.
For changes to a retrieved policy, prefer AgentPolicy::edit to retain
its inactivity timeout instead of accepting the server’s default.
Optional settings are omitted until their setter is called.
Implementations§
Source§impl NewAgentPolicy
impl NewAgentPolicy
pub fn new(name: impl Into<String>, namespace: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Sourcepub fn monitoring_enabled<I: IntoIterator<Item = S>, S: Into<String>>(
self,
kinds: I,
) -> Self
pub fn monitoring_enabled<I: IntoIterator<Item = S>, S: Into<String>>( self, kinds: I, ) -> Self
Agent self-monitoring to collect: logs, metrics and traces. Empty disables it.
Sourcepub fn data_output_id(self, id: impl Into<String>) -> Self
pub fn data_output_id(self, id: impl Into<String>) -> Self
Selects a data output explicitly. Without this setter or
clear_data_output_id, the field is omitted.
Kibana requires a Platinum license to set a per-policy output.
Sourcepub fn clear_data_output_id(self) -> Self
pub fn clear_data_output_id(self) -> Self
Sends data_output_id: null to use Fleet’s default output.
On update, omission keeps the existing selection; null clears it.
use security_client_rs::fleet::NewAgentPolicy;
use serde_json::{json, to_value};
let policy = NewAgentPolicy::new("SOC endpoints", "default");
assert!(to_value(&policy)?.get("data_output_id").is_none());
let selected = policy.data_output_id("output-id");
assert_eq!(to_value(&selected)?["data_output_id"], json!("output-id"));
let cleared = selected.clear_data_output_id();
assert_eq!(to_value(&cleared)?["data_output_id"], json!(null));Sourcepub fn inactivity_timeout(self, seconds: u64) -> Self
pub fn inactivity_timeout(self, seconds: u64) -> Self
Seconds without check-in before an agent is considered inactive.
Trait Implementations§
Source§impl Clone for NewAgentPolicy
impl Clone for NewAgentPolicy
Source§impl Debug for NewAgentPolicy
impl Debug for NewAgentPolicy
Auto Trait Implementations§
impl Freeze for NewAgentPolicy
impl RefUnwindSafe for NewAgentPolicy
impl Send for NewAgentPolicy
impl Sync for NewAgentPolicy
impl Unpin for NewAgentPolicy
impl UnsafeUnpin for NewAgentPolicy
impl UnwindSafe for NewAgentPolicy
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