pub struct SnoozeService { /* private fields */ }Expand description
Implements a client for the Cloud Monitoring API.
§Service Description
The SnoozeService API is used to temporarily prevent an alert policy from generating alerts. A Snooze is a description of the criteria under which one or more alert policies should not fire alerts for the specified duration.
§Configuration
SnoozeService has various configuration parameters, the defaults should
work with most applications.
§Pooling and Cloning
SnoozeService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap SnoozeService in
an Rc or Arc to reuse it, because it already uses an Arc
internally.
Implementations§
Source§impl SnoozeService
impl SnoozeService
Sourcepub async fn new_with_config(conf: ClientConfig) -> Result<Self>
pub async fn new_with_config(conf: ClientConfig) -> Result<Self>
Creates a new client with the specified configuration.
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: SnoozeService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: SnoozeService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is when mocking the client.
Sourcepub fn create_snooze(&self, parent: impl Into<String>) -> CreateSnooze
pub fn create_snooze(&self, parent: impl Into<String>) -> CreateSnooze
Creates a Snooze that will prevent alerts, which match the provided
criteria, from being opened. The Snooze applies for a specific time
interval.
Sourcepub fn list_snoozes(&self, parent: impl Into<String>) -> ListSnoozes
pub fn list_snoozes(&self, parent: impl Into<String>) -> ListSnoozes
Lists the Snoozes associated with a project. Can optionally pass in
filter, which specifies predicates to match Snoozes.
Sourcepub fn get_snooze(&self, name: impl Into<String>) -> GetSnooze
pub fn get_snooze(&self, name: impl Into<String>) -> GetSnooze
Retrieves a Snooze by name.
Sourcepub fn update_snooze(&self, snooze: impl Into<Snooze>) -> UpdateSnooze
pub fn update_snooze(&self, snooze: impl Into<Snooze>) -> UpdateSnooze
Updates a Snooze, identified by its name, with the parameters in the
given Snooze object.
Trait Implementations§
Source§impl Clone for SnoozeService
impl Clone for SnoozeService
Source§fn clone(&self) -> SnoozeService
fn clone(&self) -> SnoozeService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more