@@ -43,9 +43,19 @@ type ApplicationSpec struct {
4343
4444// ComponentRef references a Component within an Application
4545type ComponentRef struct {
46- Name string `yaml:"name"` // Component name
47- VirtualMachineSpec string `yaml:"virtualMachineSpec"` // Reusable VM spec name
48- Replicas int `yaml:"replicas"` // Number of VM replicas
46+ Name string `yaml:"name"` // Component name
47+ VirtualMachineSpec string `yaml:"virtualMachineSpec"` // Reusable VM spec name
48+ Replicas int `yaml:"replicas"` // Number of VM replicas
49+ HealthChecks []HealthCheck `yaml:"healthChecks,omitempty" gorm:"serializer:json"`
50+ }
51+
52+ // HealthCheck defines a simple health check configuration for VMs
53+ type HealthCheck struct {
54+ Type string `yaml:"type"` // e.g. ping, http
55+ Interval string `yaml:"interval,omitempty"` // e.g. 10s
56+ Timeout string `yaml:"timeout,omitempty"` // e.g. 5s
57+ Path string `yaml:"path,omitempty"` // HTTP path for http checks
58+ Port int `yaml:"port,omitempty"` // Optional port for TCP/HTTP checks
4959}
5060
5161// Component represents a set of VMs for a specific role (e.g. frontend/backend)
@@ -67,6 +77,7 @@ type ComponentSpec struct {
6777 VirtualMachineSpec string `yaml:"virtualMachineSpec"` // Reusable VM spec name
6878 Replicas int `yaml:"replicas"` // Number of VM replicas
6979 Overrides ComponentOverrides `yaml:"overrides,omitempty" gorm:"serializer:json"`
80+ HealthChecks []HealthCheck `yaml:"healthChecks,omitempty" gorm:"serializer:json"`
7081}
7182
7283// ComponentOverrides allows limited, safe overrides to a reused VM spec
@@ -91,15 +102,16 @@ type VirtualMachine struct {
91102
92103// VirtualMachineSpec defines reusable VM configuration (template/offering/network)
93104type VirtualMachineSpec struct {
94- ProjectID string `yaml:"projectId"` // CloudStack project ID
95- Template string `yaml:"template"` // VM template name/ID
96- ServiceOffering string `yaml:"serviceOffering"` // VM service offering (size)
97- NetworkIDs []string `yaml:"networkIds" gorm:"serializer:json"` // Attached networks
98- SSHKeys []string `yaml:"sshKeys" gorm:"serializer:json"` // SSH keys for access
99- SecurityGroups []string `yaml:"securityGroups" gorm:"serializer:json"` // Firewall groups
100- AffinityGroups []string `yaml:"affinityGroups" gorm:"serializer:json"` // Host/VM affinity rules
101- UserDataRefs []string `yaml:"userDataRefs,omitempty" gorm:"serializer:json"` // Optional references to UserData resources
102- Volumes []VolumeSpec `yaml:"volumes,omitempty" gorm:"serializer:json"` // Desired or observed attached volumes
105+ ProjectID string `yaml:"projectId"` // CloudStack project ID
106+ Template string `yaml:"template"` // VM template name/ID
107+ ServiceOffering string `yaml:"serviceOffering"` // VM service offering (size)
108+ NetworkIDs []string `yaml:"networkIds" gorm:"serializer:json"` // Attached networks
109+ SSHKeys []string `yaml:"sshKeys" gorm:"serializer:json"` // SSH keys for access
110+ SecurityGroups []string `yaml:"securityGroups" gorm:"serializer:json"` // Firewall groups
111+ AffinityGroups []string `yaml:"affinityGroups" gorm:"serializer:json"` // Host/VM affinity rules
112+ UserDataRefs []string `yaml:"userDataRefs,omitempty" gorm:"serializer:json"` // Optional references to UserData resources
113+ Volumes []VolumeSpec `yaml:"volumes,omitempty" gorm:"serializer:json"` // Desired or observed attached volumes
114+ HealthChecks []HealthCheck `yaml:"healthChecks,omitempty" gorm:"serializer:json"`
103115}
104116
105117// VirtualMachineSpecResource is the persisted wrapper for reusable VM specs
0 commit comments