omni_orchestrator/schemas/v1/models/
storage.rs1use serde::{Deserialize, Serialize};
2use chrono::{DateTime, NaiveDateTime, Utc};
3use serde_json::Value;
4use sqlx::Row;
5
6#[derive(Debug, sqlx::FromRow, Serialize)]
7pub struct StorageClass {
8 pub id: i64,
9 pub name: String,
10 pub provisioner: String,
11 pub reclaim_policy: String, pub volume_binding_mode: String, pub allow_volume_expansion: bool,
14 pub storage_type: String, pub default_filesystem: String, pub created_at: DateTime<Utc>,
17 pub updated_at: DateTime<Utc>,
18}
19
20#[derive(Debug, sqlx::FromRow, Serialize)]
21pub struct StorageVolume {
22 pub id: i64,
23 pub app_id: i64,
24 pub name: String,
25 pub size_gb: i64,
26 pub storage_class: String,
27 pub access_mode: String, pub status: String, pub node_id: i64,
30 pub encryption_enabled: bool,
31 pub persistence_level: String, pub write_concern: String, pub reclaim_policy: String, pub filesystem_type: Option<String>,
35 pub storage_class_id: i64,
36 pub created_at: DateTime<Utc>,
37 pub updated_at: DateTime<Utc>,
38 pub snapshot_id: Option<i64>,
39 pub mount_path: Option<String>,
40}
41
42#[derive(Debug, sqlx::FromRow, Serialize)]
43pub struct StorageSnapshot {
44 pub id: i64,
45 pub volume_id: i64,
46 pub name: String,
47 pub size_gb: i64,
48 pub created_at: DateTime<Utc>,
49 pub status: String, pub description: Option<String>,
51 pub retention_date: Option<DateTime<Utc>>,
52}
53
54#[derive(Debug, sqlx::FromRow, Serialize)]
55pub struct StorageMigration {
56 pub id: i64,
57 pub source_volume_id: i64,
58 pub destination_volume_id: i64,
59 pub migration_type: String, pub status: String, pub progress_percent: i32,
62 pub started_at: DateTime<Utc>,
63 pub completed_at: Option<DateTime<Utc>>,
64 pub is_online: bool,
65 pub error_message: Option<String>,
66 pub created_by: String,
67}
68
69#[derive(Debug, sqlx::FromRow, Serialize)]
70pub struct StorageQosPolicy {
71 pub id: i64,
72 pub name: String,
73 pub max_iops: Option<i32>,
74 pub max_throughput_mbps: Option<i32>,
75 pub burst_iops: Option<i32>,
76 pub burst_duration_seconds: Option<i32>,
77 pub latency_target_ms: Option<i32>,
78 pub created_at: DateTime<Utc>,
79 pub updated_at: DateTime<Utc>
80}