pub struct AlertPolicyService { /* private fields */ }Expand description
Implements a client for 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
AlertPolicyService has various configuration parameters, the defaults should
work with most applications.
§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 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: 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 when mocking the client.
Sourcepub fn list_alert_policies(&self, name: impl Into<String>) -> ListAlertPolicies
pub fn list_alert_policies(&self, name: impl Into<String>) -> ListAlertPolicies
Lists the existing alerting policies for the workspace.
Sourcepub fn get_alert_policy(&self, name: impl Into<String>) -> GetAlertPolicy
pub fn get_alert_policy(&self, name: impl Into<String>) -> GetAlertPolicy
Gets a single alerting policy.
Sourcepub fn create_alert_policy(&self, name: impl Into<String>) -> CreateAlertPolicy
pub fn create_alert_policy(&self, name: impl Into<String>) -> 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, name: impl Into<String>) -> DeleteAlertPolicy
pub fn delete_alert_policy(&self, name: impl Into<String>) -> 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,
alert_policy: impl Into<AlertPolicy>,
) -> UpdateAlertPolicy
pub fn update_alert_policy( &self, alert_policy: impl Into<AlertPolicy>, ) -> 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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more