1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*!
A library that uses the Amazon EBS direct APIs to work with snapshots.
# Examples
Downloading a snapshot into a disk image:
```
use coldsnap::SnapshotDownloader;
use aws_sdk_ebs::Client as EbsClient;
use std::path::Path;
# async fn doc() {
let client = EbsClient::new(&aws_config::from_env().region("us-west-2").load().await);
let downloader = SnapshotDownloader::new(client);
let path = Path::new("./disk.img");
downloader.download_to_file("snap-1234", &path, None, None, None)
.await
.expect("failed to download snapshot");
# }
```
Uploading a disk image into a snapshot:
```
use coldsnap::SnapshotUploader;
use aws_sdk_ebs::Client as EbsClient;
use std::path::Path;
# async fn doc() {
let client = EbsClient::new(&aws_config::from_env().region("us-west-2").load().await);
let uploader = SnapshotUploader::new(client);
let path = Path::new("./disk.img");
let snapshot_id = uploader.upload_from_file(&path, None, None, None, None, None, None, None)
.await
.expect("failed to upload snapshot");
# }
```
Waiting for a snapshot to be completed:
```
use coldsnap::SnapshotWaiter;
use aws_sdk_ec2::Client as Ec2Client;
# async fn doc() {
let client = Ec2Client::new(&aws_config::from_env().region("us-west-2").load().await);
let waiter = SnapshotWaiter::new(client);
waiter.wait_for_completed("snap-1234")
.await
.expect("failed to wait for snapshot");
# }
```
*/
pub use CheckpointBehavior;
pub use Error as DownloadError;
pub use SnapshotDownloader;
pub use Error as UploadError;
pub use SnapshotUploader;
pub use ZeroBlocks as UploadZeroBlocks;
pub use Error as WaitError;
pub use ;
/// Errors from the AWS Rust SDK crate often swallow relevant information when they are printed
/// using `Display`. This leads to errors that do not have enough information for the user to know
/// what went wrong. This function `Display` prints an error and recursively adds up to n levels of
/// underlying errors to that printed message.
pub