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>
35/// <p>The Amazon EC2 API follows an eventual consistency model. This means that the result of an API command you run that creates or modifies resources might not be immediately available to all subsequent commands you run. For guidance on how to manage eventual consistency, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/eventual-consistency.html">Eventual consistency in the Amazon EC2 API</a> in the <i>Amazon EC2 Developer Guide</i>.</p><note>
36/// <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>
37/// </note>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct DescribeInstanceStatusFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::describe_instance_status::builders::DescribeInstanceStatusInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
47        crate::operation::describe_instance_status::DescribeInstanceStatusError,
48    > for DescribeInstanceStatusFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
56            crate::operation::describe_instance_status::DescribeInstanceStatusError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl DescribeInstanceStatusFluentBuilder {
63    /// Creates a new `DescribeInstanceStatusFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the DescribeInstanceStatus as a reference.
72    pub fn as_input(&self) -> &crate::operation::describe_instance_status::builders::DescribeInstanceStatusInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::describe_instance_status::DescribeInstanceStatusError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::describe_instance_status::DescribeInstanceStatus::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::describe_instance_status::DescribeInstanceStatus::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
109        crate::operation::describe_instance_status::DescribeInstanceStatusError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// Create a paginator for this request
124    ///
125    /// 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).
126    pub fn into_paginator(self) -> crate::operation::describe_instance_status::paginator::DescribeInstanceStatusPaginator {
127        crate::operation::describe_instance_status::paginator::DescribeInstanceStatusPaginator::new(self.handle, self.inner)
128    }
129    ///
130    /// Appends an item to `InstanceIds`.
131    ///
132    /// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
133    ///
134    /// <p>The instance IDs.</p>
135    /// <p>Default: Describes all your instances.</p>
136    /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
137    pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.instance_ids(input.into());
139        self
140    }
141    /// <p>The instance IDs.</p>
142    /// <p>Default: Describes all your instances.</p>
143    /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
144    pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
145        self.inner = self.inner.set_instance_ids(input);
146        self
147    }
148    /// <p>The instance IDs.</p>
149    /// <p>Default: Describes all your instances.</p>
150    /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
151    pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
152        self.inner.get_instance_ids()
153    }
154    /// <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>
155    /// <p>You cannot specify this parameter and the instance IDs parameter in the same request.</p>
156    pub fn max_results(mut self, input: i32) -> Self {
157        self.inner = self.inner.max_results(input);
158        self
159    }
160    /// <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>
161    /// <p>You cannot specify this parameter and the instance IDs parameter in the same request.</p>
162    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
163        self.inner = self.inner.set_max_results(input);
164        self
165    }
166    /// <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>
167    /// <p>You cannot specify this parameter and the instance IDs parameter in the same request.</p>
168    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
169        self.inner.get_max_results()
170    }
171    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
172    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.inner = self.inner.next_token(input.into());
174        self
175    }
176    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
177    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.inner = self.inner.set_next_token(input);
179        self
180    }
181    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
182    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
183        self.inner.get_next_token()
184    }
185    /// <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>
186    pub fn dry_run(mut self, input: bool) -> Self {
187        self.inner = self.inner.dry_run(input);
188        self
189    }
190    /// <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>
191    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
192        self.inner = self.inner.set_dry_run(input);
193        self
194    }
195    /// <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>
196    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
197        self.inner.get_dry_run()
198    }
199    ///
200    /// Appends an item to `Filters`.
201    ///
202    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
203    ///
204    /// <p>The filters.</p>
205    /// <ul>
206    /// <li>
207    /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
208    /// <li>
209    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone of the instance.</p></li>
210    /// <li>
211    /// <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>
212    /// <li>
213    /// <p><code>event.description</code> - A description of the event.</p></li>
214    /// <li>
215    /// <p><code>event.instance-event-id</code> - The ID of the event whose date and time you are modifying.</p></li>
216    /// <li>
217    /// <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>
218    /// <li>
219    /// <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>
220    /// <li>
221    /// <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>
222    /// <li>
223    /// <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>
224    /// <li>
225    /// <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>
226    /// <li>
227    /// <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>
228    /// <li>
229    /// <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>
230    /// <li>
231    /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed instance.</p></li>
232    /// <li>
233    /// <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>
234    /// <li>
235    /// <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>
236    /// <li>
237    /// <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>
238    /// <li>
239    /// <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>
240    /// </ul>
241    pub fn filters(mut self, input: crate::types::Filter) -> Self {
242        self.inner = self.inner.filters(input);
243        self
244    }
245    /// <p>The filters.</p>
246    /// <ul>
247    /// <li>
248    /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
249    /// <li>
250    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone of the instance.</p></li>
251    /// <li>
252    /// <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>
253    /// <li>
254    /// <p><code>event.description</code> - A description of the event.</p></li>
255    /// <li>
256    /// <p><code>event.instance-event-id</code> - The ID of the event whose date and time you are modifying.</p></li>
257    /// <li>
258    /// <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>
259    /// <li>
260    /// <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>
261    /// <li>
262    /// <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>
263    /// <li>
264    /// <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>
265    /// <li>
266    /// <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>
267    /// <li>
268    /// <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>
269    /// <li>
270    /// <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>
271    /// <li>
272    /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed instance.</p></li>
273    /// <li>
274    /// <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>
275    /// <li>
276    /// <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>
277    /// <li>
278    /// <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>
279    /// <li>
280    /// <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>
281    /// </ul>
282    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
283        self.inner = self.inner.set_filters(input);
284        self
285    }
286    /// <p>The filters.</p>
287    /// <ul>
288    /// <li>
289    /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
290    /// <li>
291    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone of the instance.</p></li>
292    /// <li>
293    /// <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>
294    /// <li>
295    /// <p><code>event.description</code> - A description of the event.</p></li>
296    /// <li>
297    /// <p><code>event.instance-event-id</code> - The ID of the event whose date and time you are modifying.</p></li>
298    /// <li>
299    /// <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>
300    /// <li>
301    /// <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>
302    /// <li>
303    /// <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>
304    /// <li>
305    /// <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>
306    /// <li>
307    /// <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>
308    /// <li>
309    /// <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>
310    /// <li>
311    /// <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>
312    /// <li>
313    /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed instance.</p></li>
314    /// <li>
315    /// <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>
316    /// <li>
317    /// <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>
318    /// <li>
319    /// <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>
320    /// <li>
321    /// <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>
322    /// </ul>
323    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
324        self.inner.get_filters()
325    }
326    /// <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>
327    /// <p>Default: <code>false</code></p>
328    pub fn include_all_instances(mut self, input: bool) -> Self {
329        self.inner = self.inner.include_all_instances(input);
330        self
331    }
332    /// <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>
333    /// <p>Default: <code>false</code></p>
334    pub fn set_include_all_instances(mut self, input: ::std::option::Option<bool>) -> Self {
335        self.inner = self.inner.set_include_all_instances(input);
336        self
337    }
338    /// <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>
339    /// <p>Default: <code>false</code></p>
340    pub fn get_include_all_instances(&self) -> &::std::option::Option<bool> {
341        self.inner.get_include_all_instances()
342    }
343}