aws_sdk_ec2/operation/describe_instance_status/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_instance_status::_describe_instance_status_output::DescribeInstanceStatusOutputBuilder;
3
4pub use crate::operation::describe_instance_status::_describe_instance_status_input::DescribeInstanceStatusInputBuilder;
5
6impl crate::operation::describe_instance_status::builders::DescribeInstanceStatusInputBuilder {
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::describe_instance_status::DescribeInstanceStatusOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_instance_status::DescribeInstanceStatusError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_instance_status();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeInstanceStatus`.
24///
25/// <p>Describes the status of the specified instances or all of your instances. By default, only running instances are described, unless you specifically indicate to return the status of all instances.</p>
26/// <p>Instance status includes the following components:</p>
27/// <ul>
28/// <li>
29/// <p><b>Status checks</b> - Amazon EC2 performs status checks on running EC2 instances to identify hardware and software issues. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html">Status checks for your instances</a> and <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html">Troubleshoot instances with failed status checks</a> in the <i>Amazon EC2 User Guide</i>.</p></li>
30/// <li>
31/// <p><b>Scheduled events</b> - Amazon EC2 can schedule events (such as reboot, stop, or terminate) for your instances related to hardware issues, software updates, or system maintenance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html">Scheduled events for your instances</a> in the <i>Amazon EC2 User Guide</i>.</p></li>
32/// <li>
33/// <p><b>Instance state</b> - You can manage your instances from the moment you launch them through their termination. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html">Instance lifecycle</a> in the <i>Amazon EC2 User Guide</i>.</p></li>
34/// </ul><note>
35/// <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p>
36/// </note>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct DescribeInstanceStatusFluentBuilder {
39 handle: ::std::sync::Arc<crate::client::Handle>,
40 inner: crate::operation::describe_instance_status::builders::DescribeInstanceStatusInputBuilder,
41 config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl
44 crate::client::customize::internal::CustomizableSend<
45 crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
46 crate::operation::describe_instance_status::DescribeInstanceStatusError,
47 > for DescribeInstanceStatusFluentBuilder
48{
49 fn send(
50 self,
51 config_override: crate::config::Builder,
52 ) -> crate::client::customize::internal::BoxFuture<
53 crate::client::customize::internal::SendResult<
54 crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
55 crate::operation::describe_instance_status::DescribeInstanceStatusError,
56 >,
57 > {
58 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59 }
60}
61impl DescribeInstanceStatusFluentBuilder {
62 /// Creates a new `DescribeInstanceStatusFluentBuilder`.
63 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64 Self {
65 handle,
66 inner: ::std::default::Default::default(),
67 config_override: ::std::option::Option::None,
68 }
69 }
70 /// Access the DescribeInstanceStatus as a reference.
71 pub fn as_input(&self) -> &crate::operation::describe_instance_status::builders::DescribeInstanceStatusInputBuilder {
72 &self.inner
73 }
74 /// Sends the request and returns the response.
75 ///
76 /// If an error occurs, an `SdkError` will be returned with additional details that
77 /// can be matched against.
78 ///
79 /// By default, any retryable failures will be retried twice. Retry behavior
80 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81 /// set when configuring the client.
82 pub async fn send(
83 self,
84 ) -> ::std::result::Result<
85 crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
86 ::aws_smithy_runtime_api::client::result::SdkError<
87 crate::operation::describe_instance_status::DescribeInstanceStatusError,
88 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89 >,
90 > {
91 let input = self
92 .inner
93 .build()
94 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95 let runtime_plugins = crate::operation::describe_instance_status::DescribeInstanceStatus::operation_runtime_plugins(
96 self.handle.runtime_plugins.clone(),
97 &self.handle.conf,
98 self.config_override,
99 );
100 crate::operation::describe_instance_status::DescribeInstanceStatus::orchestrate(&runtime_plugins, input).await
101 }
102
103 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104 pub fn customize(
105 self,
106 ) -> crate::client::customize::CustomizableOperation<
107 crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
108 crate::operation::describe_instance_status::DescribeInstanceStatusError,
109 Self,
110 > {
111 crate::client::customize::CustomizableOperation::new(self)
112 }
113 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114 self.set_config_override(::std::option::Option::Some(config_override.into()));
115 self
116 }
117
118 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119 self.config_override = config_override;
120 self
121 }
122 /// Create a paginator for this request
123 ///
124 /// Paginators are used by calling [`send().await`](crate::operation::describe_instance_status::paginator::DescribeInstanceStatusPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
125 pub fn into_paginator(self) -> crate::operation::describe_instance_status::paginator::DescribeInstanceStatusPaginator {
126 crate::operation::describe_instance_status::paginator::DescribeInstanceStatusPaginator::new(self.handle, self.inner)
127 }
128 ///
129 /// Appends an item to `InstanceIds`.
130 ///
131 /// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
132 ///
133 /// <p>The instance IDs.</p>
134 /// <p>Default: Describes all your instances.</p>
135 /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
136 pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.inner = self.inner.instance_ids(input.into());
138 self
139 }
140 /// <p>The instance IDs.</p>
141 /// <p>Default: Describes all your instances.</p>
142 /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
143 pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
144 self.inner = self.inner.set_instance_ids(input);
145 self
146 }
147 /// <p>The instance IDs.</p>
148 /// <p>Default: Describes all your instances.</p>
149 /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
150 pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
151 self.inner.get_instance_ids()
152 }
153 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
154 /// <p>You cannot specify this parameter and the instance IDs parameter in the same request.</p>
155 pub fn max_results(mut self, input: i32) -> Self {
156 self.inner = self.inner.max_results(input);
157 self
158 }
159 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
160 /// <p>You cannot specify this parameter and the instance IDs parameter in the same request.</p>
161 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
162 self.inner = self.inner.set_max_results(input);
163 self
164 }
165 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
166 /// <p>You cannot specify this parameter and the instance IDs parameter in the same request.</p>
167 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
168 self.inner.get_max_results()
169 }
170 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
171 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.inner = self.inner.next_token(input.into());
173 self
174 }
175 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
176 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.inner = self.inner.set_next_token(input);
178 self
179 }
180 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
181 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
182 self.inner.get_next_token()
183 }
184 /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
185 pub fn dry_run(mut self, input: bool) -> Self {
186 self.inner = self.inner.dry_run(input);
187 self
188 }
189 /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
190 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
191 self.inner = self.inner.set_dry_run(input);
192 self
193 }
194 /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
195 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
196 self.inner.get_dry_run()
197 }
198 ///
199 /// Appends an item to `Filters`.
200 ///
201 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
202 ///
203 /// <p>The filters.</p>
204 /// <ul>
205 /// <li>
206 /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
207 /// <li>
208 /// <p><code>event.code</code> - The code for the scheduled event (<code>instance-reboot</code> | <code>system-reboot</code> | <code>system-maintenance</code> | <code>instance-retirement</code> | <code>instance-stop</code>).</p></li>
209 /// <li>
210 /// <p><code>event.description</code> - A description of the event.</p></li>
211 /// <li>
212 /// <p><code>event.instance-event-id</code> - The ID of the event whose date and time you are modifying.</p></li>
213 /// <li>
214 /// <p><code>event.not-after</code> - The latest end time for the scheduled event (for example, <code>2014-09-15T17:15:20.000Z</code>).</p></li>
215 /// <li>
216 /// <p><code>event.not-before</code> - The earliest start time for the scheduled event (for example, <code>2014-09-15T17:15:20.000Z</code>).</p></li>
217 /// <li>
218 /// <p><code>event.not-before-deadline</code> - The deadline for starting the event (for example, <code>2014-09-15T17:15:20.000Z</code>).</p></li>
219 /// <li>
220 /// <p><code>instance-state-code</code> - The code for the instance state, as a 16-bit unsigned integer. The high byte is used for internal purposes and should be ignored. The low byte is set based on the state represented. The valid values are 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).</p></li>
221 /// <li>
222 /// <p><code>instance-state-name</code> - The state of the instance (<code>pending</code> | <code>running</code> | <code>shutting-down</code> | <code>terminated</code> | <code>stopping</code> | <code>stopped</code>).</p></li>
223 /// <li>
224 /// <p><code>instance-status.reachability</code> - Filters on instance status where the name is <code>reachability</code> (<code>passed</code> | <code>failed</code> | <code>initializing</code> | <code>insufficient-data</code>).</p></li>
225 /// <li>
226 /// <p><code>instance-status.status</code> - The status of the instance (<code>ok</code> | <code>impaired</code> | <code>initializing</code> | <code>insufficient-data</code> | <code>not-applicable</code>).</p></li>
227 /// <li>
228 /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed instance.</p></li>
229 /// <li>
230 /// <p><code>operator.principal</code> - The principal that manages the instance. Only valid for managed instances, where <code>managed</code> is <code>true</code>.</p></li>
231 /// <li>
232 /// <p><code>system-status.reachability</code> - Filters on system status where the name is <code>reachability</code> (<code>passed</code> | <code>failed</code> | <code>initializing</code> | <code>insufficient-data</code>).</p></li>
233 /// <li>
234 /// <p><code>system-status.status</code> - The system status of the instance (<code>ok</code> | <code>impaired</code> | <code>initializing</code> | <code>insufficient-data</code> | <code>not-applicable</code>).</p></li>
235 /// <li>
236 /// <p><code>attached-ebs-status.status</code> - The status of the attached EBS volume for the instance (<code>ok</code> | <code>impaired</code> | <code>initializing</code> | <code>insufficient-data</code> | <code>not-applicable</code>).</p></li>
237 /// </ul>
238 pub fn filters(mut self, input: crate::types::Filter) -> Self {
239 self.inner = self.inner.filters(input);
240 self
241 }
242 /// <p>The filters.</p>
243 /// <ul>
244 /// <li>
245 /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
246 /// <li>
247 /// <p><code>event.code</code> - The code for the scheduled event (<code>instance-reboot</code> | <code>system-reboot</code> | <code>system-maintenance</code> | <code>instance-retirement</code> | <code>instance-stop</code>).</p></li>
248 /// <li>
249 /// <p><code>event.description</code> - A description of the event.</p></li>
250 /// <li>
251 /// <p><code>event.instance-event-id</code> - The ID of the event whose date and time you are modifying.</p></li>
252 /// <li>
253 /// <p><code>event.not-after</code> - The latest end time for the scheduled event (for example, <code>2014-09-15T17:15:20.000Z</code>).</p></li>
254 /// <li>
255 /// <p><code>event.not-before</code> - The earliest start time for the scheduled event (for example, <code>2014-09-15T17:15:20.000Z</code>).</p></li>
256 /// <li>
257 /// <p><code>event.not-before-deadline</code> - The deadline for starting the event (for example, <code>2014-09-15T17:15:20.000Z</code>).</p></li>
258 /// <li>
259 /// <p><code>instance-state-code</code> - The code for the instance state, as a 16-bit unsigned integer. The high byte is used for internal purposes and should be ignored. The low byte is set based on the state represented. The valid values are 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).</p></li>
260 /// <li>
261 /// <p><code>instance-state-name</code> - The state of the instance (<code>pending</code> | <code>running</code> | <code>shutting-down</code> | <code>terminated</code> | <code>stopping</code> | <code>stopped</code>).</p></li>
262 /// <li>
263 /// <p><code>instance-status.reachability</code> - Filters on instance status where the name is <code>reachability</code> (<code>passed</code> | <code>failed</code> | <code>initializing</code> | <code>insufficient-data</code>).</p></li>
264 /// <li>
265 /// <p><code>instance-status.status</code> - The status of the instance (<code>ok</code> | <code>impaired</code> | <code>initializing</code> | <code>insufficient-data</code> | <code>not-applicable</code>).</p></li>
266 /// <li>
267 /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed instance.</p></li>
268 /// <li>
269 /// <p><code>operator.principal</code> - The principal that manages the instance. Only valid for managed instances, where <code>managed</code> is <code>true</code>.</p></li>
270 /// <li>
271 /// <p><code>system-status.reachability</code> - Filters on system status where the name is <code>reachability</code> (<code>passed</code> | <code>failed</code> | <code>initializing</code> | <code>insufficient-data</code>).</p></li>
272 /// <li>
273 /// <p><code>system-status.status</code> - The system status of the instance (<code>ok</code> | <code>impaired</code> | <code>initializing</code> | <code>insufficient-data</code> | <code>not-applicable</code>).</p></li>
274 /// <li>
275 /// <p><code>attached-ebs-status.status</code> - The status of the attached EBS volume for the instance (<code>ok</code> | <code>impaired</code> | <code>initializing</code> | <code>insufficient-data</code> | <code>not-applicable</code>).</p></li>
276 /// </ul>
277 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
278 self.inner = self.inner.set_filters(input);
279 self
280 }
281 /// <p>The filters.</p>
282 /// <ul>
283 /// <li>
284 /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
285 /// <li>
286 /// <p><code>event.code</code> - The code for the scheduled event (<code>instance-reboot</code> | <code>system-reboot</code> | <code>system-maintenance</code> | <code>instance-retirement</code> | <code>instance-stop</code>).</p></li>
287 /// <li>
288 /// <p><code>event.description</code> - A description of the event.</p></li>
289 /// <li>
290 /// <p><code>event.instance-event-id</code> - The ID of the event whose date and time you are modifying.</p></li>
291 /// <li>
292 /// <p><code>event.not-after</code> - The latest end time for the scheduled event (for example, <code>2014-09-15T17:15:20.000Z</code>).</p></li>
293 /// <li>
294 /// <p><code>event.not-before</code> - The earliest start time for the scheduled event (for example, <code>2014-09-15T17:15:20.000Z</code>).</p></li>
295 /// <li>
296 /// <p><code>event.not-before-deadline</code> - The deadline for starting the event (for example, <code>2014-09-15T17:15:20.000Z</code>).</p></li>
297 /// <li>
298 /// <p><code>instance-state-code</code> - The code for the instance state, as a 16-bit unsigned integer. The high byte is used for internal purposes and should be ignored. The low byte is set based on the state represented. The valid values are 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).</p></li>
299 /// <li>
300 /// <p><code>instance-state-name</code> - The state of the instance (<code>pending</code> | <code>running</code> | <code>shutting-down</code> | <code>terminated</code> | <code>stopping</code> | <code>stopped</code>).</p></li>
301 /// <li>
302 /// <p><code>instance-status.reachability</code> - Filters on instance status where the name is <code>reachability</code> (<code>passed</code> | <code>failed</code> | <code>initializing</code> | <code>insufficient-data</code>).</p></li>
303 /// <li>
304 /// <p><code>instance-status.status</code> - The status of the instance (<code>ok</code> | <code>impaired</code> | <code>initializing</code> | <code>insufficient-data</code> | <code>not-applicable</code>).</p></li>
305 /// <li>
306 /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed instance.</p></li>
307 /// <li>
308 /// <p><code>operator.principal</code> - The principal that manages the instance. Only valid for managed instances, where <code>managed</code> is <code>true</code>.</p></li>
309 /// <li>
310 /// <p><code>system-status.reachability</code> - Filters on system status where the name is <code>reachability</code> (<code>passed</code> | <code>failed</code> | <code>initializing</code> | <code>insufficient-data</code>).</p></li>
311 /// <li>
312 /// <p><code>system-status.status</code> - The system status of the instance (<code>ok</code> | <code>impaired</code> | <code>initializing</code> | <code>insufficient-data</code> | <code>not-applicable</code>).</p></li>
313 /// <li>
314 /// <p><code>attached-ebs-status.status</code> - The status of the attached EBS volume for the instance (<code>ok</code> | <code>impaired</code> | <code>initializing</code> | <code>insufficient-data</code> | <code>not-applicable</code>).</p></li>
315 /// </ul>
316 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
317 self.inner.get_filters()
318 }
319 /// <p>When <code>true</code>, includes the health status for all instances. When <code>false</code>, includes the health status for running instances only.</p>
320 /// <p>Default: <code>false</code></p>
321 pub fn include_all_instances(mut self, input: bool) -> Self {
322 self.inner = self.inner.include_all_instances(input);
323 self
324 }
325 /// <p>When <code>true</code>, includes the health status for all instances. When <code>false</code>, includes the health status for running instances only.</p>
326 /// <p>Default: <code>false</code></p>
327 pub fn set_include_all_instances(mut self, input: ::std::option::Option<bool>) -> Self {
328 self.inner = self.inner.set_include_all_instances(input);
329 self
330 }
331 /// <p>When <code>true</code>, includes the health status for all instances. When <code>false</code>, includes the health status for running instances only.</p>
332 /// <p>Default: <code>false</code></p>
333 pub fn get_include_all_instances(&self) -> &::std::option::Option<bool> {
334 self.inner.get_include_all_instances()
335 }
336}