|
|
@ -19,9 +19,8 @@ use uuid;
|
|
|
|
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
|
|
|
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
|
|
|
/// Defines a VM (used for requests using the VM section)
|
|
|
|
/// Defines a VM (used for requests using the VM section)
|
|
|
|
pub struct VirtualMachine {
|
|
|
|
pub struct VirtualMachine {
|
|
|
|
#[serde_as(as="DisplayFromStr")]
|
|
|
|
|
|
|
|
/// the UUID of the VM
|
|
|
|
/// the UUID of the VM
|
|
|
|
vm_id: uuid::Uuid, // should be UUIDv4
|
|
|
|
vm_id: String, // should be UUIDv4
|
|
|
|
/// the name of the VM set by the user
|
|
|
|
/// the name of the VM set by the user
|
|
|
|
name: String, // the name set by the user
|
|
|
|
name: String, // the name set by the user
|
|
|
|
#[serde_as(as="DisplayFromStr")]
|
|
|
|
#[serde_as(as="DisplayFromStr")]
|
|
|
@ -76,7 +75,7 @@ enum AttachmentType {
|
|
|
|
#[serde_as]
|
|
|
|
#[serde_as]
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
|
|
struct FloatingIp {
|
|
|
|
struct FloatingIp {
|
|
|
|
attached_id: Option<uuid::Uuid>,
|
|
|
|
attached_id: Option<String>,
|
|
|
|
attached_name: Option<String>,
|
|
|
|
attached_name: Option<String>,
|
|
|
|
attached_type: AttachmentType,
|
|
|
|
attached_type: AttachmentType,
|
|
|
|
hostname: String,
|
|
|
|
hostname: String,
|
|
|
@ -121,7 +120,7 @@ pub struct VMInfoExtra {
|
|
|
|
vcpu: i32,
|
|
|
|
vcpu: i32,
|
|
|
|
#[serde_as(as="DisplayFromStr")]
|
|
|
|
#[serde_as(as="DisplayFromStr")]
|
|
|
|
/// UUIDv4 of the VM
|
|
|
|
/// UUIDv4 of the VM
|
|
|
|
vm_id: uuid::Uuid,
|
|
|
|
vm_id: String,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
|
|
#[serde(untagged)]
|
|
|
|
#[serde(untagged)]
|
|
|
@ -279,7 +278,7 @@ pub struct Volume {
|
|
|
|
id: i32,
|
|
|
|
id: i32,
|
|
|
|
#[serde_as(as="DisplayFromStr")]
|
|
|
|
#[serde_as(as="DisplayFromStr")]
|
|
|
|
/// the UUID for the volume
|
|
|
|
/// the UUID for the volume
|
|
|
|
identification: uuid::Uuid,
|
|
|
|
identification: String,
|
|
|
|
/// the name set by the user
|
|
|
|
/// the name set by the user
|
|
|
|
name: String,
|
|
|
|
name: String,
|
|
|
|
/// The region where the volume is located.
|
|
|
|
/// The region where the volume is located.
|
|
|
@ -604,3 +603,12 @@ pub struct EmailUserListResponse {
|
|
|
|
#[serde(flatten)]
|
|
|
|
#[serde(flatten)]
|
|
|
|
users: std::collections::HashMap<String, EmailUser>,
|
|
|
|
users: std::collections::HashMap<String, EmailUser>,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[lunanode_response]
|
|
|
|
|
|
|
|
pub struct VmStartResponse {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[lunanode_response]
|
|
|
|
|
|
|
|
pub struct VmStopResponse {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[lunanode_response]
|
|
|
|
|
|
|
|
pub struct VmRebootResponse {}
|
|
|
|