draft of compute units catalog

This commit is contained in:
mr 2025-06-17 14:57:36 +02:00
parent 1c751f7253
commit 0d6c329477

View File

@ -13,8 +13,22 @@ import (
* ComputeUnits is a struct that represents a compute units in your datacenters
*/
type ComputeUnitsCerts struct {
Host string `json:"host,omitempty" bson:"host,omitempty"`
Port string `json:"port,omitempty" bson:"port,omitempty"`
// for now only Kubernetes
CAData string `json:"ca_data,omitempty" bson:"ca_data,omitempty"`
CertData string `json:"cert_data,omitempty" bson:"cert_data,omitempty"`
KeyData string `json:"key_data,omitempty" bson:"key_data,omitempty"`
}
// TODO in the future multiple type of certs depending of infra type
type ComputeUnits struct {
utils.AbstractObject
Certs ComputeUnitsCerts `json:"certs,omitempty" bson:"certs,omitempty"`
MonitorPath string `json:"monitor_path,omitempty" bson:"monitor_path,omitempty"`
Location resources.GeoPoint `json:"location,omitempty" bson:"location,omitempty"`
Country countries.CountryCode `json:"country,omitempty" bson:"country,omitempty"`
@ -28,7 +42,7 @@ type ComputeUnits struct {
CPUs map[string]*models.CPU `bson:"cpus,omitempty" json:"cpus,omitempty"` // CPUs is the list of CPUs key is model
GPUs map[string]*models.GPU `bson:"gpus,omitempty" json:"gpus,omitempty"` // GPUs is the list of GPUs key is model
Nodes []*resources.ComputeNode `json:"nodes,omitempty" bson:"nodes,omitempty"`
ResourceID string `json:"-" bson:"-"`
ResourceID string `json:"resource_id" bson:"resource_id"`
}
func (r *ComputeUnits) StoreDraftDefault() {