-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathruntime_outputs.rs
More file actions
62 lines (60 loc) · 2.32 KB
/
Copy pathruntime_outputs.rs
File metadata and controls
62 lines (60 loc) · 2.32 KB
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
//! Runtime Outputs Module
//!
//! This module contains the `RuntimeOutputs` struct which holds data generated
//! during deployment operations.
//!
//! ## Purpose
//!
//! Runtime outputs represent data that is produced as deployment operations
//! execute. These fields are mutable and grow as the deployment progresses.
//!
//! ## Semantic Category
//!
//! **Runtime Outputs** are:
//! - Generated during deployment operations
//! - Mutable as operations progress
//! - Examples: IP addresses, container IDs, timestamps
//!
//! Add new fields here when: Operations produce new data about the deployed infrastructure.
//!
//! ## Future Extensions
//!
//! This struct is expected to grow with fields like:
//! - `container_id: Option<String>` - Container/VM identifier
//! - `deployment_timestamp: Option<DateTime<Utc>>` - When the environment was deployed
//! - `resource_metrics: Option<ResourceMetrics>` - CPU, memory, disk usage
//! - `service_endpoints: Option<Vec<ServiceEndpoint>>` - HTTP/TCP service URLs
use serde::{Deserialize, Serialize};
use std::net::IpAddr;
/// Runtime outputs generated during deployment operations
///
/// This struct contains fields that are generated during deployment operations
/// and represent the runtime state of deployed infrastructure. These fields
/// are mutable as operations progress.
///
/// # Future Fields
///
/// This struct is expected to grow as deployment operations become more complex:
/// - `container_id: Option<String>` - Container/VM identifier
/// - `deployment_timestamp: Option<DateTime<Utc>>` - When the environment was deployed
/// - `resource_metrics: Option<ResourceMetrics>` - CPU, memory, disk usage
/// - `service_endpoints: Option<Vec<ServiceEndpoint>>` - HTTP/TCP service URLs
///
/// # Examples
///
/// ```rust
/// use torrust_tracker_deployer_lib::domain::environment::runtime_outputs::RuntimeOutputs;
/// use std::net::{IpAddr, Ipv4Addr};
///
/// let runtime_outputs = RuntimeOutputs {
/// instance_ip: Some(IpAddr::V4(Ipv4Addr::new(192, 168, 1, 100))),
/// };
/// ```
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RuntimeOutputs {
/// Instance IP address (populated after provisioning)
///
/// This field stores the IP address of the provisioned instance and is
/// `None` until the environment has been successfully provisioned.
pub instance_ip: Option<IpAddr>,
}