aws_sdk_lightsail/operation/get_relational_database_metric_data/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_relational_database_metric_data::_get_relational_database_metric_data_output::GetRelationalDatabaseMetricDataOutputBuilder;
3
4pub use crate::operation::get_relational_database_metric_data::_get_relational_database_metric_data_input::GetRelationalDatabaseMetricDataInputBuilder;
5
6impl crate::operation::get_relational_database_metric_data::builders::GetRelationalDatabaseMetricDataInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricDataOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricDataError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.get_relational_database_metric_data();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `GetRelationalDatabaseMetricData`.
24///
25/// <p>Returns the data points of the specified metric for a database in Amazon Lightsail.</p>
26/// <p>Metrics report the utilization of your resources, and the error counts generated by them. Monitor and collect metric data regularly to maintain the reliability, availability, and performance of your resources.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct GetRelationalDatabaseMetricDataFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::get_relational_database_metric_data::builders::GetRelationalDatabaseMetricDataInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricDataOutput,
36 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricDataError,
37 > for GetRelationalDatabaseMetricDataFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricDataOutput,
45 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricDataError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl GetRelationalDatabaseMetricDataFluentBuilder {
52 /// Creates a new `GetRelationalDatabaseMetricDataFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the GetRelationalDatabaseMetricData as a reference.
61 pub fn as_input(&self) -> &crate::operation::get_relational_database_metric_data::builders::GetRelationalDatabaseMetricDataInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricDataOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricDataError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricData::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricData::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricDataOutput,
98 crate::operation::get_relational_database_metric_data::GetRelationalDatabaseMetricDataError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>The name of your database from which to get metric data.</p>
113 pub fn relational_database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.relational_database_name(input.into());
115 self
116 }
117 /// <p>The name of your database from which to get metric data.</p>
118 pub fn set_relational_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.inner = self.inner.set_relational_database_name(input);
120 self
121 }
122 /// <p>The name of your database from which to get metric data.</p>
123 pub fn get_relational_database_name(&self) -> &::std::option::Option<::std::string::String> {
124 self.inner.get_relational_database_name()
125 }
126 /// <p>The metric for which you want to return information.</p>
127 /// <p>Valid relational database metric names are listed below, along with the most useful <code>statistics</code> to include in your request, and the published <code>unit</code> value. All relational database metric data is available in 1-minute (60 seconds) granularity.</p>
128 /// <ul>
129 /// <li>
130 /// <p><b> <code>CPUUtilization</code> </b> - The percentage of CPU utilization currently in use on the database.</p>
131 /// <p><code>Statistics</code>: The most useful statistics are <code>Maximum</code> and <code>Average</code>.</p>
132 /// <p><code>Unit</code>: The published unit is <code>Percent</code>.</p></li>
133 /// <li>
134 /// <p><b> <code>DatabaseConnections</code> </b> - The number of database connections in use.</p>
135 /// <p><code>Statistics</code>: The most useful statistics are <code>Maximum</code> and <code>Sum</code>.</p>
136 /// <p><code>Unit</code>: The published unit is <code>Count</code>.</p></li>
137 /// <li>
138 /// <p><b> <code>DiskQueueDepth</code> </b> - The number of outstanding IOs (read/write requests) that are waiting to access the disk.</p>
139 /// <p><code>Statistics</code>: The most useful statistic is <code>Sum</code>.</p>
140 /// <p><code>Unit</code>: The published unit is <code>Count</code>.</p></li>
141 /// <li>
142 /// <p><b> <code>FreeStorageSpace</code> </b> - The amount of available storage space.</p>
143 /// <p><code>Statistics</code>: The most useful statistic is <code>Sum</code>.</p>
144 /// <p><code>Unit</code>: The published unit is <code>Bytes</code>.</p></li>
145 /// <li>
146 /// <p><b> <code>NetworkReceiveThroughput</code> </b> - The incoming (Receive) network traffic on the database, including both customer database traffic and AWS traffic used for monitoring and replication.</p>
147 /// <p><code>Statistics</code>: The most useful statistic is <code>Average</code>.</p>
148 /// <p><code>Unit</code>: The published unit is <code>Bytes/Second</code>.</p></li>
149 /// <li>
150 /// <p><b> <code>NetworkTransmitThroughput</code> </b> - The outgoing (Transmit) network traffic on the database, including both customer database traffic and AWS traffic used for monitoring and replication.</p>
151 /// <p><code>Statistics</code>: The most useful statistic is <code>Average</code>.</p>
152 /// <p><code>Unit</code>: The published unit is <code>Bytes/Second</code>.</p></li>
153 /// </ul>
154 pub fn metric_name(mut self, input: crate::types::RelationalDatabaseMetricName) -> Self {
155 self.inner = self.inner.metric_name(input);
156 self
157 }
158 /// <p>The metric for which you want to return information.</p>
159 /// <p>Valid relational database metric names are listed below, along with the most useful <code>statistics</code> to include in your request, and the published <code>unit</code> value. All relational database metric data is available in 1-minute (60 seconds) granularity.</p>
160 /// <ul>
161 /// <li>
162 /// <p><b> <code>CPUUtilization</code> </b> - The percentage of CPU utilization currently in use on the database.</p>
163 /// <p><code>Statistics</code>: The most useful statistics are <code>Maximum</code> and <code>Average</code>.</p>
164 /// <p><code>Unit</code>: The published unit is <code>Percent</code>.</p></li>
165 /// <li>
166 /// <p><b> <code>DatabaseConnections</code> </b> - The number of database connections in use.</p>
167 /// <p><code>Statistics</code>: The most useful statistics are <code>Maximum</code> and <code>Sum</code>.</p>
168 /// <p><code>Unit</code>: The published unit is <code>Count</code>.</p></li>
169 /// <li>
170 /// <p><b> <code>DiskQueueDepth</code> </b> - The number of outstanding IOs (read/write requests) that are waiting to access the disk.</p>
171 /// <p><code>Statistics</code>: The most useful statistic is <code>Sum</code>.</p>
172 /// <p><code>Unit</code>: The published unit is <code>Count</code>.</p></li>
173 /// <li>
174 /// <p><b> <code>FreeStorageSpace</code> </b> - The amount of available storage space.</p>
175 /// <p><code>Statistics</code>: The most useful statistic is <code>Sum</code>.</p>
176 /// <p><code>Unit</code>: The published unit is <code>Bytes</code>.</p></li>
177 /// <li>
178 /// <p><b> <code>NetworkReceiveThroughput</code> </b> - The incoming (Receive) network traffic on the database, including both customer database traffic and AWS traffic used for monitoring and replication.</p>
179 /// <p><code>Statistics</code>: The most useful statistic is <code>Average</code>.</p>
180 /// <p><code>Unit</code>: The published unit is <code>Bytes/Second</code>.</p></li>
181 /// <li>
182 /// <p><b> <code>NetworkTransmitThroughput</code> </b> - The outgoing (Transmit) network traffic on the database, including both customer database traffic and AWS traffic used for monitoring and replication.</p>
183 /// <p><code>Statistics</code>: The most useful statistic is <code>Average</code>.</p>
184 /// <p><code>Unit</code>: The published unit is <code>Bytes/Second</code>.</p></li>
185 /// </ul>
186 pub fn set_metric_name(mut self, input: ::std::option::Option<crate::types::RelationalDatabaseMetricName>) -> Self {
187 self.inner = self.inner.set_metric_name(input);
188 self
189 }
190 /// <p>The metric for which you want to return information.</p>
191 /// <p>Valid relational database metric names are listed below, along with the most useful <code>statistics</code> to include in your request, and the published <code>unit</code> value. All relational database metric data is available in 1-minute (60 seconds) granularity.</p>
192 /// <ul>
193 /// <li>
194 /// <p><b> <code>CPUUtilization</code> </b> - The percentage of CPU utilization currently in use on the database.</p>
195 /// <p><code>Statistics</code>: The most useful statistics are <code>Maximum</code> and <code>Average</code>.</p>
196 /// <p><code>Unit</code>: The published unit is <code>Percent</code>.</p></li>
197 /// <li>
198 /// <p><b> <code>DatabaseConnections</code> </b> - The number of database connections in use.</p>
199 /// <p><code>Statistics</code>: The most useful statistics are <code>Maximum</code> and <code>Sum</code>.</p>
200 /// <p><code>Unit</code>: The published unit is <code>Count</code>.</p></li>
201 /// <li>
202 /// <p><b> <code>DiskQueueDepth</code> </b> - The number of outstanding IOs (read/write requests) that are waiting to access the disk.</p>
203 /// <p><code>Statistics</code>: The most useful statistic is <code>Sum</code>.</p>
204 /// <p><code>Unit</code>: The published unit is <code>Count</code>.</p></li>
205 /// <li>
206 /// <p><b> <code>FreeStorageSpace</code> </b> - The amount of available storage space.</p>
207 /// <p><code>Statistics</code>: The most useful statistic is <code>Sum</code>.</p>
208 /// <p><code>Unit</code>: The published unit is <code>Bytes</code>.</p></li>
209 /// <li>
210 /// <p><b> <code>NetworkReceiveThroughput</code> </b> - The incoming (Receive) network traffic on the database, including both customer database traffic and AWS traffic used for monitoring and replication.</p>
211 /// <p><code>Statistics</code>: The most useful statistic is <code>Average</code>.</p>
212 /// <p><code>Unit</code>: The published unit is <code>Bytes/Second</code>.</p></li>
213 /// <li>
214 /// <p><b> <code>NetworkTransmitThroughput</code> </b> - The outgoing (Transmit) network traffic on the database, including both customer database traffic and AWS traffic used for monitoring and replication.</p>
215 /// <p><code>Statistics</code>: The most useful statistic is <code>Average</code>.</p>
216 /// <p><code>Unit</code>: The published unit is <code>Bytes/Second</code>.</p></li>
217 /// </ul>
218 pub fn get_metric_name(&self) -> &::std::option::Option<crate::types::RelationalDatabaseMetricName> {
219 self.inner.get_metric_name()
220 }
221 /// <p>The granularity, in seconds, of the returned data points.</p>
222 /// <p>All relational database metric data is available in 1-minute (60 seconds) granularity.</p>
223 pub fn period(mut self, input: i32) -> Self {
224 self.inner = self.inner.period(input);
225 self
226 }
227 /// <p>The granularity, in seconds, of the returned data points.</p>
228 /// <p>All relational database metric data is available in 1-minute (60 seconds) granularity.</p>
229 pub fn set_period(mut self, input: ::std::option::Option<i32>) -> Self {
230 self.inner = self.inner.set_period(input);
231 self
232 }
233 /// <p>The granularity, in seconds, of the returned data points.</p>
234 /// <p>All relational database metric data is available in 1-minute (60 seconds) granularity.</p>
235 pub fn get_period(&self) -> &::std::option::Option<i32> {
236 self.inner.get_period()
237 }
238 /// <p>The start of the time interval from which to get metric data.</p>
239 /// <p>Constraints:</p>
240 /// <ul>
241 /// <li>
242 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
243 /// <li>
244 /// <p>Specified in the Unix time format.</p>
245 /// <p>For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the start time.</p></li>
246 /// </ul>
247 pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
248 self.inner = self.inner.start_time(input);
249 self
250 }
251 /// <p>The start of the time interval from which to get metric data.</p>
252 /// <p>Constraints:</p>
253 /// <ul>
254 /// <li>
255 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
256 /// <li>
257 /// <p>Specified in the Unix time format.</p>
258 /// <p>For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the start time.</p></li>
259 /// </ul>
260 pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
261 self.inner = self.inner.set_start_time(input);
262 self
263 }
264 /// <p>The start of the time interval from which to get metric data.</p>
265 /// <p>Constraints:</p>
266 /// <ul>
267 /// <li>
268 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
269 /// <li>
270 /// <p>Specified in the Unix time format.</p>
271 /// <p>For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the start time.</p></li>
272 /// </ul>
273 pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
274 self.inner.get_start_time()
275 }
276 /// <p>The end of the time interval from which to get metric data.</p>
277 /// <p>Constraints:</p>
278 /// <ul>
279 /// <li>
280 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
281 /// <li>
282 /// <p>Specified in the Unix time format.</p>
283 /// <p>For example, if you wish to use an end time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the end time.</p></li>
284 /// </ul>
285 pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
286 self.inner = self.inner.end_time(input);
287 self
288 }
289 /// <p>The end of the time interval from which to get metric data.</p>
290 /// <p>Constraints:</p>
291 /// <ul>
292 /// <li>
293 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
294 /// <li>
295 /// <p>Specified in the Unix time format.</p>
296 /// <p>For example, if you wish to use an end time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the end time.</p></li>
297 /// </ul>
298 pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
299 self.inner = self.inner.set_end_time(input);
300 self
301 }
302 /// <p>The end of the time interval from which to get metric data.</p>
303 /// <p>Constraints:</p>
304 /// <ul>
305 /// <li>
306 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
307 /// <li>
308 /// <p>Specified in the Unix time format.</p>
309 /// <p>For example, if you wish to use an end time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the end time.</p></li>
310 /// </ul>
311 pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
312 self.inner.get_end_time()
313 }
314 /// <p>The unit for the metric data request. Valid units depend on the metric data being requested. For the valid units with each available metric, see the <code>metricName</code> parameter.</p>
315 pub fn unit(mut self, input: crate::types::MetricUnit) -> Self {
316 self.inner = self.inner.unit(input);
317 self
318 }
319 /// <p>The unit for the metric data request. Valid units depend on the metric data being requested. For the valid units with each available metric, see the <code>metricName</code> parameter.</p>
320 pub fn set_unit(mut self, input: ::std::option::Option<crate::types::MetricUnit>) -> Self {
321 self.inner = self.inner.set_unit(input);
322 self
323 }
324 /// <p>The unit for the metric data request. Valid units depend on the metric data being requested. For the valid units with each available metric, see the <code>metricName</code> parameter.</p>
325 pub fn get_unit(&self) -> &::std::option::Option<crate::types::MetricUnit> {
326 self.inner.get_unit()
327 }
328 ///
329 /// Appends an item to `statistics`.
330 ///
331 /// To override the contents of this collection use [`set_statistics`](Self::set_statistics).
332 ///
333 /// <p>The statistic for the metric.</p>
334 /// <p>The following statistics are available:</p>
335 /// <ul>
336 /// <li>
337 /// <p><code>Minimum</code> - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.</p></li>
338 /// <li>
339 /// <p><code>Maximum</code> - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.</p></li>
340 /// <li>
341 /// <p><code>Sum</code> - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.</p></li>
342 /// <li>
343 /// <p><code>Average</code> - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.</p></li>
344 /// <li>
345 /// <p><code>SampleCount</code> - The count, or number, of data points used for the statistical calculation.</p></li>
346 /// </ul>
347 pub fn statistics(mut self, input: crate::types::MetricStatistic) -> Self {
348 self.inner = self.inner.statistics(input);
349 self
350 }
351 /// <p>The statistic for the metric.</p>
352 /// <p>The following statistics are available:</p>
353 /// <ul>
354 /// <li>
355 /// <p><code>Minimum</code> - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.</p></li>
356 /// <li>
357 /// <p><code>Maximum</code> - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.</p></li>
358 /// <li>
359 /// <p><code>Sum</code> - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.</p></li>
360 /// <li>
361 /// <p><code>Average</code> - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.</p></li>
362 /// <li>
363 /// <p><code>SampleCount</code> - The count, or number, of data points used for the statistical calculation.</p></li>
364 /// </ul>
365 pub fn set_statistics(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricStatistic>>) -> Self {
366 self.inner = self.inner.set_statistics(input);
367 self
368 }
369 /// <p>The statistic for the metric.</p>
370 /// <p>The following statistics are available:</p>
371 /// <ul>
372 /// <li>
373 /// <p><code>Minimum</code> - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.</p></li>
374 /// <li>
375 /// <p><code>Maximum</code> - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.</p></li>
376 /// <li>
377 /// <p><code>Sum</code> - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.</p></li>
378 /// <li>
379 /// <p><code>Average</code> - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.</p></li>
380 /// <li>
381 /// <p><code>SampleCount</code> - The count, or number, of data points used for the statistical calculation.</p></li>
382 /// </ul>
383 pub fn get_statistics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricStatistic>> {
384 self.inner.get_statistics()
385 }
386}