aws_sdk_rds/operation/modify_current_db_cluster_capacity/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_current_db_cluster_capacity::_modify_current_db_cluster_capacity_output::ModifyCurrentDbClusterCapacityOutputBuilder;
3
4pub use crate::operation::modify_current_db_cluster_capacity::_modify_current_db_cluster_capacity_input::ModifyCurrentDbClusterCapacityInputBuilder;
5
6impl crate::operation::modify_current_db_cluster_capacity::builders::ModifyCurrentDbClusterCapacityInputBuilder {
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::modify_current_db_cluster_capacity::ModifyCurrentDbClusterCapacityOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDBClusterCapacityError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.modify_current_db_cluster_capacity();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ModifyCurrentDBClusterCapacity`.
24///
25/// <p>Set the capacity of an Aurora Serverless v1 DB cluster to a specific value.</p>
26/// <p>Aurora Serverless v1 scales seamlessly based on the workload on the DB cluster. In some cases, the capacity might not scale fast enough to meet a sudden change in workload, such as a large number of new transactions. Call <code>ModifyCurrentDBClusterCapacity</code> to set the capacity explicitly.</p>
27/// <p>After this call sets the DB cluster capacity, Aurora Serverless v1 can automatically scale the DB cluster based on the cooldown period for scaling up and the cooldown period for scaling down.</p>
28/// <p>For more information about Aurora Serverless v1, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html">Using Amazon Aurora Serverless v1</a> in the <i>Amazon Aurora User Guide</i>.</p><important>
29/// <p>If you call <code>ModifyCurrentDBClusterCapacity</code> with the default <code>TimeoutAction</code>, connections that prevent Aurora Serverless v1 from finding a scaling point might be dropped. For more information about scaling points, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.how-it-works.html#aurora-serverless.how-it-works.auto-scaling"> Autoscaling for Aurora Serverless v1</a> in the <i>Amazon Aurora User Guide</i>.</p>
30/// </important> <note>
31/// <p>This operation only applies to Aurora Serverless v1 DB clusters.</p>
32/// </note>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct ModifyCurrentDBClusterCapacityFluentBuilder {
35 handle: ::std::sync::Arc<crate::client::Handle>,
36 inner: crate::operation::modify_current_db_cluster_capacity::builders::ModifyCurrentDbClusterCapacityInputBuilder,
37 config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40 crate::client::customize::internal::CustomizableSend<
41 crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDbClusterCapacityOutput,
42 crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDBClusterCapacityError,
43 > for ModifyCurrentDBClusterCapacityFluentBuilder
44{
45 fn send(
46 self,
47 config_override: crate::config::Builder,
48 ) -> crate::client::customize::internal::BoxFuture<
49 crate::client::customize::internal::SendResult<
50 crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDbClusterCapacityOutput,
51 crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDBClusterCapacityError,
52 >,
53 > {
54 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55 }
56}
57impl ModifyCurrentDBClusterCapacityFluentBuilder {
58 /// Creates a new `ModifyCurrentDBClusterCapacityFluentBuilder`.
59 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60 Self {
61 handle,
62 inner: ::std::default::Default::default(),
63 config_override: ::std::option::Option::None,
64 }
65 }
66 /// Access the ModifyCurrentDBClusterCapacity as a reference.
67 pub fn as_input(&self) -> &crate::operation::modify_current_db_cluster_capacity::builders::ModifyCurrentDbClusterCapacityInputBuilder {
68 &self.inner
69 }
70 /// Sends the request and returns the response.
71 ///
72 /// If an error occurs, an `SdkError` will be returned with additional details that
73 /// can be matched against.
74 ///
75 /// By default, any retryable failures will be retried twice. Retry behavior
76 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77 /// set when configuring the client.
78 pub async fn send(
79 self,
80 ) -> ::std::result::Result<
81 crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDbClusterCapacityOutput,
82 ::aws_smithy_runtime_api::client::result::SdkError<
83 crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDBClusterCapacityError,
84 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85 >,
86 > {
87 let input = self
88 .inner
89 .build()
90 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91 let runtime_plugins = crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDBClusterCapacity::operation_runtime_plugins(
92 self.handle.runtime_plugins.clone(),
93 &self.handle.conf,
94 self.config_override,
95 );
96 crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDBClusterCapacity::orchestrate(&runtime_plugins, input).await
97 }
98
99 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100 pub fn customize(
101 self,
102 ) -> crate::client::customize::CustomizableOperation<
103 crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDbClusterCapacityOutput,
104 crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDBClusterCapacityError,
105 Self,
106 > {
107 crate::client::customize::CustomizableOperation::new(self)
108 }
109 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110 self.set_config_override(::std::option::Option::Some(config_override.into()));
111 self
112 }
113
114 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115 self.config_override = config_override;
116 self
117 }
118 /// <p>The DB cluster identifier for the cluster being modified. This parameter isn't case-sensitive.</p>
119 /// <p>Constraints:</p>
120 /// <ul>
121 /// <li>
122 /// <p>Must match the identifier of an existing DB cluster.</p></li>
123 /// </ul>
124 pub fn db_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.inner = self.inner.db_cluster_identifier(input.into());
126 self
127 }
128 /// <p>The DB cluster identifier for the cluster being modified. This parameter isn't case-sensitive.</p>
129 /// <p>Constraints:</p>
130 /// <ul>
131 /// <li>
132 /// <p>Must match the identifier of an existing DB cluster.</p></li>
133 /// </ul>
134 pub fn set_db_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_db_cluster_identifier(input);
136 self
137 }
138 /// <p>The DB cluster identifier for the cluster being modified. This parameter isn't case-sensitive.</p>
139 /// <p>Constraints:</p>
140 /// <ul>
141 /// <li>
142 /// <p>Must match the identifier of an existing DB cluster.</p></li>
143 /// </ul>
144 pub fn get_db_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
145 self.inner.get_db_cluster_identifier()
146 }
147 /// <p>The DB cluster capacity.</p>
148 /// <p>When you change the capacity of a paused Aurora Serverless v1 DB cluster, it automatically resumes.</p>
149 /// <p>Constraints:</p>
150 /// <ul>
151 /// <li>
152 /// <p>For Aurora MySQL, valid capacity values are <code>1</code>, <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>128</code>, and <code>256</code>.</p></li>
153 /// <li>
154 /// <p>For Aurora PostgreSQL, valid capacity values are <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>192</code>, and <code>384</code>.</p></li>
155 /// </ul>
156 pub fn capacity(mut self, input: i32) -> Self {
157 self.inner = self.inner.capacity(input);
158 self
159 }
160 /// <p>The DB cluster capacity.</p>
161 /// <p>When you change the capacity of a paused Aurora Serverless v1 DB cluster, it automatically resumes.</p>
162 /// <p>Constraints:</p>
163 /// <ul>
164 /// <li>
165 /// <p>For Aurora MySQL, valid capacity values are <code>1</code>, <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>128</code>, and <code>256</code>.</p></li>
166 /// <li>
167 /// <p>For Aurora PostgreSQL, valid capacity values are <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>192</code>, and <code>384</code>.</p></li>
168 /// </ul>
169 pub fn set_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
170 self.inner = self.inner.set_capacity(input);
171 self
172 }
173 /// <p>The DB cluster capacity.</p>
174 /// <p>When you change the capacity of a paused Aurora Serverless v1 DB cluster, it automatically resumes.</p>
175 /// <p>Constraints:</p>
176 /// <ul>
177 /// <li>
178 /// <p>For Aurora MySQL, valid capacity values are <code>1</code>, <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>128</code>, and <code>256</code>.</p></li>
179 /// <li>
180 /// <p>For Aurora PostgreSQL, valid capacity values are <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>192</code>, and <code>384</code>.</p></li>
181 /// </ul>
182 pub fn get_capacity(&self) -> &::std::option::Option<i32> {
183 self.inner.get_capacity()
184 }
185 /// <p>The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action. The default is 300.</p>
186 /// <p>Specify a value between 10 and 600 seconds.</p>
187 pub fn seconds_before_timeout(mut self, input: i32) -> Self {
188 self.inner = self.inner.seconds_before_timeout(input);
189 self
190 }
191 /// <p>The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action. The default is 300.</p>
192 /// <p>Specify a value between 10 and 600 seconds.</p>
193 pub fn set_seconds_before_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
194 self.inner = self.inner.set_seconds_before_timeout(input);
195 self
196 }
197 /// <p>The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action. The default is 300.</p>
198 /// <p>Specify a value between 10 and 600 seconds.</p>
199 pub fn get_seconds_before_timeout(&self) -> &::std::option::Option<i32> {
200 self.inner.get_seconds_before_timeout()
201 }
202 /// <p>The action to take when the timeout is reached, either <code>ForceApplyCapacityChange</code> or <code>RollbackCapacityChange</code>.</p>
203 /// <p><code>ForceApplyCapacityChange</code>, the default, sets the capacity to the specified value as soon as possible.</p>
204 /// <p><code>RollbackCapacityChange</code> ignores the capacity change if a scaling point isn't found in the timeout period.</p>
205 pub fn timeout_action(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206 self.inner = self.inner.timeout_action(input.into());
207 self
208 }
209 /// <p>The action to take when the timeout is reached, either <code>ForceApplyCapacityChange</code> or <code>RollbackCapacityChange</code>.</p>
210 /// <p><code>ForceApplyCapacityChange</code>, the default, sets the capacity to the specified value as soon as possible.</p>
211 /// <p><code>RollbackCapacityChange</code> ignores the capacity change if a scaling point isn't found in the timeout period.</p>
212 pub fn set_timeout_action(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213 self.inner = self.inner.set_timeout_action(input);
214 self
215 }
216 /// <p>The action to take when the timeout is reached, either <code>ForceApplyCapacityChange</code> or <code>RollbackCapacityChange</code>.</p>
217 /// <p><code>ForceApplyCapacityChange</code>, the default, sets the capacity to the specified value as soon as possible.</p>
218 /// <p><code>RollbackCapacityChange</code> ignores the capacity change if a scaling point isn't found in the timeout period.</p>
219 pub fn get_timeout_action(&self) -> &::std::option::Option<::std::string::String> {
220 self.inner.get_timeout_action()
221 }
222}