aws_sdk_ec2/waiters/
system_status_ok.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `system_status_ok` waiter.
5///
6/// This builder is intended to be used similar to the other fluent builders for
7/// normal operations on the client. However, instead of a `send` method, it has
8/// a `wait` method that takes a maximum amount of time to wait.
9///
10/// Construct this fluent builder using the client by importing the
11/// [`Waiters`](crate::client::Waiters) trait and calling the methods
12/// prefixed with `wait_until`.
13///
14#[derive(::std::clone::Clone, ::std::fmt::Debug)]
15pub struct SystemStatusOkFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_instance_status::builders::DescribeInstanceStatusInputBuilder,
18}
19impl SystemStatusOkFluentBuilder {
20    /// Creates a new `SystemStatusOkFluentBuilder`.
21    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
22        Self {
23            handle,
24            inner: ::std::default::Default::default(),
25        }
26    }
27    /// Access the DescribeInstanceStatus as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_instance_status::builders::DescribeInstanceStatusInputBuilder {
29        &self.inner
30    }
31    /// Wait for `system_status_ok`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::system_status_ok::SystemStatusOkFinalPoll,
37        crate::waiters::system_status_ok::WaitUntilSystemStatusOkError,
38    > {
39        let input = self
40            .inner
41            .build()
42            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
43        let runtime_plugins = crate::operation::describe_instance_status::DescribeInstanceStatus::operation_runtime_plugins(
44            self.handle.runtime_plugins.clone(),
45            &self.handle.conf,
46            ::std::option::Option::None,
47        )
48        .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
49        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
50        let runtime_components_builder = runtime_plugins
51            .apply_client_configuration(&mut cfg)
52            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
53        let time_components = runtime_components_builder.into_time_components();
54        let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
55        let time_source = time_components.time_source().expect("a time source is required by waiters");
56
57        let acceptor = move |result: ::std::result::Result<
58            &crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
59            &crate::operation::describe_instance_status::DescribeInstanceStatusError,
60        >| {
61            // Matches: {"output":{"path":"InstanceStatuses[].SystemStatus.Status","expected":"ok","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_instance_status_46ce6aca57818c04b(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
66        };
67        let operation = move || {
68            let input = input.clone();
69            let runtime_plugins = runtime_plugins.clone();
70            async move { crate::operation::describe_instance_status::DescribeInstanceStatus::orchestrate(&runtime_plugins, input).await }
71        };
72        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
73            .min_delay(::std::time::Duration::from_secs(15))
74            .max_delay(::std::time::Duration::from_secs(120))
75            .max_wait(max_wait)
76            .time_source(time_source)
77            .sleep_impl(sleep_impl)
78            .acceptor(acceptor)
79            .operation(operation)
80            .build();
81        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
82    }
83    ///
84    /// Appends an item to `InstanceIds`.
85    ///
86    /// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
87    ///
88    /// <p>The instance IDs.</p>
89    /// <p>Default: Describes all your instances.</p>
90    /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
91    pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.inner = self.inner.instance_ids(input.into());
93        self
94    }
95    /// <p>The instance IDs.</p>
96    /// <p>Default: Describes all your instances.</p>
97    /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
98    pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
99        self.inner = self.inner.set_instance_ids(input);
100        self
101    }
102    /// <p>The instance IDs.</p>
103    /// <p>Default: Describes all your instances.</p>
104    /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
105    pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
106        self.inner.get_instance_ids()
107    }
108    /// <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>
109    /// <p>You cannot specify this parameter and the instance IDs parameter in the same request.</p>
110    pub fn max_results(mut self, input: i32) -> Self {
111        self.inner = self.inner.max_results(input);
112        self
113    }
114    /// <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>
115    /// <p>You cannot specify this parameter and the instance IDs parameter in the same request.</p>
116    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
117        self.inner = self.inner.set_max_results(input);
118        self
119    }
120    /// <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>
121    /// <p>You cannot specify this parameter and the instance IDs parameter in the same request.</p>
122    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
123        self.inner.get_max_results()
124    }
125    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
126    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.next_token(input.into());
128        self
129    }
130    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
131    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_next_token(input);
133        self
134    }
135    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
136    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_next_token()
138    }
139    /// <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>
140    pub fn dry_run(mut self, input: bool) -> Self {
141        self.inner = self.inner.dry_run(input);
142        self
143    }
144    /// <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>
145    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
146        self.inner = self.inner.set_dry_run(input);
147        self
148    }
149    /// <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>
150    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
151        self.inner.get_dry_run()
152    }
153    ///
154    /// Appends an item to `Filters`.
155    ///
156    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
157    ///
158    /// <p>The filters.</p>
159    /// <ul>
160    /// <li>
161    /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
162    /// <li>
163    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone of the instance.</p></li>
164    /// <li>
165    /// <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>
166    /// <li>
167    /// <p><code>event.description</code> - A description of the event.</p></li>
168    /// <li>
169    /// <p><code>event.instance-event-id</code> - The ID of the event whose date and time you are modifying.</p></li>
170    /// <li>
171    /// <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>
172    /// <li>
173    /// <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>
174    /// <li>
175    /// <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>
176    /// <li>
177    /// <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>
178    /// <li>
179    /// <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>
180    /// <li>
181    /// <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>
182    /// <li>
183    /// <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>
184    /// <li>
185    /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed instance.</p></li>
186    /// <li>
187    /// <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>
188    /// <li>
189    /// <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>
190    /// <li>
191    /// <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>
192    /// <li>
193    /// <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>
194    /// </ul>
195    pub fn filters(mut self, input: crate::types::Filter) -> Self {
196        self.inner = self.inner.filters(input);
197        self
198    }
199    /// <p>The filters.</p>
200    /// <ul>
201    /// <li>
202    /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
203    /// <li>
204    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone of the instance.</p></li>
205    /// <li>
206    /// <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>
207    /// <li>
208    /// <p><code>event.description</code> - A description of the event.</p></li>
209    /// <li>
210    /// <p><code>event.instance-event-id</code> - The ID of the event whose date and time you are modifying.</p></li>
211    /// <li>
212    /// <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>
213    /// <li>
214    /// <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>
215    /// <li>
216    /// <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>
217    /// <li>
218    /// <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>
219    /// <li>
220    /// <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>
221    /// <li>
222    /// <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>
223    /// <li>
224    /// <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>
225    /// <li>
226    /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed instance.</p></li>
227    /// <li>
228    /// <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>
229    /// <li>
230    /// <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>
231    /// <li>
232    /// <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>
233    /// <li>
234    /// <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>
235    /// </ul>
236    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
237        self.inner = self.inner.set_filters(input);
238        self
239    }
240    /// <p>The filters.</p>
241    /// <ul>
242    /// <li>
243    /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
244    /// <li>
245    /// <p><code>availability-zone-id</code> - The ID of 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 get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
278        self.inner.get_filters()
279    }
280    /// <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>
281    /// <p>Default: <code>false</code></p>
282    pub fn include_all_instances(mut self, input: bool) -> Self {
283        self.inner = self.inner.include_all_instances(input);
284        self
285    }
286    /// <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>
287    /// <p>Default: <code>false</code></p>
288    pub fn set_include_all_instances(mut self, input: ::std::option::Option<bool>) -> Self {
289        self.inner = self.inner.set_include_all_instances(input);
290        self
291    }
292    /// <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>
293    /// <p>Default: <code>false</code></p>
294    pub fn get_include_all_instances(&self) -> &::std::option::Option<bool> {
295        self.inner.get_include_all_instances()
296    }
297}
298
299/// Successful return type for the `system_status_ok` waiter.
300pub type SystemStatusOkFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
301    crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
302    ::aws_smithy_runtime_api::client::result::SdkError<
303        crate::operation::describe_instance_status::DescribeInstanceStatusError,
304        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
305    >,
306>;
307
308/// Error type for the `system_status_ok` waiter.
309pub type WaitUntilSystemStatusOkError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
310    crate::operation::describe_instance_status::DescribeInstanceStatusOutput,
311    crate::operation::describe_instance_status::DescribeInstanceStatusError,
312>;