diff --git a/models/common/models/inoutputs.go b/models/common/models/inoutputs.go new file mode 100644 index 0000000..cf66b07 --- /dev/null +++ b/models/common/models/inoutputs.go @@ -0,0 +1,16 @@ +package models + +type Artifact struct { + Name string `json:"name" bson:"name" validate:"required"` + Path string `json:"value,omitempty" bson:"value,omitempty"` + From string `json:"from,omitempty" bson:"from,omitempty"` +} + +type Param struct { + Name string `json:"name" bson:"name" validate:"required"` + Value string `json:"value,omitempty" bson:"value,omitempty"` +} +type InOutputs struct { + Params []Param `json:"parameters" bson:"parameters"` + Artifacts []Artifact `json:"artifacts" bson:"artifacts"` +} diff --git a/models/resources/resource.go b/models/resources/resource.go index 882013a..c424cfa 100644 --- a/models/resources/resource.go +++ b/models/resources/resource.go @@ -4,6 +4,7 @@ import ( "slices" "cloud.o-forge.io/core/oc-lib/config" + "cloud.o-forge.io/core/oc-lib/models/common/models" "cloud.o-forge.io/core/oc-lib/models/common/pricing" "cloud.o-forge.io/core/oc-lib/models/peer" "cloud.o-forge.io/core/oc-lib/models/resources/resource_model" @@ -133,6 +134,8 @@ type ResourceInstance[T ResourcePartnerITF] struct { Location GeoPoint `json:"location,omitempty" bson:"location,omitempty"` Country countries.CountryCode `json:"country,omitempty" bson:"country,omitempty"` AccessProtocol string `json:"access_protocol,omitempty" bson:"access_protocol,omitempty"` + Inputs []models.InOutputs `json:"inputs,omitempty" bson:"inputs,omitempty"` + Outputs []models.InOutputs `json:"outputs,omitempty" bson:"outputs,omitempty"` Partnerships []T `json:"partnerships,omitempty" bson:"partnerships,omitempty"` }