pub struct SnoozeService { /* private fields */ }Expand description
Implements a client for the Cloud Monitoring API.
§Example
let client = SnoozeService::builder().build().await?;
// use `client` to make requests to 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
To configure SnoozeService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://monitoring.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§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 fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for SnoozeService.
let client = SnoozeService::builder().build().await?;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 in tests mocking the client’s behavior.
Sourcepub fn create_snooze(&self) -> CreateSnooze
pub fn create_snooze(&self) -> 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) -> ListSnoozes
pub fn list_snoozes(&self) -> ListSnoozes
Lists the Snoozes associated with a project. Can optionally pass in
filter, which specifies predicates to match Snoozes.
Sourcepub fn get_snooze(&self) -> GetSnooze
pub fn get_snooze(&self) -> GetSnooze
Retrieves a Snooze by name.
Sourcepub fn update_snooze(&self) -> UpdateSnooze
pub fn update_snooze(&self) -> 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