NetflowCollector

Struct NetflowCollector 

Source
pub struct NetflowCollector {
    pub name: String,
    pub monitoring_server: Option<MonitoringClusterRef>,
    pub port: Option<u64>,
    pub sources: Option<ConfigObjectMap<NetflowSource>>,
    pub sport: Option<u64>,
    pub id: Option<u64>,
    pub ref_: Option<String>,
    pub uncommitted: Option<bool>,
}
Expand description

Represents a NetflowCollector in Opsview.

Netflow collectors are used to collect Netflow data from network devices. This struct defines the structure for a Netflow collector entity as used in Opsview.

§Example

use opsview::config::{NetflowCollector, MonitoringCluster};
use opsview::prelude::*;

let my_monitoring_cluster = MonitoringCluster::minimal("My Monitoring Cluster").unwrap();

let netflow_collector = NetflowCollector::builder()
  .name("My Netflow Collector")
  .monitoring_server(my_monitoring_cluster)
  .build()
  .unwrap();

  assert_eq!(netflow_collector.name, "My Netflow Collector".to_string());

Fields§

§name: String

The name of the NetflowCollector.

§monitoring_server: Option<MonitoringClusterRef>

The MonitoringClusterRef associated with this NetflowCollector.

§port: Option<u64>

The port number used by the NetflowCollector. Default: Some(9995)

§sources: Option<ConfigObjectMap<NetflowSource>>

ConfigObjectMap of NetflowSource objects associated with this NetflowCollector.

§sport: Option<u64>

The port number used by the NetflowCollector for secure connections. Default: Some(6343)

§id: Option<u64>

The unique identifier of the NetflowCollector.

§ref_: Option<String>

A reference string unique to this NetflowCollector.

§uncommitted: Option<bool>

A boolean indicating whether the collector is uncommitted.

Trait Implementations§

Source§

impl Clone for NetflowCollector

Source§

fn clone(&self) -> NetflowCollector

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConfigObject for NetflowCollector

Source§

fn builder() -> Self::Builder

Returns a builder for constructing a NetflowCollector object.

§Returns

A super::MonitoringClusterBuilder object.

Source§

fn config_path() -> Option<String>

Provides the configuration path for a NetflowCollector object within the Opsview system.

§Returns

A string representing the API path where NetflowCollectors are configured.

Source§

fn unique_name(&self) -> String

Returns the unique name of the NetflowCollector object. This name is used to identify the NetflowCollector when building the HashMap for an ConfigObjectMap.

Source§

type Builder = NetflowCollectorBuilder

Source§

fn minimal(name: &str) -> Result<Self, OpsviewConfigError>

Source§

impl CreateFromJson for NetflowCollector

Enables the creation of a NetflowCollector instance from a JSON representation. Typically used when parsing JSON data from the Opsview API.

Source§

fn from_json(json: &str) -> Result<Self, Error>

Deserializes a JSON string into an instance of the implementing type. Read more
Source§

impl Debug for NetflowCollector

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NetflowCollector

Source§

fn default() -> Self

Creates a new instance of NetflowCollector with default values.

Initializes a new NetflowCollector object with all fields in their default state.

Source§

impl<'de> Deserialize<'de> for NetflowCollector

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for NetflowCollector

Source§

fn eq(&self, other: &NetflowCollector) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Persistent for NetflowCollector

Source§

fn id(&self) -> Option<u64>

Returns the unique identifier.

Source§

fn ref_(&self) -> Option<String>

Returns the reference string if it’s not empty.

Source§

fn name(&self) -> Option<String>

Returns the name if it’s not empty.

Source§

fn name_regex(&self) -> Option<String>

Source§

fn validated_name(&self, name: &str) -> Result<String, OpsviewConfigError>

Source§

fn set_name(&mut self, new_name: &str) -> Result<String, OpsviewConfigError>

Source§

fn clear_readonly(&mut self)

Source§

fn clone_new_name( original: &Self, new_name: &str, ) -> Result<Self, OpsviewConfigError>

Clones an existing object, but with a new name and with read-only fields cleared.
Source§

async fn exists( &self, client: &OpsviewClient, ) -> Result<bool, OpsviewClientError>

Checks whether the object exists in the Opsview Server. Read more
Source§

async fn fetch( &self, client: &OpsviewClient, params: Option<Params>, ) -> Result<Self, OpsviewClientError>

Retrieves the object from the Opsview Server and returns it. Read more
Source§

async fn remove( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>

Removes the object from the Opsview Server. Read more
Source§

async fn create( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>

Creates the object on the Opsview Server if it doesn’t already exist.
Source§

async fn update( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>

Updates the object on the Opsview Server if it exists, creates it if it doesn’t.
Source§

impl Serialize for NetflowCollector

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for NetflowCollector

Source§

impl StructuralPartialEq for NetflowCollector

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,