Files
watcheragent/WatcherAgent/src/models.rs

75 lines
1.8 KiB
Rust

use serde::{Deserialize, Serialize};
// Data structures matching the C# DTOs
#[derive(Serialize, Debug)]
pub struct RegistrationDto {
#[serde(rename = "id")]
pub id: i32,
#[serde(rename = "ipAddress")]
pub ip_address: String,
#[serde(rename = "cpuType")]
pub cpu_type: String,
#[serde(rename = "cpuCores")]
pub cpu_cores: i32,
#[serde(rename = "gpuType")]
pub gpu_type: String,
#[serde(rename = "ramSize")]
pub ram_size: f64,
}
#[derive(Serialize, Debug)]
pub struct MetricDto {
#[serde(rename = "serverId")]
pub server_id: i32,
#[serde(rename = "ipAddress")]
pub ip_address: String,
#[serde(rename = "cpu_Load")]
pub cpu_load: f64,
#[serde(rename = "cpu_Temp")]
pub cpu_temp: f64,
#[serde(rename = "gpu_Load")]
pub gpu_load: f64,
#[serde(rename = "gpu_Temp")]
pub gpu_temp: f64,
#[serde(rename = "gpu_Vram_Size")]
pub gpu_vram_size: f64,
#[serde(rename = "gpu_Vram_Usage")]
pub gpu_vram_usage: f64,
#[serde(rename = "ram_Load")]
pub ram_load: f64,
#[serde(rename = "ram_Size")]
pub ram_size: f64,
#[serde(rename = "disk_Size")]
pub disk_size: f64,
#[serde(rename = "disk_Usage")]
pub disk_usage: f64,
#[serde(rename = "disk_Temp")]
pub disk_temp: f64,
#[serde(rename = "net_In")]
pub net_rx: f64,
#[serde(rename = "net_Out")]
pub net_tx: f64,
}
#[derive(Deserialize)]
pub struct IdResponse {
pub id: i32,
#[serde(rename = "ipAddress")]
pub ip_address: String,
}
#[derive(Serialize)]
pub struct HeartbeatDto {
#[serde(rename = "IpAddress")]
pub ip_address: String,
}
#[derive(Serialize, Debug)]
pub struct HardwareDto {
pub cpu_type: String,
pub cpu_cores: i32,
pub gpu_type: String,
pub ram_size: f64,
pub ip_address: String,
}