oc-lib/datacenter.go

39 lines
1.1 KiB
Go
Raw Normal View History

2024-07-04 16:08:59 +02:00
package oclib
2024-07-16 10:56:36 +02:00
type Datacenter struct {
Resource
ID string `json:"ID", required: "true"`
Name string `json:"Name", required: "true" `
Owner string `json:"owner" `
BookingPrice int `json:"bookingPrice" `
CPU DatacenterCpuModel `json:"cpu" required:"true"`
RAM DatacenterMemoryModel `json:"ram" required:"true"`
GPU []DatacenterGpuModel `json:"gpu" required:"true"`
}
type DatacenterCpuModel struct {
Cores uint `json:"cores" required:"true"` //TODO: validate
Architecture string `json:"architecture"` //TOOD: enum
Shared bool `json:"shared"`
MinimumMemory uint `json:"minimum_memory"`
Platform string `json:"platform"`
}
type DatacenterMemoryModel struct {
Size uint `json:"size" description:"Units in MB"`
Ecc bool `json:"ecc"`
}
type DatacenterGpuModel struct {
CudaCores uint `json:"cuda_cores"`
Model string `json:"model"`
Memory uint `json:"memory" description:"Units in MB"`
TensorCores uint `json:"tensor_cores"`
}
func (d *Datacenter) GetType() ResourceType{
return DATACENTER
}