Initiates a snapshot of a gateway from a volume recovery point. This operation is only supported in the cached volume gateway type.
A volume recovery point is a point in time at which all data of the volume is consistent and from which you can create a snapshot. To get a list of volume recovery point for cached volume gateway, use ListVolumeRecoveryPoints.
In the CreateSnapshotFromVolumeRecoveryPoint request, you identify the volume by providing its Amazon Resource Name (ARN). You must also provide a description for the snapshot. When the gateway takes a snapshot of the specified volume, the snapshot and its description appear in the Storage Gateway console. In response, the gateway returns you a snapshot ID. You can use this snapshot ID to check the snapshot progress or later use it when you want to create a volume from a snapshot.
To list or delete a snapshot, you must use the Amazon EC2 API. For more information, see DescribeSnapshots or DeleteSnapshot in the Amazon Elastic Compute Cloud API Reference.
Parameters:
-
volume_arn
(VolumeARN)
–
The Amazon Resource Name (ARN) of the iSCSI volume target. Use the DescribeStorediSCSIVolumes operation to return to retrieve the TargetARN for specified VolumeARN.
-
snapshot_description
(SnapshotDescription)
–
Textual description of the snapshot that appears in the Amazon EC2 console, Elastic Block Store snapshots panel in the Description field, and in the Storage Gateway snapshot Details pane, Description field.
-
tags
(Optional[Tags], default:
None
)
–
A list of up to 50 tags that can be assigned to a snapshot. Each tag is a key-value pair.
Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.
Raises:
-
InternalServerError
–
An internal server error has occurred during the request. For more information, see the error and message fields.
-
InvalidGatewayRequestException
–
An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.
-
ServiceUnavailableError
–
An internal server error has occurred because the service is unavailable. For more information, see the error and message fields.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To create a snapshot of a gateway volume
Initiates a snapshot of a gateway from a volume recovery point.
>>> client.create_snapshot_from_volume_recovery_point(volume_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABB', snapshot_description='My root volume snapshot as of 2017-06-30T10:10:10.000Z')
Source code in docs_src/capo_storage_gateway/_services/storage_gateway.py
| def create_snapshot_from_volume_recovery_point(
self,
volume_arn: "capo_storage_gateway.types.volume_arn.VolumeARN",
snapshot_description: "capo_storage_gateway.types.snapshot_description.SnapshotDescription",
*,
config_overrides: Optional[StorageGatewayClientConfig] = None,
tags: Optional["capo_storage_gateway.types.tags.Tags"] = None,
) -> "capo_storage_gateway.types.create_snapshot_from_volume_recovery_point_output.CreateSnapshotFromVolumeRecoveryPointOutput":
"""<p>Initiates a snapshot of a gateway from a volume recovery point. This operation is only supported in the cached volume gateway type.</p> <p>A volume recovery point is a point in time at which all data of the volume is consistent and from which you can create a snapshot. To get a list of volume recovery point for cached volume gateway, use <a>ListVolumeRecoveryPoints</a>.</p> <p>In the <code>CreateSnapshotFromVolumeRecoveryPoint</code> request, you identify the volume by providing its Amazon Resource Name (ARN). You must also provide a description for the snapshot. When the gateway takes a snapshot of the specified volume, the snapshot and its description appear in the Storage Gateway console. In response, the gateway returns you a snapshot ID. You can use this snapshot ID to check the snapshot progress or later use it when you want to create a volume from a snapshot.</p> <note> <p>To list or delete a snapshot, you must use the Amazon EC2 API. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSnapshots.html">DescribeSnapshots</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteSnapshot.html">DeleteSnapshot</a> in the <i>Amazon Elastic Compute Cloud API Reference</i>.</p> </note>
Args:
volume_arn: <p>The Amazon Resource Name (ARN) of the iSCSI volume target. Use the <a>DescribeStorediSCSIVolumes</a> operation to return to retrieve the TargetARN for specified VolumeARN.</p>
snapshot_description: <p>Textual description of the snapshot that appears in the Amazon EC2 console, Elastic Block Store snapshots panel in the <b>Description</b> field, and in the Storage Gateway snapshot <b>Details</b> pane, <b>Description</b> field.</p>
tags: <p>A list of up to 50 tags that can be assigned to a snapshot. Each tag is a key-value pair.</p> <note> <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</p> </note>
Raises:
capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
capo_storage_gateway.errors.service_unavailable_error.ServiceUnavailableError: <p>An internal server error has occurred because the service is unavailable. For more information, see the error and message fields.</p>
capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To create a snapshot of a gateway volume
Initiates a snapshot of a gateway from a volume recovery point.
>>> client.create_snapshot_from_volume_recovery_point(volume_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABB', snapshot_description='My root volume snapshot as of 2017-06-30T10:10:10.000Z')
"""
def _handler(
req: "OperationRequest[capo_storage_gateway.types.create_snapshot_from_volume_recovery_point_input.CreateSnapshotFromVolumeRecoveryPointInput]",
) -> OperationResponse[
"capo_storage_gateway.types.create_snapshot_from_volume_recovery_point_output.CreateSnapshotFromVolumeRecoveryPointOutput"
]:
import capo_storage_gateway._operations.storage_gateway_20130630.create_snapshot_from_volume_recovery_point
output, http_response = (
capo_storage_gateway._operations.storage_gateway_20130630.create_snapshot_from_volume_recovery_point.create_snapshot_from_volume_recovery_point(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateSnapshotFromVolumeRecoveryPoint")
)
input_: capo_storage_gateway.types.create_snapshot_from_volume_recovery_point_input.CreateSnapshotFromVolumeRecoveryPointInput = {
"volume_arn": volume_arn,
"snapshot_description": snapshot_description,
}
if tags is not None:
input_["tags"] = tags
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|