scaleway_rs/data/
instance.rs

1use serde::Deserialize;
2
3use super::image::{ScalewayImage, ScalewayImageBootscript, ScalewayImageExtraVolumes};
4
5#[derive(Deserialize, Debug)]
6pub struct ScalewayInstancesRoot {
7    pub servers: Vec<ScalewayInstance>,
8}
9
10#[derive(Deserialize, Debug)]
11pub struct ScalewayInstanceRoot {
12    pub server: ScalewayInstance,
13}
14
15#[derive(Deserialize, Debug)]
16pub struct ScalewayInstance {
17    pub id: String,
18    pub name: String,
19    pub organization: String,
20    pub project: String,
21    pub allowed_actions: Vec<String>,
22    pub tags: Vec<String>,
23    pub commercial_type: String,
24    pub creation_date: Option<String>,
25    pub dynamic_ip_required: bool,
26    pub routed_ip_enabled: bool,
27    pub enable_ipv6: bool,
28    pub hostname: String,
29    pub image: ScalewayImage,
30    pub protected: bool,
31    pub private_ip: Option<String>,
32    pub public_ip: Option<ScalewayPublicIP>,
33    pub public_ips: Vec<ScalewayPublicIP>,
34    pub mac_address: String,
35    pub modification_date: Option<String>,
36    pub state: String,
37    pub location: Option<ScalewayInstanceLocation>,
38    pub ipv6: Option<ScalewayIpv6>,
39    pub bootscript: ScalewayImageBootscript,
40    pub boot_type: String,
41    pub volumes: ScalewayImageExtraVolumes,
42    pub security_group: ScalewaySecurityGroup,
43    pub maintenances: Vec<ScalewayMaintenance>,
44    pub state_detail: String,
45    pub arch: String,
46    pub placement_group: Option<ScalewayPlacementGroup>,
47    pub private_nics: Vec<ScalewayPrivateNic>,
48    pub zone: String,
49}
50
51#[derive(Deserialize, Debug)]
52pub struct ScalewayPublicIP {
53    pub id: String,
54    pub address: String,
55    pub gateway: Option<String>,
56    pub netmask: String,
57    pub family: String,
58    pub dynamic: bool,
59    pub provisioning_mode: String,
60    pub tags: Vec<String>,
61    pub state: String,
62}
63
64#[derive(Deserialize, Debug)]
65pub struct ScalewayInstanceLocation {
66    pub cluster_id: String,
67    pub hypervisor_id: String,
68    pub node_id: String,
69    pub platform_id: String,
70    pub zone_id: String,
71}
72
73#[derive(Deserialize, Debug)]
74pub struct ScalewayIpv6 {
75    pub address: String,
76    pub gateway: Option<String>,
77    pub netmask: String,
78}
79
80#[derive(Deserialize, Debug)]
81pub struct ScalewaySecurityGroup {
82    pub id: String,
83    pub name: String,
84}
85
86#[derive(Deserialize, Debug)]
87pub struct ScalewayMaintenance {
88    pub reason: String,
89}
90
91#[derive(Deserialize, Debug)]
92pub struct ScalewayPlacementGroup {
93    pub id: String,
94    pub name: String,
95    pub organization: String,
96    pub project: String,
97    pub tags: Vec<String>,
98    pub policy_mode: String,
99    pub policy_type: String,
100    pub policy_respected: bool,
101    pub zone: String,
102}
103
104#[derive(Deserialize, Debug)]
105pub struct ScalewayPrivateNic {
106    pub id: String,
107    pub server_id: String,
108    pub private_network_id: String,
109    pub mac_address: String,
110    pub state: String,
111    pub tags: Vec<String>,
112}