aws_sdk_pi/client/
get_resource_metrics.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`GetResourceMetrics`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder) operation.
4    /// This operation supports pagination; See [`into_paginator()`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::into_paginator).
5    ///
6    /// - The fluent builder is configurable:
7    ///   - [`service_type(ServiceType)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::service_type) / [`set_service_type(Option<ServiceType>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::set_service_type):<br>required: **true**<br><p>The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:</p> <ul>  <li>   <p><code>RDS</code></p></li>  <li>   <p><code>DOCDB</code></p></li> </ul><br>
8    ///   - [`identifier(impl Into<String>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::identifier) / [`set_identifier(Option<String>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::set_identifier):<br>required: **true**<br><p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p> <p>To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>.</p><br>
9    ///   - [`metric_queries(MetricQuery)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::metric_queries) / [`set_metric_queries(Option<Vec::<MetricQuery>>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::set_metric_queries):<br>required: **true**<br><p>An array of one or more queries to perform. Each query must specify a Performance Insights metric and specify an aggregate function, and you can provide filtering criteria. You must append the aggregate function to the metric. For example, to find the average for the metric <code>db.load</code> you must use <code>db.load.avg</code>. Valid values for aggregate functions include <code>.avg</code>, <code>.min</code>, <code>.max</code>, and <code>.sum</code>.</p><br>
10    ///   - [`start_time(DateTime)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::start_time) / [`set_start_time(Option<DateTime>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::set_start_time):<br>required: **true**<br><p>The date and time specifying the beginning of the requested time series query range. You can't specify a <code>StartTime</code> that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is <i>inclusive</i>. Thus, the command returns data points equal to or greater than <code>StartTime</code>.</p> <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>.</p><br>
11    ///   - [`end_time(DateTime)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::end_time) / [`set_end_time(Option<DateTime>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::set_end_time):<br>required: **true**<br><p>The date and time specifying the end of the requested time series query range. The value specified is <i>exclusive</i>. Thus, the command returns data points less than (but not equal to) <code>EndTime</code>.</p> <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p><br>
12    ///   - [`period_in_seconds(i32)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::period_in_seconds) / [`set_period_in_seconds(Option<i32>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::set_period_in_seconds):<br>required: **false**<br><p>The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:</p> <ul>  <li>   <p><code>1</code> (one second)</p></li>  <li>   <p><code>60</code> (one minute)</p></li>  <li>   <p><code>300</code> (five minutes)</p></li>  <li>   <p><code>3600</code> (one hour)</p></li>  <li>   <p><code>86400</code> (twenty-four hours)</p></li> </ul> <p>If you don't specify <code>PeriodInSeconds</code>, then Performance Insights will choose a value for you, with a goal of returning roughly 100-200 data points in the response.</p><br>
13    ///   - [`max_results(i32)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::max_results) / [`set_max_results(Option<i32>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::set_max_results):<br>required: **false**<br><p>The maximum number of items to return in the response.</p><br>
14    ///   - [`next_token(impl Into<String>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::next_token) / [`set_next_token(Option<String>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::set_next_token):<br>required: **false**<br><p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p><br>
15    ///   - [`period_alignment(PeriodAlignment)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::period_alignment) / [`set_period_alignment(Option<PeriodAlignment>)`](crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::set_period_alignment):<br>required: **false**<br><p>The returned timestamp which is the start or end time of the time periods. The default value is <code>END_TIME</code>.</p><br>
16    /// - On success, responds with [`GetResourceMetricsOutput`](crate::operation::get_resource_metrics::GetResourceMetricsOutput) with field(s):
17    ///   - [`aligned_start_time(Option<DateTime>)`](crate::operation::get_resource_metrics::GetResourceMetricsOutput::aligned_start_time): <p>The start time for the returned metrics, after alignment to a granular boundary (as specified by <code>PeriodInSeconds</code>). <code>AlignedStartTime</code> will be less than or equal to the value of the user-specified <code>StartTime</code>.</p>
18    ///   - [`aligned_end_time(Option<DateTime>)`](crate::operation::get_resource_metrics::GetResourceMetricsOutput::aligned_end_time): <p>The end time for the returned metrics, after alignment to a granular boundary (as specified by <code>PeriodInSeconds</code>). <code>AlignedEndTime</code> will be greater than or equal to the value of the user-specified <code>Endtime</code>.</p>
19    ///   - [`identifier(Option<String>)`](crate::operation::get_resource_metrics::GetResourceMetricsOutput::identifier): <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p>
20    ///   - [`metric_list(Option<Vec::<MetricKeyDataPoints>>)`](crate::operation::get_resource_metrics::GetResourceMetricsOutput::metric_list): <p>An array of metric results, where each array element contains all of the data points for a particular dimension.</p>
21    ///   - [`next_token(Option<String>)`](crate::operation::get_resource_metrics::GetResourceMetricsOutput::next_token): <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
22    /// - On failure, responds with [`SdkError<GetResourceMetricsError>`](crate::operation::get_resource_metrics::GetResourceMetricsError)
23    pub fn get_resource_metrics(&self) -> crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder {
24        crate::operation::get_resource_metrics::builders::GetResourceMetricsFluentBuilder::new(self.handle.clone())
25    }
26}