aws_sdk_ec2/client/
stop_instances.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`StopInstances`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`instance_ids(impl Into<String>)`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder::instance_ids) / [`set_instance_ids(Option<Vec::<String>>)`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder::set_instance_ids):<br>required: **true**<br><p>The IDs of the instances.</p><br>
7    ///   - [`hibernate(bool)`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder::hibernate) / [`set_hibernate(Option<bool>)`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder::set_hibernate):<br>required: **false**<br><p>Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p> <p>Default: <code>false</code></p><br>
8    ///   - [`skip_os_shutdown(bool)`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder::skip_os_shutdown) / [`set_skip_os_shutdown(Option<bool>)`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder::set_skip_os_shutdown):<br>required: **false**<br><p>Specifies whether to bypass the graceful OS shutdown process when the instance is stopped.</p><important>  <p>Bypassing the graceful OS shutdown might result in data loss or corruption (for example, memory contents not flushed to disk or loss of in-flight IOs) or skipped shutdown scripts.</p> </important> <p>Default: <code>false</code></p><br>
9    ///   - [`dry_run(bool)`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder::dry_run) / [`set_dry_run(Option<bool>)`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder::set_dry_run):<br>required: **false**<br><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><br>
10    ///   - [`force(bool)`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder::force) / [`set_force(Option<bool>)`](crate::operation::stop_instances::builders::StopInstancesFluentBuilder::set_force):<br>required: **false**<br><p>Forces the instance to stop. The instance will first attempt a graceful shutdown, which includes flushing file system caches and metadata. If the graceful shutdown fails to complete within the timeout period, the instance shuts down forcibly without flushing the file system caches and metadata.</p> <p>After using this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html">Troubleshoot Amazon EC2 instance stop issues</a> in the <i>Amazon EC2 User Guide</i>.</p> <p>Default: <code>false</code></p><br>
11    /// - On success, responds with [`StopInstancesOutput`](crate::operation::stop_instances::StopInstancesOutput) with field(s):
12    ///   - [`stopping_instances(Option<Vec::<InstanceStateChange>>)`](crate::operation::stop_instances::StopInstancesOutput::stopping_instances): <p>Information about the stopped instances.</p>
13    /// - On failure, responds with [`SdkError<StopInstancesError>`](crate::operation::stop_instances::StopInstancesError)
14    pub fn stop_instances(&self) -> crate::operation::stop_instances::builders::StopInstancesFluentBuilder {
15        crate::operation::stop_instances::builders::StopInstancesFluentBuilder::new(self.handle.clone())
16    }
17}