squarecloud 0.1.1

Async Rust client for the SquareCloud API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use squarecloud::ApiClient;

#[tokio::main]
async fn main() {
    let client = ApiClient::new();
    let db_id = std::env::args()
        .nth(1)
        .expect("usage: cargo run --example NAME -- <db_id>");
    let db = client.database(&db_id);
    let snapshots = db.list_snapshots().await.unwrap();
    let snapshot = snapshots.first().unwrap();
    db.restore_snapshot(
        snapshot.name.clone(),
        snapshot.version_id().to_string(),
    )
    .await
    .unwrap();
}