pub struct AlertPolicyService { /* private fields */ }
Expand description
Implements a client for the Cloud Monitoring API.
§Example
let client = AlertPolicyService::builder().build().await?;
// use `client` to make requests to the Cloud Monitoring API.
§Service Description
The AlertPolicyService API is used to manage (list, create, delete, edit) alert policies in Cloud Monitoring. An alerting policy is a description of the conditions under which some aspect of your system is considered to be “unhealthy” and the ways to notify people or services about this state. In addition to using this API, alert policies can also be managed through Cloud Monitoring, which can be reached by clicking the “Monitoring” tab in Cloud console.
§Configuration
To configure AlertPolicyService
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
AlertPolicyService
holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap AlertPolicyService
in
an Rc or Arc to reuse it, because it
already uses an Arc
internally.
Implementations§
Source§impl AlertPolicyService
impl AlertPolicyService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for AlertPolicyService.
let client = AlertPolicyService::builder().build().await?;
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: AlertPolicyService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: AlertPolicyService + '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 list_alert_policies(&self) -> ListAlertPolicies
pub fn list_alert_policies(&self) -> ListAlertPolicies
Lists the existing alerting policies for the workspace.
Sourcepub fn get_alert_policy(&self) -> GetAlertPolicy
pub fn get_alert_policy(&self) -> GetAlertPolicy
Gets a single alerting policy.
Sourcepub fn create_alert_policy(&self) -> CreateAlertPolicy
pub fn create_alert_policy(&self) -> CreateAlertPolicy
Creates a new alerting policy.
Design your application to single-thread API calls that modify the state of alerting policies in a single project. This includes calls to CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy.
Sourcepub fn delete_alert_policy(&self) -> DeleteAlertPolicy
pub fn delete_alert_policy(&self) -> DeleteAlertPolicy
Deletes an alerting policy.
Design your application to single-thread API calls that modify the state of alerting policies in a single project. This includes calls to CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy.
Sourcepub fn update_alert_policy(&self) -> UpdateAlertPolicy
pub fn update_alert_policy(&self) -> UpdateAlertPolicy
Updates an alerting policy. You can either replace the entire policy with
a new one or replace only certain fields in the current alerting policy by
specifying the fields to be updated via updateMask
. Returns the
updated alerting policy.
Design your application to single-thread API calls that modify the state of alerting policies in a single project. This includes calls to CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy.
Trait Implementations§
Source§impl Clone for AlertPolicyService
impl Clone for AlertPolicyService
Source§fn clone(&self) -> AlertPolicyService
fn clone(&self) -> AlertPolicyService
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more