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
use serde::Deserialize;

#[derive(Deserialize, Debug)]
pub struct LinodeInstanceListRoot {
    pub data: Vec<LinodeInstance>,
    pub page: u32,
    pub pages: u32,
    pub results: u32,
}

#[derive(Deserialize, Debug)]
pub struct LinodeInstance {
    pub alerts: LinodeInstanceAlerts,
    pub backups: LinodeInstanceBackups,
    pub created: String,
    pub group: String,
    pub has_user_data: bool,
    pub host_uuid: String,
    pub hypervisor: String,
    pub id: u64,
    pub image: String,
    pub ipv4: Vec<String>,
    pub ipv6: String,
    pub label: String,
    pub region: String,
    pub specs: LinodeInstanceSpecs,
    pub status: String,
    pub tags: Vec<String>,
    #[serde(rename = "type")]
    pub ttype: String,
    pub updated: String,
    pub watchdog_enabled: bool,
}

#[derive(Deserialize, Debug)]
pub struct LinodeInstanceSpecs {
    pub disk: u64,
    pub gpus: u64,
    pub memory: u64,
    pub transfer: u64,
    pub vcpus: u64,
}

#[derive(Deserialize, Debug)]
pub struct LinodeInstanceAlerts {
    pub cpu: u64,
    pub io: u64,
    pub network_in: u64,
    pub network_out: u64,
    pub transfer_quota: u64,
}

#[derive(Deserialize, Debug)]
pub struct LinodeInstanceBackups {
    pub available: bool,
    pub enabled: bool,
    pub last_successful: String,
    pub schedule: LinodeInstanceBackupSchedule,
}

#[derive(Deserialize, Debug)]
pub struct LinodeInstanceBackupSchedule {
    pub day: String,
    pub window: String,
}