aws_sdk_ec2/client/detach_volume.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 [`DetachVolume`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder) operation.
4 ///
5 /// - The fluent builder is configurable:
6 /// - [`device(impl Into<String>)`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::device) / [`set_device(Option<String>)`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::set_device):<br>required: **false**<br><p>The device name.</p><br>
7 /// - [`force(bool)`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::force) / [`set_force(Option<bool>)`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::set_force):<br>required: **false**<br><p>Forces detachment if the previous detachment attempt did not occur cleanly (for example, logging into an instance, unmounting the volume, and detaching normally). This option can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance. The instance won't have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures.</p><br>
8 /// - [`instance_id(impl Into<String>)`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::instance_id) / [`set_instance_id(Option<String>)`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::set_instance_id):<br>required: **false**<br><p>The ID of the instance. If you are detaching a Multi-Attach enabled volume, you must specify an instance ID.</p><br>
9 /// - [`volume_id(impl Into<String>)`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::volume_id) / [`set_volume_id(Option<String>)`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::set_volume_id):<br>required: **true**<br><p>The ID of the volume.</p><br>
10 /// - [`dry_run(bool)`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::dry_run) / [`set_dry_run(Option<bool>)`](crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::set_dry_run):<br>required: **false**<br><p>Checks whether you have the required permissions for the action, 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>
11 /// - On success, responds with [`DetachVolumeOutput`](crate::operation::detach_volume::DetachVolumeOutput) with field(s):
12 /// - [`delete_on_termination(Option<bool>)`](crate::operation::detach_volume::DetachVolumeOutput::delete_on_termination): <p>Indicates whether the EBS volume is deleted on instance termination.</p>
13 /// - [`associated_resource(Option<String>)`](crate::operation::detach_volume::DetachVolumeOutput::associated_resource): <p>The ARN of the Amazon Web Services-managed resource to which the volume is attached.</p>
14 /// - [`instance_owning_service(Option<String>)`](crate::operation::detach_volume::DetachVolumeOutput::instance_owning_service): <p>The service principal of the Amazon Web Services service that owns the underlying resource to which the volume is attached.</p> <p>This parameter is returned only for volumes that are attached to Amazon Web Services-managed resources.</p>
15 /// - [`volume_id(Option<String>)`](crate::operation::detach_volume::DetachVolumeOutput::volume_id): <p>The ID of the volume.</p>
16 /// - [`instance_id(Option<String>)`](crate::operation::detach_volume::DetachVolumeOutput::instance_id): <p>The ID of the instance.</p> <p>If the volume is attached to an Amazon Web Services-managed resource, this parameter returns <code>null</code>.</p>
17 /// - [`device(Option<String>)`](crate::operation::detach_volume::DetachVolumeOutput::device): <p>The device name.</p> <p>If the volume is attached to an Amazon Web Services-managed resource, this parameter returns <code>null</code>.</p>
18 /// - [`state(Option<VolumeAttachmentState>)`](crate::operation::detach_volume::DetachVolumeOutput::state): <p>The attachment state of the volume.</p>
19 /// - [`attach_time(Option<DateTime>)`](crate::operation::detach_volume::DetachVolumeOutput::attach_time): <p>The time stamp when the attachment initiated.</p>
20 /// - On failure, responds with [`SdkError<DetachVolumeError>`](crate::operation::detach_volume::DetachVolumeError)
21 pub fn detach_volume(&self) -> crate::operation::detach_volume::builders::DetachVolumeFluentBuilder {
22 crate::operation::detach_volume::builders::DetachVolumeFluentBuilder::new(self.handle.clone())
23 }
24}