Role

Struct Role 

Source
pub struct Role {
Show 22 fields pub name: String, pub access_hostgroups: Option<ConfigRefMap<HostGroupRef>>, pub access_keywords: Option<ConfigRefMap<HashtagRef>>, pub access_servicegroups: Option<ConfigRefMap<ServiceGroupRef>>, pub accesses: Option<HashSet<Access>>, pub all_bsm_components: Option<bool>, pub all_bsm_edit: Option<bool>, pub all_bsm_view: Option<bool>, pub all_hostgroups: Option<bool>, pub all_keywords: Option<bool>, pub all_monitoringservers: Option<bool>, pub all_remotely_managed_clusters: Option<bool>, pub all_servicegroups: Option<bool>, pub contacts: Option<ConfigRefMap<ContactRef>>, pub description: Option<String>, pub hostgroups: Option<ConfigRefMap<HostGroupRef>>, pub monitoringservers: Option<ConfigObjectMap<MonitoringServer>>, pub remotely_managed_clusters: Option<ConfigRefMap<MonitoringClusterRef>>, pub tenancy: Option<TenancyRef>, pub id: Option<u64>, pub ref_: Option<String>, pub uncommitted: Option<bool>,
}
Expand description

Represents a Role in Opsview.

Roles are used to define a set of permissions for users within the Opsview system.

This struct defines the structure for a role entity as used in Opsview.

Fields§

§name: String

The name of the Role.

§access_hostgroups: Option<ConfigRefMap<HostGroupRef>>

ConfigRefMap of HostGroupRef objects that the Role has access to.

§access_keywords: Option<ConfigRefMap<HashtagRef>>

ConfigRefMap of HashtagRef objects that the Role has access to.

§access_servicegroups: Option<ConfigRefMap<ServiceGroupRef>>

ConfigRefMap of ServiceGroupRef objects that the Role has access to.

§accesses: Option<HashSet<Access>>

HashSet of Access objects that the Role has access to.

§all_bsm_components: Option<bool>

A boolean indicating whether the Role has access to all super::BSMComponents. Default: Some(false).

§all_bsm_edit: Option<bool>

A boolean indicating whether the Role has access to all BSM edit operations. Some(false).

§all_bsm_view: Option<bool>

A boolean indicating whether the Role has access to all BSM view operations. Some(false).

§all_hostgroups: Option<bool>

A boolean indicating whether the Role has access to all HostGroups. Some(false).

§all_keywords: Option<bool>

A boolean indicating whether the Role has access to all Hashtags. Some(false).

§all_monitoringservers: Option<bool>

A boolean indicating whether the Role has access to all monitoring servers. Some(false).

§all_remotely_managed_clusters: Option<bool>

A boolean indicating whether the Role has access to all remotely managed clusters. Some(false).

§all_servicegroups: Option<bool>

A boolean indicating whether the Role has access to all ServiceGroups. Some(false).

§contacts: Option<ConfigRefMap<ContactRef>>

ConfigRefMap of ContactRef objects associated with this role.

§description: Option<String>

A description of the Role.

§hostgroups: Option<ConfigRefMap<HostGroupRef>>

ConfigRefMap of HostGroupRef objects associated with this role.

§monitoringservers: Option<ConfigObjectMap<MonitoringServer>>

ConfigObjectMap of MonitoringServer objects associated with this role.

§remotely_managed_clusters: Option<ConfigRefMap<MonitoringClusterRef>>

ConfigRefMap of remotely managed MonitoringClusterRef objects associated with this role.

§tenancy: Option<TenancyRef>

The TenancyRef of the Role.

§id: Option<u64>

The unique identifier of the Role.

§ref_: Option<String>

A reference string unique to this Role.

§uncommitted: Option<bool>

A boolean indicating whether the Role is uncommitted.

Trait Implementations§

Source§

impl Clone for Role

Source§

fn clone(&self) -> Role

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 Role

Source§

fn builder() -> Self::Builder

Returns a builder for constructing a Role object.

§Returns

A RoleBuilder object.

Source§

fn config_path() -> Option<String>

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

§Returns

A string representing the API path where roles are configured.

Source§

fn unique_name(&self) -> String

Returns the unique name of the Role object.

This name is used to identify the Role when building the HashMap for an ConfigObjectMap.

§Returns

A string representing the unique name of the Role.

Source§

type Builder = RoleBuilder

Source§

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

Source§

impl CreateFromJson for Role

Enables the creation of a Role 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 Role

Source§

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

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

impl Default for Role

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Role

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 From<Role> for RoleRef

Source§

fn from(full_object: Role) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Role

Source§

fn eq(&self, other: &Role) -> 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 Role

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 Role

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 Role

Source§

impl StructuralPartialEq for Role

Auto Trait Implementations§

§

impl Freeze for Role

§

impl RefUnwindSafe for Role

§

impl Send for Role

§

impl Sync for Role

§

impl Unpin for Role

§

impl UnwindSafe for Role

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,