modify_volume_attribute
¶
modify_volume_attribute(
*,
config_overrides: Optional[EC2ClientConfig] = None,
auto_enable_io: Optional[AttributeBooleanValue] = None,
volume_id: Optional[VolumeId] = None,
dry_run: Optional[Boolean] = None,
) -> None
Modifies a volume attribute.
By default, all I/O operations for the volume are suspended when the data on the volume is determined to be potentially inconsistent, to prevent undetectable, latent data corruption. The I/O access to the volume can be resumed by first enabling I/O access and then checking the data consistency on your volume.
You can change the default behavior to resume I/O operations. We recommend that you change this only for boot volumes or for volumes that are stateless or disposable.
Parameters:
-
auto_enable_io(Optional[AttributeBooleanValue], default:None) –Indicates whether the volume should be auto-enabled for I/O operations.
-
volume_id(Optional[VolumeId], default:None) –The ID of the volume.
-
dry_run(Optional[Boolean], default:None) –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
DryRunOperation. Otherwise, it isUnauthorizedOperation.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To modify a volume attribute
This example sets the autoEnableIo attribute of the volume with the ID vol-1234567890abcdef0 to true. If the command succeeds, no output is returned.
>>> client.modify_volume_attribute(dry_run=True, volume_id='vol-1234567890abcdef0', auto_enable_io={'Value': True})
Source code in docs_src/capo_ec2/_services/ec2.py
53859 53860 53861 53862 53863 53864 53865 53866 53867 53868 53869 53870 53871 53872 53873 53874 53875 53876 53877 53878 53879 53880 53881 53882 53883 53884 53885 53886 53887 53888 53889 53890 53891 53892 53893 53894 53895 53896 53897 53898 53899 53900 53901 53902 53903 53904 53905 53906 53907 53908 53909 53910 53911 53912 53913 53914 53915 | |