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