Skip to content

enable_fast_snapshot_restores

enable_fast_snapshot_restores(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    availability_zones: Optional[AvailabilityZoneStringList] = None,
    availability_zone_ids: Optional[AvailabilityZoneIdStringList] = None,
    source_snapshot_ids: Optional[SnapshotIdStringList] = None,
    dry_run: Optional[Boolean] = None,
) -> EnableFastSnapshotRestoresResult

Enables fast snapshot restores for the specified snapshots in the specified Availability Zones.

You get the full benefit of fast snapshot restores after they enter the enabled state.

For more information, see Amazon EBS fast snapshot restore in the Amazon EBS User Guide.

Parameters:

  • availability_zones (Optional[AvailabilityZoneStringList], default: None ) –

    One or more Availability Zones. For example, us-east-2a.

    Either AvailabilityZone or AvailabilityZoneId must be specified in the request, but not both.

  • availability_zone_ids (Optional[AvailabilityZoneIdStringList], default: None ) –

    One or more Availability Zone IDs. For example, use2-az1.

    Either AvailabilityZone or AvailabilityZoneId must be specified in the request, but not both.

  • source_snapshot_ids (Optional[SnapshotIdStringList], default: None ) –

    The IDs of one or more snapshots. For example, snap-1234567890abcdef0. You can specify a snapshot that was shared with you from another Amazon Web Services account.

  • 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 is UnauthorizedOperation.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def enable_fast_snapshot_restores(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    availability_zones: Optional[
        "capo_ec2.types.availability_zone_string_list.AvailabilityZoneStringList"
    ] = None,
    availability_zone_ids: Optional[
        "capo_ec2.types.availability_zone_id_string_list.AvailabilityZoneIdStringList"
    ] = None,
    source_snapshot_ids: Optional[
        "capo_ec2.types.snapshot_id_string_list.SnapshotIdStringList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.enable_fast_snapshot_restores_result.EnableFastSnapshotRestoresResult":
    """<p>Enables fast snapshot restores for the specified snapshots in the specified Availability Zones.</p> <p>You get the full benefit of fast snapshot restores after they enter the <code>enabled</code> state.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-fast-snapshot-restore.html">Amazon EBS fast snapshot restore</a> in the <i>Amazon EBS User Guide</i>.</p>

    Args:
        availability_zones: <p>One or more Availability Zones. For example, <code>us-east-2a</code>.</p> <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified in the request, but not both.</p>
        availability_zone_ids: <p>One or more Availability Zone IDs. For example, <code>use2-az1</code>.</p> <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified in the request, but not both.</p>
        source_snapshot_ids: <p>The IDs of one or more snapshots. For example, <code>snap-1234567890abcdef0</code>. You can specify a snapshot that was shared with you from another Amazon Web Services account.</p>
        dry_run: <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>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.enable_fast_snapshot_restores_request.EnableFastSnapshotRestoresRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.enable_fast_snapshot_restores_result.EnableFastSnapshotRestoresResult"
    ]:
        import capo_ec2._operations.amazon_ec2.enable_fast_snapshot_restores

        output, http_response = (
            capo_ec2._operations.amazon_ec2.enable_fast_snapshot_restores.enable_fast_snapshot_restores(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("EnableFastSnapshotRestores")
    )
    input_: capo_ec2.types.enable_fast_snapshot_restores_request.EnableFastSnapshotRestoresRequest = {}
    if availability_zones is not None:
        input_["availability_zones"] = availability_zones
    if availability_zone_ids is not None:
        input_["availability_zone_ids"] = availability_zone_ids
    if source_snapshot_ids is not None:
        input_["source_snapshot_ids"] = source_snapshot_ids
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output