pub struct MetricService { /* private fields */ }Expand description
Implements a client for the Cloud Monitoring API.
§Example
let client = MetricService::builder().build().await?;
// use `client` to make requests to the Cloud Monitoring API.§Service Description
Manages metric descriptors, monitored resource descriptors, and time series data.
§Configuration
To configure MetricService 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
MetricService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap MetricService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl MetricService
impl MetricService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for MetricService.
let client = MetricService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: MetricService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: MetricService + '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_monitored_resource_descriptors(
&self,
) -> ListMonitoredResourceDescriptors
pub fn list_monitored_resource_descriptors( &self, ) -> ListMonitoredResourceDescriptors
Lists monitored resource descriptors that match a filter.
Sourcepub fn get_monitored_resource_descriptor(
&self,
) -> GetMonitoredResourceDescriptor
pub fn get_monitored_resource_descriptor( &self, ) -> GetMonitoredResourceDescriptor
Gets a single monitored resource descriptor.
Sourcepub fn list_metric_descriptors(&self) -> ListMetricDescriptors
pub fn list_metric_descriptors(&self) -> ListMetricDescriptors
Lists metric descriptors that match a filter.
Sourcepub fn get_metric_descriptor(&self) -> GetMetricDescriptor
pub fn get_metric_descriptor(&self) -> GetMetricDescriptor
Gets a single metric descriptor.
Sourcepub fn create_metric_descriptor(&self) -> CreateMetricDescriptor
pub fn create_metric_descriptor(&self) -> CreateMetricDescriptor
Creates a new metric descriptor. The creation is executed asynchronously. User-created metric descriptors define custom metrics. The metric descriptor is updated if it already exists, except that metric labels are never removed.
Sourcepub fn delete_metric_descriptor(&self) -> DeleteMetricDescriptor
pub fn delete_metric_descriptor(&self) -> DeleteMetricDescriptor
Deletes a metric descriptor. Only user-created custom metrics can be deleted.
Sourcepub fn list_time_series(&self) -> ListTimeSeries
pub fn list_time_series(&self) -> ListTimeSeries
Lists time series that match a filter.
Sourcepub fn create_time_series(&self) -> CreateTimeSeries
pub fn create_time_series(&self) -> CreateTimeSeries
Creates or adds data to one or more time series. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response. This method does not support resource locations constraint of an organization policy.
Sourcepub fn create_service_time_series(&self) -> CreateServiceTimeSeries
pub fn create_service_time_series(&self) -> CreateServiceTimeSeries
Creates or adds data to one or more service time series. A service time series is a time series for a metric from a Google Cloud service. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response. This endpoint rejects writes to user-defined metrics. This method is only for use by Google Cloud services. Use projects.timeSeries.create instead.
Trait Implementations§
Source§impl Clone for MetricService
impl Clone for MetricService
Source§fn clone(&self) -> MetricService
fn clone(&self) -> MetricService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more