First batch

This commit is contained in:
pb
2024-07-16 10:56:36 +02:00
parent 5ba33d3131
commit 034a81cedb
19 changed files with 540 additions and 30 deletions

View File

@@ -1 +1,39 @@
package oclib
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
}