update import plantUML

This commit is contained in:
mr
2026-01-12 11:59:05 +01:00
parent 346275e12c
commit 33b8d2799a
12 changed files with 437 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import (
"cloud.o-forge.io/core/oc-lib/models/common/pricing"
"cloud.o-forge.io/core/oc-lib/models/utils"
"cloud.o-forge.io/core/oc-lib/tools"
"github.com/google/uuid"
)
/*
@@ -60,6 +61,43 @@ type ComputeResourceInstance struct {
Nodes []*ComputeNode `json:"nodes,omitempty" bson:"nodes,omitempty"`
}
func NewComputeResourceInstance(name string, peerID string) ResourceInstanceITF {
return &ComputeResourceInstance{
ResourceInstance: ResourceInstance[*ComputeResourcePartnership]{
AbstractObject: utils.AbstractObject{
UUID: uuid.New().String(),
Name: name,
},
Partnerships: []*ComputeResourcePartnership{
{
ResourcePartnerShip: ResourcePartnerShip[*ComputeResourcePricingProfile]{
Namespace: "default",
PeerGroups: map[string][]string{
peerID: {"*"},
},
PricingProfiles: map[int]map[int]*ComputeResourcePricingProfile{
0: {
0: &ComputeResourcePricingProfile{
ExploitPricingProfile: pricing.ExploitPricingProfile[pricing.TimePricingStrategy]{
AccessPricingProfile: pricing.AccessPricingProfile[pricing.TimePricingStrategy]{
Pricing: pricing.PricingStrategy[pricing.TimePricingStrategy]{
Price: 0,
Currency: "EUR",
TimePricingStrategy: pricing.ONCE,
BuyingStrategy: pricing.PERMANENT,
},
},
},
},
},
},
},
},
},
},
}
}
type ComputeResourcePartnership struct {
ResourcePartnerShip[*ComputeResourcePricingProfile]
MinGaranteedCPUsCores map[string]float64 `json:"garanteed_cpus,omitempty" bson:"garanteed_cpus,omitempty"`