update import plantUML
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user