tosca_v2_0

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const TimestampFormat = "%04d-%02d-%02dT%02d:%02d:%02d%s%s"
View Source
const TimestampTimezoneFormat = "%s%02d:%02d"

Variables

View Source
var ConstraintClauseNativeArgumentIndexes = map[string][]uint{
	"tosca.constraint.equal":            {0},
	"tosca.constraint.greater_than":     {0},
	"tosca.constraint.greater_or_equal": {0},
	"tosca.constraint.less_than":        {0},
	"tosca.constraint.less_or_equal":    {0},
	"tosca.constraint.in_range":         {0, 1},
}
View Source
var ConstraintClauseScriptlets = map[string]string{
	"tosca.constraint.equal":            profile.Profile["/tosca/implicit/2.0/js/constraints/equal.js"],
	"tosca.constraint.greater_than":     profile.Profile["/tosca/implicit/2.0/js/constraints/greater_than.js"],
	"tosca.constraint.greater_or_equal": profile.Profile["/tosca/implicit/2.0/js/constraints/greater_or_equal.js"],
	"tosca.constraint.less_than":        profile.Profile["/tosca/implicit/2.0/js/constraints/less_than.js"],
	"tosca.constraint.less_or_equal":    profile.Profile["/tosca/implicit/2.0/js/constraints/less_or_equal.js"],
	"tosca.constraint.in_range":         profile.Profile["/tosca/implicit/2.0/js/constraints/in_range.js"],
	"tosca.constraint.valid_values":     profile.Profile["/tosca/implicit/2.0/js/constraints/valid_values.js"],
	"tosca.constraint.length":           profile.Profile["/tosca/implicit/2.0/js/constraints/length.js"],
	"tosca.constraint.min_length":       profile.Profile["/tosca/implicit/2.0/js/constraints/min_length.js"],
	"tosca.constraint.max_length":       profile.Profile["/tosca/implicit/2.0/js/constraints/max_length.js"],
	"tosca.constraint.pattern":          profile.Profile["/tosca/implicit/2.0/js/constraints/pattern.js"],
	"tosca.constraint.schema":           profile.Profile["/tosca/implicit/2.0/js/constraints/schema.js"],
}

Built-in constraint functions

View Source
var DefaultScriptletNamespace = tosca.NewScriptletNamespace()
View Source
var FunctionScriptlets = map[string]string{
	"tosca.function.concat":               profile.Profile["/tosca/implicit/2.0/js/functions/concat.js"],
	"tosca.function.join":                 profile.Profile["/tosca/implicit/2.0/js/functions/join.js"],
	"tosca.function.token":                profile.Profile["/tosca/implicit/2.0/js/functions/token.js"],
	"tosca.function.get_input":            profile.Profile["/tosca/implicit/2.0/js/functions/get_input.js"],
	"tosca.function.get_property":         profile.Profile["/tosca/implicit/2.0/js/functions/get_property.js"],
	"tosca.function.get_attribute":        profile.Profile["/tosca/implicit/2.0/js/functions/get_attribute.js"],
	"tosca.function.get_operation_output": profile.Profile["/tosca/implicit/2.0/js/functions/get_operation_output.js"],
	"tosca.function.get_nodes_of_type":    profile.Profile["/tosca/implicit/2.0/js/functions/get_nodes_of_type.js"],
	"tosca.function.get_artifact":         profile.Profile["/tosca/implicit/2.0/js/functions/get_artifact.js"],
}
View Source
var Grammar = tosca.NewGrammar()
View Source
var ScalarUnitBitrateMeasures = ScalarUnitMeasures{
	"bps":   1,
	"Kbps":  1000,
	"Kibps": 1024,
	"Mbps":  1000000,
	"Mibps": 1048576,
	"Gbps":  1000000000,
	"Gibps": 1073741824,
	"Tbps":  1000000000000,
	"Tibps": 1099511627776,
	"Bps":   8,
	"KBps":  8000,
	"KiBps": 8192,
	"MBps":  8000000,
	"MiBps": 8388608,
	"GBps":  8000000000,
	"GiBps": 8589934592,
	"TBps":  8000000000000,
	"TiBps": 8796093022208,
}

Case-sensitive!

View Source
var ScalarUnitBitrateRE = regexp.MustCompile(
	`^(?P<scalar>[0-9]*\.?[0-9]+(?:e[-+]?[0-9]+)?)\s*` +
		`(?P<unit>bps|Kbps|Kibps|Mbps|Mibps|Gbps|Gibps|Tbps|Tibps|Bps|KBps|KiBps|MBps|MiBps|GBps|GiBps|TBps|TiBps)$`)
View Source
var ScalarUnitFrequencyMeasures = ScalarUnitMeasures{
	"Hz":  1,
	"kHz": 1000,
	"MHz": 1000000,
	"GHz": 1000000000,
}
View Source
var ScalarUnitFrequencyRE = regexp.MustCompile(
	`^(?P<scalar>[0-9]*\.?[0-9]+(?:e[-+]?[0-9]+)?)\s*` +
		`(?i)(?P<unit>Hz|kHz|MHz|GHz)$`)
View Source
var ScalarUnitSizeMeasures = ScalarUnitMeasures{
	"B":   1,
	"kB":  1000,
	"KiB": 1024,
	"MB":  1000000,
	"MiB": 1048576,
	"GB":  1000000000,
	"GiB": 1073741824,
	"TB":  1000000000000,
	"TiB": 1099511627776,
}
View Source
var ScalarUnitSizeRE = regexp.MustCompile(
	`^(?P<scalar>[0-9]*\.?[0-9]+(?:e[-+]?[0-9]+)?)\s*` +
		`(?i)(?P<unit>B|kB|KiB|MB|MiB|GB|GiB|TB|TiB)$`)
View Source
var ScalarUnitTimeMeasures = ScalarUnitMeasures{
	"ns": 0.000000001,
	"us": 0.000001,
	"ms": 0.001,
	"s":  1,
	"m":  60,
	"h":  3600,
	"d":  86400,
}
View Source
var ScalarUnitTimeRE = regexp.MustCompile(
	`^(?P<scalar>[0-9]*\.?[0-9]+(?:e[-+]?[0-9]+)?)\s*` +
		`(?i)(?P<unit>ns|us|ms|s|m|h|d)$`)
View Source
var ScalarUnitTypeZeroes = map[ard.TypeName]ard.Value{
	"scalar-unit.size":      int(0),
	"scalar-unit.time":      float64(0.0),
	"scalar-unit.frequency": float64(0.0),
	"scalar-unit.bitrate":   float64(0.0),
}
View Source
var TimestampLongRE = regexp.MustCompile(
	`^(?P<year>[0-9][0-9][0-9][0-9])-(?P<month>[0-9][0-9]?)-(?P<day>[0-9][0-9]?)` +
		`(?:[Tt]|[ \t]+)` +
		`(?P<hour>[0-9][0-9]?):(?P<minute>[0-9][0-9]):(?P<second>[0-9][0-9])(?:(?P<fraction>\.[0-9]*))?` +
		`(?:(?:[ \t]*)(?:Z|(?P<tzhour>[-+][0-9][0-9]?)(?::(?P<tzminute>[0-9][0-9]))?))?$`)
View Source
var TimestampShortRE = regexp.MustCompile(`^(?P<year>[0-9][0-9][0-9][0-9])-(?P<month>[0-9][0-9])-(?P<day>[0-9][0-9])$`)
View Source
var VersionRE = regexp.MustCompile(
	`^(?P<major>\d+)\.(?P<minor>\d+)(?:\.(?P<fix>\d+)` +
		`(?:(?:\.(?P<qualifier>\w+))(?:-(?P<build>\d+))?)?)?$`)

Functions

func CompareFloat64

func CompareFloat64(v1 float64, v2 float64) int

func CompareInt64

func CompareInt64(v1 int64, v2 int64) int

func CompareUint32

func CompareUint32(v1 uint32, v2 uint32) int

func CompareUint64

func CompareUint64(v1 uint64, v2 uint64) int

func CopyAndMerge

func CopyAndMerge(target ard.Value, source ard.Value, copiedNames []string, targets ard.Map) (ard.Value, bool)

func CopyTemplate

func CopyTemplate(context *tosca.Context)

Implements the "copy" feature for node templates and relationship templates

func NormalizeFunctionCallArguments

func NormalizeFunctionCallArguments(functionCall *tosca.FunctionCall, context *tosca.Context)

func ReadArtifact

func ReadArtifact(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadArtifactDefinition

func ReadArtifactDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadArtifactType

func ReadArtifactType(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadAttributeDefinition

func ReadAttributeDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadAttributeMapping

func ReadAttributeMapping(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadAttributeValue

func ReadAttributeValue(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature [TOSCA-Simple-Profile-YAML-v1.2] @ 3.6.12.2.2 [TOSCA-Simple-Profile-YAML-v1.1] @ 3.5.11.2.2

func ReadBytes added in v0.17.0

func ReadBytes(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadCapabilityAssignment

func ReadCapabilityAssignment(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadCapabilityDefinition

func ReadCapabilityDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadCapabilityFilter

func ReadCapabilityFilter(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadCapabilityMapping

func ReadCapabilityMapping(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadCapabilityType

func ReadCapabilityType(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadConditionClause

func ReadConditionClause(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadConstraintClause

func ReadConstraintClause(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadDataType

func ReadDataType(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadEventFilter

func ReadEventFilter(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadGroup

func ReadGroup(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadGroupType

func ReadGroupType(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadImport

func ReadImport(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadInterfaceAssignment

func ReadInterfaceAssignment(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadInterfaceDefinition

func ReadInterfaceDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadInterfaceImplementation

func ReadInterfaceImplementation(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadInterfaceMapping

func ReadInterfaceMapping(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadInterfaceType

func ReadInterfaceType(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadMetadata

func ReadMetadata(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadNodeFilter

func ReadNodeFilter(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadNodeTemplate

func ReadNodeTemplate(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadNodeType

func ReadNodeType(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadNotificationAssignment

func ReadNotificationAssignment(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadNotificationDefinition

func ReadNotificationDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadOperationAssignment

func ReadOperationAssignment(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadOperationDefinition

func ReadOperationDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadOutputMapping added in v0.16.0

func ReadOutputMapping(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadParameterDefinition

func ReadParameterDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadPolicy

func ReadPolicy(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadPolicyType

func ReadPolicyType(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadPropertyDefinition

func ReadPropertyDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadPropertyFilter

func ReadPropertyFilter(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadPropertyMapping

func ReadPropertyMapping(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadRange

func ReadRange(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadRangeEntity

func ReadRangeEntity(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadRelationshipAssignment

func ReadRelationshipAssignment(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadRelationshipDefinition

func ReadRelationshipDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadRelationshipTemplate

func ReadRelationshipTemplate(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadRelationshipType

func ReadRelationshipType(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadRepository

func ReadRepository(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadRequirementAssignment

func ReadRequirementAssignment(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadRequirementDefinition

func ReadRequirementDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadRequirementMapping

func ReadRequirementMapping(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadScalarUnitBitrate

func ReadScalarUnitBitrate(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadScalarUnitFrequency

func ReadScalarUnitFrequency(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadScalarUnitSize

func ReadScalarUnitSize(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadScalarUnitTime

func ReadScalarUnitTime(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadSchema

func ReadSchema(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadServiceTemplate

func ReadServiceTemplate(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadSubstitutionMappings

func ReadSubstitutionMappings(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadTimestamp

func ReadTimestamp(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadTopologyTemplate

func ReadTopologyTemplate(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadTriggerDefinition

func ReadTriggerDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadTriggerDefinitionCondition

func ReadTriggerDefinitionCondition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadUnit

func ReadUnit(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadValue

func ReadValue(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadVersion

func ReadVersion(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadWorkflowActivityCallOperation

func ReadWorkflowActivityCallOperation(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadWorkflowActivityDefinition

func ReadWorkflowActivityDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadWorkflowDefinition

func ReadWorkflowDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadWorkflowPreconditionDefinition

func ReadWorkflowPreconditionDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ReadWorkflowStepDefinition

func ReadWorkflowStepDefinition(context *tosca.Context) tosca.EntityPtr

tosca.Reader signature

func ToFunctionCall

func ToFunctionCall(context *tosca.Context) bool

Types

type Artifact

type Artifact struct {
	*ArtifactDefinition `name:"artifact"`
}

func NewArtifact

func NewArtifact(context *tosca.Context) *Artifact

func (*Artifact) Copy

func (self *Artifact) Copy(definition *ArtifactDefinition)

func (*Artifact) DoRender

func (self *Artifact) DoRender()

func (*Artifact) Normalize

func (self *Artifact) Normalize(normalNodeTemplate *normal.NodeTemplate) *normal.Artifact

type ArtifactDefinition

type ArtifactDefinition struct {
	*Entity `name:"artifact definition"`
	Name    string

	ArtifactTypeName  *string `read:"type"` // required only if cannot be inherited
	Description       *string `read:"description"`
	ArtifactVersion   *string `read:"artifact_version"` // introduced in TOSCA 1.3
	Properties        Values  `read:"properties,Value"` // ERRATUM: ommited in TOSCA 1.0-1.2 (appears in artifact type)
	RepositoryName    *string `read:"repository"`
	File              *string `read:"file"` // required only if cannot be inherited
	DeployPath        *string `read:"deploy_path"`
	ChecksumAlgorithm *string `read:"checksum_algorithm"` // introduced in TOSCA 1.3
	Checksum          *string `read:"checksum"`           // introduced in TOSCA 1.3

	ArtifactType *ArtifactType `lookup:"type,ArtifactTypeName" json:"-" yaml:"-"`
	Repository   *Repository   `lookup:"repository,RepositoryName" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewArtifactDefinition

func NewArtifactDefinition(context *tosca.Context) *ArtifactDefinition

func (*ArtifactDefinition) GetExtension

func (self *ArtifactDefinition) GetExtension() string

func (*ArtifactDefinition) GetKey

func (self *ArtifactDefinition) GetKey() string

tosca.Mappable interface

func (*ArtifactDefinition) GetURL

func (self *ArtifactDefinition) GetURL() urlpkg.URL

func (*ArtifactDefinition) Inherit

func (self *ArtifactDefinition) Inherit(parentDefinition *ArtifactDefinition)

type ArtifactDefinitions

type ArtifactDefinitions map[string]*ArtifactDefinition

func (ArtifactDefinitions) Inherit

func (self ArtifactDefinitions) Inherit(parentDefinitions ArtifactDefinitions)

type ArtifactType

type ArtifactType struct {
	*Type `name:"artifact type"`

	PropertyDefinitions PropertyDefinitions `read:"properties,PropertyDefinition" inherit:"properties,Parent"`
	MIMEType            *string             `read:"mime_type" inherit:"mime_type,Parent"`
	FileExtension       *[]string           `read:"file_ext" inherit:"file_ext,Parent"`

	Parent *ArtifactType `lookup:"derived_from,ParentName" json:"-" yaml:"-"`
}

func NewArtifactType

func NewArtifactType(context *tosca.Context) *ArtifactType

func (*ArtifactType) GetParent

func (self *ArtifactType) GetParent() tosca.EntityPtr

tosca.Hierarchical interface

func (*ArtifactType) Inherit

func (self *ArtifactType) Inherit()

tosca.Inherits interface

type ArtifactTypes

type ArtifactTypes []*ArtifactType

type Artifacts

type Artifacts map[string]*Artifact

func (Artifacts) Normalize

func (self Artifacts) Normalize(normalNodeTemplate *normal.NodeTemplate)

func (Artifacts) Render

func (self Artifacts) Render(definitions ArtifactDefinitions, context *tosca.Context)

type AttributeDefinition

type AttributeDefinition struct {
	*Entity `name:"attribute definition"`
	Name    string

	Metadata     Metadata `read:"metadata,Metadata"` // introduced in TOSCA 1.3
	Description  *string  `read:"description"`
	DataTypeName *string  `read:"type"`                // required only if cannot be inherited or discovered
	KeySchema    *Schema  `read:"key_schema,Schema"`   // introduced in TOSCA 1.3
	EntrySchema  *Schema  `read:"entry_schema,Schema"` // required if list or map
	Default      *Value   `read:"default,Value"`
	Status       *string  `read:"status"`

	DataType *DataType `lookup:"type,DataTypeName" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewAttributeDefinition

func NewAttributeDefinition(context *tosca.Context) *AttributeDefinition

func (*AttributeDefinition) GetKey

func (self *AttributeDefinition) GetKey() string

tosca.Mappable interface

func (*AttributeDefinition) GetTypeInformation

func (self *AttributeDefinition) GetTypeInformation() *normal.TypeInformation

func (*AttributeDefinition) Inherit

func (self *AttributeDefinition) Inherit(parentDefinition *AttributeDefinition)

func (*AttributeDefinition) Render

func (self *AttributeDefinition) Render()

parser.Renderable interface

type AttributeDefinitions

type AttributeDefinitions map[string]*AttributeDefinition

func (AttributeDefinitions) Inherit

func (self AttributeDefinitions) Inherit(parentDefinitions AttributeDefinitions)

type AttributeMapping

type AttributeMapping struct {
	*Entity `name:"attribute mapping"`
	Name    string

	NodeTemplateName *string
	AttributeName    *string

	NodeTemplate *NodeTemplate `traverse:"ignore" json:"-" yaml:"-"`
	Attribute    *Value        `traverse:"ignore" json:"-" yaml:"-"`
}

func NewAttributeMapping

func NewAttributeMapping(context *tosca.Context) *AttributeMapping

func (*AttributeMapping) EnsureRender added in v0.18.0

func (self *AttributeMapping) EnsureRender()

func (*AttributeMapping) GetKey added in v0.18.0

func (self *AttributeMapping) GetKey() string

tosca.Mappable interface

type AttributeMappings

type AttributeMappings map[string]*AttributeMapping

func (AttributeMappings) EnsureRender added in v0.18.0

func (self AttributeMappings) EnsureRender()

type Bytes added in v0.17.0

type Bytes struct {
	OriginalString string `json:"$originalString" yaml:"$originalString"`

	Bytes []byte `json:"bytes" yaml:"bytes"`
}

type CapabilityAssignment

type CapabilityAssignment struct {
	*Entity `name:"capability"`
	Name    string

	Properties  Values       `read:"properties,Value"`
	Attributes  Values       `read:"attributes,AttributeValue"`
	Occurrences *RangeEntity `read:"occurrences,RangeEntity"` // introduced in TOSCA 1.3
}

func NewCapabilityAssignment

func NewCapabilityAssignment(context *tosca.Context) *CapabilityAssignment

func (*CapabilityAssignment) GetDefinition

func (self *CapabilityAssignment) GetDefinition(nodeTemplate *NodeTemplate) (*CapabilityDefinition, bool)

func (*CapabilityAssignment) GetKey

func (self *CapabilityAssignment) GetKey() string

tosca.Mappable interface

func (*CapabilityAssignment) Normalize

func (self *CapabilityAssignment) Normalize(normalNodeTemplate *normal.NodeTemplate, definition *CapabilityDefinition) *normal.Capability

func (*CapabilityAssignment) Render

func (self *CapabilityAssignment) Render(definition *CapabilityDefinition)

type CapabilityAssignments

type CapabilityAssignments map[string]*CapabilityAssignment

func (CapabilityAssignments) Normalize

func (self CapabilityAssignments) Normalize(nodeTemplate *NodeTemplate, n *normal.NodeTemplate)

func (CapabilityAssignments) Render

func (self CapabilityAssignments) Render(definitions CapabilityDefinitions, context *tosca.Context)

type CapabilityDefinition

type CapabilityDefinition struct {
	*Entity `name:"capability definition"`
	Name    string

	Description              *string              `read:"description"`
	CapabilityTypeName       *string              `read:"type"` // required only if cannot be inherited
	PropertyDefinitions      PropertyDefinitions  `read:"properties,PropertyDefinition" inherit:"properties,CapabilityType"`
	AttributeDefinitions     AttributeDefinitions `read:"attributes,PropertyDefinition" inherit:"attributes,CapabilityType"`
	ValidSourceNodeTypeNames *[]string            `read:"valid_source_types" inherit:"valid_source_types,CapabilityType"`
	Occurrences              *RangeEntity         `read:"occurrences,RangeEntity"`

	CapabilityType       *CapabilityType `lookup:"type,CapabilityTypeName" json:"-" yaml:"-"`
	ValidSourceNodeTypes NodeTypes       `lookup:"valid_source_types,ValidSourceNodeTypeNames" apply:"valid_source_types,CapabilityType" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewCapabilityDefinition

func NewCapabilityDefinition(context *tosca.Context) *CapabilityDefinition

func (*CapabilityDefinition) GetKey

func (self *CapabilityDefinition) GetKey() string

tosca.Mappable interface

func (*CapabilityDefinition) Inherit

func (self *CapabilityDefinition) Inherit(parentDefinition *CapabilityDefinition)

func (*CapabilityDefinition) Render

func (self *CapabilityDefinition) Render()

parser.Renderable interface

type CapabilityDefinitions

type CapabilityDefinitions map[string]*CapabilityDefinition

func (CapabilityDefinitions) Inherit

func (self CapabilityDefinitions) Inherit(parentDefinitions CapabilityDefinitions)

type CapabilityFilter

type CapabilityFilter struct {
	*Entity `name:"capability filter"`
	Name    string

	PropertyFilters PropertyFilters `read:"properties,PropertyFilter"`
}

func NewCapabilityFilter

func NewCapabilityFilter(context *tosca.Context) *CapabilityFilter

func (CapabilityFilter) Normalize

func (self CapabilityFilter) Normalize(normalRequirement *normal.Requirement) normal.FunctionCallMap

type CapabilityFilters

type CapabilityFilters []*CapabilityFilter

func (CapabilityFilters) Normalize

func (self CapabilityFilters) Normalize(normalRequirement *normal.Requirement)

type CapabilityMapping

type CapabilityMapping struct {
	*Entity `name:"capability mapping"`
	Name    string

	NodeTemplateName *string
	CapabilityName   *string

	NodeTemplate *NodeTemplate         `traverse:"ignore" json:"-" yaml:"-"`
	Capability   *CapabilityAssignment `traverse:"ignore" json:"-" yaml:"-"`
}

func NewCapabilityMapping

func NewCapabilityMapping(context *tosca.Context) *CapabilityMapping

func (*CapabilityMapping) GetCapabilityDefinition added in v0.18.0

func (self *CapabilityMapping) GetCapabilityDefinition() (*CapabilityDefinition, bool)

func (*CapabilityMapping) GetKey added in v0.18.0

func (self *CapabilityMapping) GetKey() string

tosca.Mappable interface

func (*CapabilityMapping) Render

func (self *CapabilityMapping) Render()

parser.Renderable interface

type CapabilityMappings

type CapabilityMappings map[string]*CapabilityMapping

type CapabilityType

type CapabilityType struct {
	*Type `name:"capability type"`

	PropertyDefinitions      PropertyDefinitions  `read:"properties,PropertyDefinition" inherit:"properties,Parent"`
	AttributeDefinitions     AttributeDefinitions `read:"attributes,AttributeDefinition" inherit:"attributes,Parent"`
	ValidSourceNodeTypeNames *[]string            `read:"valid_source_types" inherit:"valid_source_types,Parent"`

	Parent               *CapabilityType `lookup:"derived_from,ParentName" json:"-" yaml:"-"`
	ValidSourceNodeTypes NodeTypes       `lookup:"valid_source_types,ValidSourceNodeTypeNames" inherit:"valid_source_types,Parent" json:"-" yaml:"-"`
}

func NewCapabilityType

func NewCapabilityType(context *tosca.Context) *CapabilityType

func (*CapabilityType) GetParent

func (self *CapabilityType) GetParent() tosca.EntityPtr

tosca.Hierarchical interface

func (*CapabilityType) Inherit

func (self *CapabilityType) Inherit()

tosca.Inherits interface

type CapabilityTypes

type CapabilityTypes []*CapabilityType

type ConditionClause

type ConditionClause struct {
	*Entity `name:"condition clause"`
}

func NewConditionClause

func NewConditionClause(context *tosca.Context) *ConditionClause

type ConditionClauses

type ConditionClauses []*ConditionClause

type ConstraintClause

type ConstraintClause struct {
	*Entity `name:"constraint clause"`

	Operator              string
	Arguments             ard.List
	NativeArgumentIndexes []uint
	DataType              *DataType `traverse:"ignore" json:"-" yaml:"-"`
}

func NewConstraintClause

func NewConstraintClause(context *tosca.Context) *ConstraintClause

func (*ConstraintClause) IsNativeArgument

func (self *ConstraintClause) IsNativeArgument(index uint) bool

func (*ConstraintClause) ToFunctionCall

func (self *ConstraintClause) ToFunctionCall(context *tosca.Context, strict bool) *tosca.FunctionCall

type ConstraintClauses

type ConstraintClauses []*ConstraintClause

func (ConstraintClauses) Append

func (self ConstraintClauses) Append(constraints ConstraintClauses) ConstraintClauses

func (ConstraintClauses) Normalize

func (self ConstraintClauses) Normalize(context *tosca.Context) normal.FunctionCalls

func (ConstraintClauses) NormalizeConstrainable

func (self ConstraintClauses) NormalizeConstrainable(context *tosca.Context, normalConstrainable normal.Constrainable)

func (ConstraintClauses) NormalizeListEntries

func (self ConstraintClauses) NormalizeListEntries(context *tosca.Context, normalList *normal.List)

func (ConstraintClauses) NormalizeMapKeys

func (self ConstraintClauses) NormalizeMapKeys(context *tosca.Context, normalMap *normal.Map)

func (ConstraintClauses) NormalizeMapValues

func (self ConstraintClauses) NormalizeMapValues(context *tosca.Context, normalMap *normal.Map)

func (ConstraintClauses) Render

func (self ConstraintClauses) Render(dataType *DataType)

type DataType

type DataType struct {
	*Type `name:"data type"`

	PropertyDefinitions PropertyDefinitions `read:"properties,PropertyDefinition" inherit:"properties,Parent"`
	ConstraintClauses   ConstraintClauses   `read:"constraints,[]ConstraintClause"`
	KeySchema           *Schema             `read:"key_schema,Schema"`   // introduced in TOSCA 1.3
	EntrySchema         *Schema             `read:"entry_schema,Schema"` // introduced in TOSCA 1.3

	Parent *DataType `lookup:"derived_from,ParentName" json:"-" yaml:"-"`
}

func GetDataType

func GetDataType(context *tosca.Context, name string) (*DataType, bool)

func NewDataType

func NewDataType(context *tosca.Context) *DataType

func (*DataType) Complete

func (self *DataType) Complete(context *tosca.Context)

Note that this may change the data (if it's a map), but that should be fine, because we intend for the data to be complete. For the same reason, this action is idempotent (subsequent calls to the same data will not have an effect).

func (*DataType) GetInternal

func (self *DataType) GetInternal() (ard.TypeName, ard.TypeValidator, tosca.Reader, bool)

func (*DataType) GetInternalTypeName

func (self *DataType) GetInternalTypeName() (ard.TypeName, bool)

func (*DataType) GetParent

func (self *DataType) GetParent() tosca.EntityPtr

tosca.Hierarchical interface

func (*DataType) GetTypeInformation

func (self *DataType) GetTypeInformation() *normal.TypeInformation

func (*DataType) Inherit

func (self *DataType) Inherit()

tosca.Inherits interface

func (*DataType) Render

func (self *DataType) Render()

parser.Renderable interface

type DataTypes

type DataTypes []*DataType

type Entity

type Entity struct {
	Context *tosca.Context `traverse:"ignore" json:"-" yaml:"-"`
}

func NewEntity

func NewEntity(context *tosca.Context) *Entity

func (*Entity) GetContext

func (self *Entity) GetContext() *tosca.Context

tosca.Contextual interface

type EventFilter

type EventFilter struct {
	*Entity `name:"event filter" json:"-" yaml:"-"`

	NodeTemplateNameOrTypeName *string `read:"node"`
	RequirementName            *string `read:"requirement"`
	CapabilityName             *string `read:"capability"`

	NodeTemplate *NodeTemplate `lookup:"node,NodeTemplateNameOrTypeName" json:"-" yaml:"-"`
	NodeType     *NodeType     `lookup:"node,NodeTemplateNameOrTypeName" json:"-" yaml:"-"`
}

func NewEventFilter

func NewEventFilter(context *tosca.Context) *EventFilter

type Group

type Group struct {
	*Entity `name:"group"`
	Name    string `namespace:""`

	GroupTypeName           *string              `read:"type" require:""`
	Metadata                Metadata             `read:"metadata,Metadata"` // introduced in TOSCA 1.1
	Description             *string              `read:"description"`
	Properties              Values               `read:"properties,Value"`
	Interfaces              InterfaceAssignments // removed in TOSCA 1.3
	MemberNodeTemplateNames *[]string            `read:"members"`

	GroupType           *GroupType      `lookup:"type,GroupTypeName" json:"-" yaml:"-"`
	MemberNodeTemplates []*NodeTemplate `lookup:"members,MemberNodeTemplateNames" json:"-" yaml:"-"`
}

func NewGroup

func NewGroup(context *tosca.Context) *Group

func (*Group) Normalize

func (self *Group) Normalize(normalServiceTemplate *normal.ServiceTemplate) *normal.Group

func (*Group) Render

func (self *Group) Render()

parser.Renderable interface

type GroupType

type GroupType struct {
	*Type `name:"group type"`

	PropertyDefinitions    PropertyDefinitions    `read:"properties,PropertyDefinition" inherit:"properties,Parent"`
	CapabilityDefinitions  CapabilityDefinitions  `read:"capabilities,CapabilityDefinition" inherit:"capabilities,Parent"`
	RequirementDefinitions RequirementDefinitions `read:"requirements,{}RequirementDefinition" inherit:"requirements,Parent"` // sequenced list, but we read it into map
	InterfaceDefinitions   InterfaceDefinitions   `inherit:"interfaces,Parent"`                                               // removed in TOSCA 1.3
	MemberNodeTypeNames    *[]string              `read:"members" inherit:"members,Parent"`

	Parent          *GroupType `lookup:"derived_from,ParentName" inherit:"members,Parent" json:"-" yaml:"-"`
	MemberNodeTypes NodeTypes  `lookup:"members,MemberNodeTypeNames" inherit:"members,Parent" json:"-" yaml:"-"`
}

func NewGroupType

func NewGroupType(context *tosca.Context) *GroupType

func (*GroupType) GetParent

func (self *GroupType) GetParent() tosca.EntityPtr

tosca.Hierarchical interface

func (*GroupType) Inherit

func (self *GroupType) Inherit()

tosca.Inherits interface

func (*GroupType) Render

func (self *GroupType) Render()

parser.Renderable interface

type GroupTypes

type GroupTypes []*GroupType

func (GroupTypes) IsCompatible

func (self GroupTypes) IsCompatible(groupType *GroupType) bool

func (GroupTypes) ValidateSubset

func (self GroupTypes) ValidateSubset(subset GroupTypes, context *tosca.Context) bool

type Groups

type Groups []*Group

func (Groups) Normalize

func (self Groups) Normalize(normalServiceTemplate *normal.ServiceTemplate)

type HasComparer

type HasComparer interface {
	SetComparer(comparer string)
}

type Import

type Import struct {
	*Entity `name:"import" json:"-" yaml:"-"`

	URL            *string `read:"url" require:""` // renamed in TOSCA 2.0
	RepositoryName *string `read:"repository"`
	Namespace      *string `read:"namespace"` // renamed in TOSCA 2.0
	NamespaceURI   *string /// removed in TOSCA 2.0

	Repository *Repository `lookup:"repository,RepositoryName" json:"-" yaml:"-"`
}

func NewImport

func NewImport(context *tosca.Context) *Import

func (*Import) NewImportSpec

func (self *Import) NewImportSpec(unit *Unit) (*tosca.ImportSpec, bool)

type Imports

type Imports []*Import

type InterfaceAssignment

type InterfaceAssignment struct {
	*Entity `name:"interface" json:"-" yaml:"-"`
	Name    string

	Inputs        Values                  `read:"inputs,Value"`
	Operations    OperationAssignments    `read:"operations,OperationAssignment"`       // keyword since TOSCA 1.3
	Notifications NotificationAssignments `read:"notifications,NotificationAssignment"` // introduced in TOSCA 1.3
}

func NewInterfaceAssignment

func NewInterfaceAssignment(context *tosca.Context) *InterfaceAssignment

func (*InterfaceAssignment) GetDefinitionForGroup

func (self *InterfaceAssignment) GetDefinitionForGroup(group *Group) (*InterfaceDefinition, bool)

func (*InterfaceAssignment) GetDefinitionForNodeTemplate

func (self *InterfaceAssignment) GetDefinitionForNodeTemplate(nodeTemplate *NodeTemplate) (*InterfaceDefinition, bool)

func (*InterfaceAssignment) GetDefinitionForRelationship

func (self *InterfaceAssignment) GetDefinitionForRelationship(relationship *RelationshipAssignment, relationshipDefinition *RelationshipDefinition) (*InterfaceDefinition, bool)

func (*InterfaceAssignment) GetKey

func (self *InterfaceAssignment) GetKey() string

tosca.Mappable interface

func (*InterfaceAssignment) Normalize

func (self *InterfaceAssignment) Normalize(normalInterface *normal.Interface, definition *InterfaceDefinition)

func (*InterfaceAssignment) RenderForGroup added in v0.18.0

func (self *InterfaceAssignment) RenderForGroup(definition *InterfaceDefinition)

func (*InterfaceAssignment) RenderForNodeTemplate added in v0.18.0

func (self *InterfaceAssignment) RenderForNodeTemplate(nodeTemplate *NodeTemplate, definition *InterfaceDefinition)

func (*InterfaceAssignment) RenderForRelationship added in v0.18.0

func (self *InterfaceAssignment) RenderForRelationship(relationship *RelationshipAssignment, definition *InterfaceDefinition)

type InterfaceAssignments

type InterfaceAssignments map[string]*InterfaceAssignment

func (InterfaceAssignments) CopyUnassigned

func (self InterfaceAssignments) CopyUnassigned(assignments InterfaceAssignments)

func (InterfaceAssignments) NormalizeForGroup

func (self InterfaceAssignments) NormalizeForGroup(group *Group, normalGroup *normal.Group)

func (InterfaceAssignments) NormalizeForNodeTemplate

func (self InterfaceAssignments) NormalizeForNodeTemplate(nodeTemplate *NodeTemplate, normalNodeTemplate *normal.NodeTemplate)

func (InterfaceAssignments) NormalizeForRelationship

func (self InterfaceAssignments) NormalizeForRelationship(relationship *RelationshipAssignment, relationshipDefinition *RelationshipDefinition, normalRelationship *normal.Relationship)

func (InterfaceAssignments) RenderForGroup added in v0.18.0

func (self InterfaceAssignments) RenderForGroup(definitions InterfaceDefinitions, context *tosca.Context)

func (InterfaceAssignments) RenderForNodeTemplate added in v0.18.0

func (self InterfaceAssignments) RenderForNodeTemplate(nodeTemplate *NodeTemplate, definitions InterfaceDefinitions, context *tosca.Context)

func (InterfaceAssignments) RenderForRelationship added in v0.18.0

func (self InterfaceAssignments) RenderForRelationship(relationship *RelationshipAssignment, definitions InterfaceDefinitions, context *tosca.Context)

type InterfaceDefinition

type InterfaceDefinition struct {
	*Entity `name:"interface definition" json:"-" yaml:"-"`
	Name    string

	InterfaceTypeName       *string                 `read:"type"` // required only if cannot be inherited
	InputDefinitions        PropertyDefinitions     `read:"inputs,PropertyDefinition" inherit:"inputs,InterfaceType"`
	OperationDefinitions    OperationDefinitions    `read:"operations,OperationDefinition" inherit:"operations,InterfaceType"`          // keyword since TOSCA 1.3
	NotificationDefinitions NotificationDefinitions `read:"notifications,NotificationDefinition" inherit:"notifications,InterfaceType"` // introduced in TOSCA 1.3

	InterfaceType *InterfaceType `lookup:"type,InterfaceTypeName" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewInterfaceDefinition

func NewInterfaceDefinition(context *tosca.Context) *InterfaceDefinition

func (*InterfaceDefinition) GetKey

func (self *InterfaceDefinition) GetKey() string

tosca.Mappable interface

func (*InterfaceDefinition) Inherit

func (self *InterfaceDefinition) Inherit(parentDefinition *InterfaceDefinition)

func (*InterfaceDefinition) Render

func (self *InterfaceDefinition) Render()

parser.Renderable interface

type InterfaceDefinitions

type InterfaceDefinitions map[string]*InterfaceDefinition

func (InterfaceDefinitions) Inherit

func (self InterfaceDefinitions) Inherit(parentDefinitions InterfaceDefinitions)

type InterfaceImplementation

type InterfaceImplementation struct {
	*Entity `name:"interface implementation"`

	Primary       *string   `read:"primary"`
	Dependencies  *[]string `read:"dependencies"`
	Timeout       *int64    `read:"timeout"`        // introduced in TOSCA 1.2
	OperationHost *string   `read:"operation_host"` // introduced in TOSCA 1.2
}

func NewInterfaceImplementation

func NewInterfaceImplementation(context *tosca.Context) *InterfaceImplementation

func (*InterfaceImplementation) NormalizeNotification

func (self *InterfaceImplementation) NormalizeNotification(normalNotification *normal.Notification)

func (*InterfaceImplementation) NormalizeOperation

func (self *InterfaceImplementation) NormalizeOperation(normalOperation *normal.Operation)

func (*InterfaceImplementation) Render

func (self *InterfaceImplementation) Render(definition *InterfaceImplementation)

type InterfaceMapping

type InterfaceMapping struct {
	*Entity `name:"interface mapping"`
	Name    string

	NodeTemplateName *string
	InterfaceName    *string

	NodeTemplate *NodeTemplate        `traverse:"ignore" json:"-" yaml:"-"`
	Interface    *InterfaceAssignment `traverse:"ignore" json:"-" yaml:"-"`
}

func NewInterfaceMapping

func NewInterfaceMapping(context *tosca.Context) *InterfaceMapping

func (*InterfaceMapping) GetInterfaceDefinition added in v0.18.0

func (self *InterfaceMapping) GetInterfaceDefinition() (*InterfaceDefinition, bool)

func (*InterfaceMapping) GetKey added in v0.18.0

func (self *InterfaceMapping) GetKey() string

tosca.Mappable interface

func (*InterfaceMapping) Render

func (self *InterfaceMapping) Render()

parser.Renderable interface

type InterfaceMappings

type InterfaceMappings map[string]*InterfaceMapping

type InterfaceType

type InterfaceType struct {
	*Type `name:"interface type"`

	InputDefinitions        PropertyDefinitions     `read:"inputs,PropertyDefinition" inherit:"inputs,Parent"`
	OperationDefinitions    OperationDefinitions    `read:"operations,OperationDefinition" inherit:"operations,Parent"`
	NotificationDefinitions NotificationDefinitions `read:"notifications,NotificationDefinition" inherit:"notifications,Parent"` // introduced in TOSCA 1.3

	Parent *InterfaceType `lookup:"derived_from,ParentName" json:"-" yaml:"-"`
}

func NewInterfaceType

func NewInterfaceType(context *tosca.Context) *InterfaceType

func (*InterfaceType) GetParent

func (self *InterfaceType) GetParent() tosca.EntityPtr

tosca.Hierarchical interface

func (*InterfaceType) Inherit

func (self *InterfaceType) Inherit()

tosca.Inherits interface

type InterfaceTypes

type InterfaceTypes []*InterfaceType

type Metadata

type Metadata map[string]string

type NodeFilter

type NodeFilter struct {
	*Entity `name:"node filter"`

	PropertyFilters   PropertyFilters   `read:"properties,PropertyFilter"`
	CapabilityFilters CapabilityFilters `read:"capabilities,{}CapabilityFilter"`
}

func NewNodeFilter

func NewNodeFilter(context *tosca.Context) *NodeFilter

func (*NodeFilter) Normalize

func (self *NodeFilter) Normalize(normalRequirement *normal.Requirement)

type NodeTemplate

type NodeTemplate struct {
	*Entity `name:"node template"`
	Name    string `namespace:""`

	Directives                   *[]string              `read:"directives"`
	CopyNodeTemplateName         *string                `read:"copy"`
	NodeTypeName                 *string                `read:"type" require:""`
	Metadata                     Metadata               `read:"metadata,Metadata"` // introduced in TOSCA 1.1
	Description                  *string                `read:"description"`
	Properties                   Values                 `read:"properties,Value"`
	Attributes                   Values                 `read:"attributes,AttributeValue"`
	Capabilities                 CapabilityAssignments  `read:"capabilities,CapabilityAssignment"`
	Requirements                 RequirementAssignments `read:"requirements,{}RequirementAssignment"`
	RequirementTargetsNodeFilter *NodeFilter            `read:"node_filter,NodeFilter"`
	Interfaces                   InterfaceAssignments   `read:"interfaces,InterfaceAssignment"`
	Artifacts                    Artifacts              `read:"artifacts,Artifact"`

	CopyNodeTemplate *NodeTemplate `lookup:"copy,CopyNodeTemplateName" json:"-" yaml:"-"`
	NodeType         *NodeType     `lookup:"type,NodeTypeName" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewNodeTemplate

func NewNodeTemplate(context *tosca.Context) *NodeTemplate

func (*NodeTemplate) Normalize

func (self *NodeTemplate) Normalize(normalServiceTemplate *normal.ServiceTemplate) *normal.NodeTemplate

func (*NodeTemplate) PreRead

func (self *NodeTemplate) PreRead()

tosca.PreReadable interface

func (*NodeTemplate) Render

func (self *NodeTemplate) Render()

parser.Renderable interface

type NodeTemplates

type NodeTemplates []*NodeTemplate

func (NodeTemplates) Normalize

func (self NodeTemplates) Normalize(normalServiceTemplate *normal.ServiceTemplate)

type NodeType

type NodeType struct {
	*Type `name:"node type"`

	PropertyDefinitions    PropertyDefinitions    `read:"properties,PropertyDefinition" inherit:"properties,Parent"`
	AttributeDefinitions   AttributeDefinitions   `read:"attributes,AttributeDefinition" inherit:"attributes,Parent"`
	CapabilityDefinitions  CapabilityDefinitions  `read:"capabilities,CapabilityDefinition" inherit:"capabilities,Parent"`
	RequirementDefinitions RequirementDefinitions `read:"requirements,{}RequirementDefinition" inherit:"requirements,Parent"` // sequenced list, but we read it into map
	InterfaceDefinitions   InterfaceDefinitions   `read:"interfaces,InterfaceDefinition" inherit:"interfaces,Parent"`
	ArtifactDefinitions    ArtifactDefinitions    `read:"artifacts,ArtifactDefinition" inherit:"artifacts,Parent"`

	Parent *NodeType `lookup:"derived_from,ParentName" json:"-" yaml:"-"`
}

func NewNodeType

func NewNodeType(context *tosca.Context) *NodeType

func (*NodeType) GetParent

func (self *NodeType) GetParent() tosca.EntityPtr

tosca.Hierarchical interface

func (*NodeType) Inherit

func (self *NodeType) Inherit()

tosca.Inherits interface

type NodeTypes

type NodeTypes []*NodeType

func (NodeTypes) IsCompatible

func (self NodeTypes) IsCompatible(nodeType *NodeType) bool

func (NodeTypes) ValidateSubset

func (self NodeTypes) ValidateSubset(subset NodeTypes, context *tosca.Context) bool

type NotificationAssignment

type NotificationAssignment struct {
	*Entity `name:"notification"`
	Name    string

	Description    *string                  `read:"description"`
	Implementation *InterfaceImplementation `read:"implementation,InterfaceImplementation"`
	Outputs        OutputMappings           `read:"outputs,OutputMapping"`
}

func NewNotificationAssignment

func NewNotificationAssignment(context *tosca.Context) *NotificationAssignment

func (*NotificationAssignment) GetKey

func (self *NotificationAssignment) GetKey() string

tosca.Mappable interface

func (*NotificationAssignment) Normalize

func (self *NotificationAssignment) Normalize(normalInterface *normal.Interface) *normal.Notification

type NotificationAssignments

type NotificationAssignments map[string]*NotificationAssignment

func (NotificationAssignments) CopyUnassigned

func (self NotificationAssignments) CopyUnassigned(assignments NotificationAssignments)

func (NotificationAssignments) Normalize

func (self NotificationAssignments) Normalize(normalInterface *normal.Interface)

func (NotificationAssignments) RenderForGroup added in v0.18.0

func (self NotificationAssignments) RenderForGroup(definitions NotificationDefinitions, context *tosca.Context)

func (NotificationAssignments) RenderForNodeTemplate added in v0.18.0

func (self NotificationAssignments) RenderForNodeTemplate(nodeTemplate *NodeTemplate, definitions NotificationDefinitions, context *tosca.Context)

func (NotificationAssignments) RenderForRelationship added in v0.18.0

func (self NotificationAssignments) RenderForRelationship(relationship *RelationshipAssignment, definitions NotificationDefinitions, context *tosca.Context)

type NotificationDefinition

type NotificationDefinition struct {
	*Entity `name:"notification definition"`
	Name    string

	Description    *string                  `read:"description"`
	Implementation *InterfaceImplementation `read:"implementation,InterfaceImplementation"`
	Outputs        OutputMappings           `read:"outputs,OutputMapping"`
}

func NewNotificationDefinition

func NewNotificationDefinition(context *tosca.Context) *NotificationDefinition

func (*NotificationDefinition) GetKey

func (self *NotificationDefinition) GetKey() string

tosca.Mappable interface

func (*NotificationDefinition) Inherit

func (self *NotificationDefinition) Inherit(parentDefinition *NotificationDefinition)

type NotificationDefinitions

type NotificationDefinitions map[string]*NotificationDefinition

func (NotificationDefinitions) Inherit

func (self NotificationDefinitions) Inherit(parentDefinitions NotificationDefinitions)

type OperationAssignment

type OperationAssignment struct {
	*Entity `name:"operation"`
	Name    string

	Description    *string                  `read:"description"`
	Implementation *InterfaceImplementation `read:"implementation,InterfaceImplementation"`
	Inputs         Values                   `read:"inputs,Value"`
	Outputs        OutputMappings           `read:"outputs,OutputMapping"` // introduced in TOSCA 1.3
}

func NewOperationAssignment

func NewOperationAssignment(context *tosca.Context) *OperationAssignment

func (*OperationAssignment) GetKey

func (self *OperationAssignment) GetKey() string

tosca.Mappable interface

func (*OperationAssignment) Normalize

func (self *OperationAssignment) Normalize(normalInterface *normal.Interface) *normal.Operation

type OperationAssignments

type OperationAssignments map[string]*OperationAssignment

func (OperationAssignments) CopyUnassigned

func (self OperationAssignments) CopyUnassigned(assignments OperationAssignments)

func (OperationAssignments) Normalize

func (self OperationAssignments) Normalize(normalInterface *normal.Interface)

func (OperationAssignments) Render

func (self OperationAssignments) Render(definitions OperationDefinitions, context *tosca.Context)

type OperationDefinition

type OperationDefinition struct {
	*Entity `name:"operation definition"`
	Name    string

	Description      *string                  `read:"description"`
	Implementation   *InterfaceImplementation `read:"implementation,InterfaceImplementation"`
	InputDefinitions PropertyDefinitions      `read:"inputs,PropertyDefinition"`
	Outputs          OutputMappings           `read:"outputs,OutputMapping"` // introduced in TOSCA 1.3
}

func NewOperationDefinition

func NewOperationDefinition(context *tosca.Context) *OperationDefinition

func (*OperationDefinition) GetKey

func (self *OperationDefinition) GetKey() string

tosca.Mappable interface

func (*OperationDefinition) Inherit

func (self *OperationDefinition) Inherit(parentDefinition *OperationDefinition)

func (*OperationDefinition) Normalize

func (self *OperationDefinition) Normalize(normalOperation *normal.Operation)

type OperationDefinitions

type OperationDefinitions map[string]*OperationDefinition

func (OperationDefinitions) Inherit

func (self OperationDefinitions) Inherit(parentDefinitions OperationDefinitions)

type OutputMapping added in v0.16.0

type OutputMapping struct {
	*Entity `name:"output mapping"`
	Name    string

	EntityName    *string
	AttributeName *string

	NodeTemplate *NodeTemplate           `traverse:"ignore" json:"-" yaml:"-"`
	Relationship *RelationshipAssignment `traverse:"ignore" json:"-" yaml:"-"`
}

func NewOutputMapping added in v0.16.0

func NewOutputMapping(context *tosca.Context) *OutputMapping

func (*OutputMapping) GetKey added in v0.16.0

func (self *OutputMapping) GetKey() string

tosca.Mappable interface

func (*OutputMapping) NormalizeForGroup added in v0.18.0

func (self *OutputMapping) NormalizeForGroup(normalServiceTemplate *normal.ServiceTemplate, normalOutputs normal.Mappings)

func (*OutputMapping) NormalizeForNodeTemplate added in v0.18.0

func (self *OutputMapping) NormalizeForNodeTemplate(normalServiceTemplate *normal.ServiceTemplate, normalOutputs normal.Mappings)

func (*OutputMapping) NormalizeForRelationship added in v0.18.0

func (self *OutputMapping) NormalizeForRelationship(normalRelationship *normal.Relationship, normalOutputs normal.Mappings)

func (*OutputMapping) RenderForGroup added in v0.18.0

func (self *OutputMapping) RenderForGroup()

func (*OutputMapping) RenderForNodeTemplate added in v0.18.0

func (self *OutputMapping) RenderForNodeTemplate(nodeTemplate *NodeTemplate)

func (*OutputMapping) RenderForRelationship added in v0.18.0

func (self *OutputMapping) RenderForRelationship(relationship *RelationshipAssignment)

type OutputMappings added in v0.16.0

type OutputMappings map[string]*OutputMapping

func (OutputMappings) CopyUnassigned added in v0.16.0

func (self OutputMappings) CopyUnassigned(outputMappings OutputMappings)

func (OutputMappings) Inherit added in v0.16.0

func (self OutputMappings) Inherit(parent OutputMappings)

func (OutputMappings) NormalizeForGroup added in v0.18.0

func (self OutputMappings) NormalizeForGroup(normalServiceTemplate *normal.ServiceTemplate, normalOutputs normal.Mappings)

func (OutputMappings) NormalizeForNodeTemplate added in v0.18.0

func (self OutputMappings) NormalizeForNodeTemplate(normalServiceTemplate *normal.ServiceTemplate, normalOutputs normal.Mappings)

func (OutputMappings) NormalizeForRelationship added in v0.18.0

func (self OutputMappings) NormalizeForRelationship(normalRelationship *normal.Relationship, normalOutputs normal.Mappings)

func (OutputMappings) RenderForGroup added in v0.18.0

func (self OutputMappings) RenderForGroup()

func (OutputMappings) RenderForNodeTemplate added in v0.18.0

func (self OutputMappings) RenderForNodeTemplate(nodeTemplate *NodeTemplate)

func (OutputMappings) RenderForRelationship added in v0.18.0

func (self OutputMappings) RenderForRelationship(relationship *RelationshipAssignment)

type ParameterDefinition

type ParameterDefinition struct {
	*PropertyDefinition `name:"parameter definition"`

	Value *Value `read:"value,Value"`
}

func NewParameterDefinition

func NewParameterDefinition(context *tosca.Context) *ParameterDefinition

func (*ParameterDefinition) Normalize

func (self *ParameterDefinition) Normalize(context *tosca.Context) normal.Constrainable

func (*ParameterDefinition) Render

func (self *ParameterDefinition) Render(kind string, mapped []string)

type ParameterDefinitions

type ParameterDefinitions map[string]*ParameterDefinition

func (ParameterDefinitions) Normalize

func (self ParameterDefinitions) Normalize(c normal.Constrainables, context *tosca.Context)

func (ParameterDefinitions) Render

func (self ParameterDefinitions) Render(kind string, mapped []string, context *tosca.Context)

type Policies

type Policies []*Policy

func (Policies) Normalize

func (self Policies) Normalize(normalServiceTemplate *normal.ServiceTemplate)

type Policy

type Policy struct {
	*Entity `name:"policy"`
	Name    string `namespace:""`

	PolicyTypeName                 *string            `read:"type" require:""`
	Metadata                       Metadata           `read:"metadata,Metadata"` // introduced in TOSCA 1.1
	Description                    *string            `read:"description"`
	Properties                     Values             `read:"properties,Value"`
	TargetNodeTemplateOrGroupNames *[]string          `read:"targets"`
	TriggerDefinitions             TriggerDefinitions `read:"triggers,TriggerDefinition" inherit:"triggers,PolicyType"` // introduced in TOSCA 1.1

	PolicyType          *PolicyType   `lookup:"type,PolicyTypeName" json:"-" yaml:"-"`
	TargetNodeTemplates NodeTemplates `lookup:"targets,TargetNodeTemplateOrGroupNames" json:"-" yaml:"-"`
	TargetGroups        Groups        `lookup:"targets,TargetNodeTemplateOrGroupNames" json:"-" yaml:"-"`
}

func NewPolicy

func NewPolicy(context *tosca.Context) *Policy

func (*Policy) GetKey

func (self *Policy) GetKey() string

tosca.Mappable interface

func (*Policy) Normalize

func (self *Policy) Normalize(normalServiceTemplate *normal.ServiceTemplate) *normal.Policy

func (*Policy) Render

func (self *Policy) Render()

parser.Renderable interface

type PolicyType

type PolicyType struct {
	*Type `name:"policy type"`

	PropertyDefinitions            PropertyDefinitions `read:"properties,PropertyDefinition" inherit:"properties,Parent"`
	TargetNodeTypeOrGroupTypeNames *[]string           `read:"targets" inherit:"targets,Parent"`
	TriggerDefinitions             TriggerDefinitions  `read:"triggers,TriggerDefinition" inherit:"triggers,Parent"` // introduced in TOSCA 1.1

	Parent           *PolicyType `lookup:"derived_from,ParentName" json:"-" yaml:"-"`
	TargetNodeTypes  NodeTypes   `lookup:"targets,TargetNodeTypeOrGroupTypeNames" inherit:"targets,Parent" json:"-" yaml:"-"`
	TargetGroupTypes GroupTypes  `lookup:"targets,TargetNodeTypeOrGroupTypeNames" inherit:"targets,Parent" json:"-" yaml:"-"`
}

func NewPolicyType

func NewPolicyType(context *tosca.Context) *PolicyType

func (*PolicyType) GetParent

func (self *PolicyType) GetParent() tosca.EntityPtr

tosca.Hierarchical interface

func (*PolicyType) Inherit

func (self *PolicyType) Inherit()

tosca.Inherits interface

func (*PolicyType) Render

func (self *PolicyType) Render()

parser.Renderable interface

type PolicyTypes

type PolicyTypes []*PolicyType

type PropertyDefinition

type PropertyDefinition struct {
	*AttributeDefinition `name:"property definition"`

	Required          *bool             `read:"required"`
	ConstraintClauses ConstraintClauses `read:"constraints,[]ConstraintClause"`
}

func NewPropertyDefinition

func NewPropertyDefinition(context *tosca.Context) *PropertyDefinition

func (*PropertyDefinition) Inherit

func (self *PropertyDefinition) Inherit(parentDefinition *PropertyDefinition)

func (*PropertyDefinition) IsRequired

func (self *PropertyDefinition) IsRequired() bool

func (*PropertyDefinition) Render

func (self *PropertyDefinition) Render()

parser.Renderable interface

type PropertyDefinitions

type PropertyDefinitions map[string]*PropertyDefinition

func (PropertyDefinitions) Inherit

func (self PropertyDefinitions) Inherit(parentDefinitions PropertyDefinitions)

type PropertyFilter

type PropertyFilter struct {
	*Entity `name:"property filter"`
	Name    string

	ConstraintClauses ConstraintClauses
}

func NewPropertyFilter

func NewPropertyFilter(context *tosca.Context) *PropertyFilter

func (*PropertyFilter) GetKey

func (self *PropertyFilter) GetKey() string

tosca.Mappable interface

func (*PropertyFilter) Normalize

func (self *PropertyFilter) Normalize(normalFunctionCallMap normal.FunctionCallMap) normal.FunctionCalls

type PropertyFilters

type PropertyFilters map[string]*PropertyFilter

func (PropertyFilters) Normalize

func (self PropertyFilters) Normalize(normalFunctionCallMap normal.FunctionCallMap)

type PropertyMapping

type PropertyMapping struct {
	*Entity `name:"property mapping"`
	Name    string

	InputName        *string
	NodeTemplateName *string // deprecated in TOSCA 1.3
	PropertyName     *string // deprecated in TOSCA 1.3

	InputDefinition *ParameterDefinition `traverse:"ignore" json:"-" yaml:"-"`
	NodeTemplate    *NodeTemplate        `traverse:"ignore" json:"-" yaml:"-"`
	Property        *Value               `traverse:"ignore" json:"-" yaml:"-"`
}

func NewPropertyMapping

func NewPropertyMapping(context *tosca.Context) *PropertyMapping

func (*PropertyMapping) GetKey added in v0.18.0

func (self *PropertyMapping) GetKey() string

tosca.Mappable interface

func (*PropertyMapping) Render

func (self *PropertyMapping) Render(inputDefinitions ParameterDefinitions)

type PropertyMappings

type PropertyMappings map[string]*PropertyMapping

func (PropertyMappings) Render added in v0.18.0

func (self PropertyMappings) Render(inputDefinitions ParameterDefinitions)

type Range

type Range struct {
	Lower uint64 `json:"lower" yaml:"lower"`
	Upper uint64 `json:"upper" yaml:"upper"`
}

func (*Range) InRange

func (self *Range) InRange(number uint64) bool

type RangeEntity

type RangeEntity struct {
	*Entity `name:"range"`

	Range *Range `traverse:"ignore"`
}

func NewRangeEntity

func NewRangeEntity(context *tosca.Context) *RangeEntity

type RelationshipAssignment

type RelationshipAssignment struct {
	*Entity `name:"relationship"`

	RelationshipTemplateNameOrTypeName *string              `read:"type"`
	Properties                         Values               `read:"properties,Value"`
	Attributes                         Values               `read:"attributes,AttributeValue"` // missing in spec
	Interfaces                         InterfaceAssignments `read:"interfaces,InterfaceAssignment"`

	RelationshipTemplate *RelationshipTemplate `lookup:"type,RelationshipTemplateNameOrTypeName" json:"-" yaml:"-"`
	RelationshipType     *RelationshipType     `lookup:"type,RelationshipTemplateNameOrTypeName" json:"-" yaml:"-"`
}

func NewRelationshipAssignment

func NewRelationshipAssignment(context *tosca.Context) *RelationshipAssignment

func (*RelationshipAssignment) GetType

func (*RelationshipAssignment) Normalize

func (self *RelationshipAssignment) Normalize(definition *RelationshipDefinition, normalRelationship *normal.Relationship)

func (*RelationshipAssignment) Render

func (self *RelationshipAssignment) Render(definition *RelationshipDefinition)

type RelationshipDefinition

type RelationshipDefinition struct {
	*Entity `name:"relationship definition"`

	RelationshipTypeName *string              `read:"type"` // required only if cannot be inherited
	InterfaceDefinitions InterfaceDefinitions `read:"interfaces,InterfaceDefinition" inherit:"interfaces,RelationshipType"`

	RelationshipType *RelationshipType `lookup:"type,RelationshipTypeName" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewRelationshipDefinition

func NewRelationshipDefinition(context *tosca.Context) *RelationshipDefinition

func (*RelationshipDefinition) Inherit

func (self *RelationshipDefinition) Inherit(parentDefinition *RelationshipDefinition)

func (*RelationshipDefinition) NewDefaultAssignment

func (self *RelationshipDefinition) NewDefaultAssignment(context *tosca.Context) *RelationshipAssignment

func (*RelationshipDefinition) Render

func (self *RelationshipDefinition) Render()

parser.Renderable interface

type RelationshipTemplate

type RelationshipTemplate struct {
	*Entity `name:"relationship template"`
	Name    string `namespace:""`

	CopyRelationshipTemplateName *string              `read:"copy"`
	RelationshipTypeName         *string              `read:"type" require:""`
	Metadata                     Metadata             `read:"metadata,Metadata"` // introduced in TOSCA 1.1
	Description                  *string              `read:"description"`
	Properties                   Values               `read:"properties,Value"`
	Attributes                   Values               `read:"attributes,AttributeValue"`
	Interfaces                   InterfaceAssignments `read:"interfaces,InterfaceAssignment"`

	CopyRelationshipTemplate *RelationshipTemplate `lookup:"copy,CopyRelationshipTemplateName" json:"-" yaml:"-"`
	RelationshipType         *RelationshipType     `lookup:"type,RelationshipTypeName" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewRelationshipTemplate

func NewRelationshipTemplate(context *tosca.Context) *RelationshipTemplate

func (*RelationshipTemplate) Normalize added in v0.16.0

func (self *RelationshipTemplate) Normalize(normalRelationship *normal.Relationship)

func (*RelationshipTemplate) PreRead

func (self *RelationshipTemplate) PreRead()

tosca.PreReadable interface

func (*RelationshipTemplate) Render

func (self *RelationshipTemplate) Render()

parser.Renderable interface

type RelationshipTemplates

type RelationshipTemplates []*RelationshipTemplate

type RelationshipType

type RelationshipType struct {
	*Type `name:"relationship type"`

	PropertyDefinitions            PropertyDefinitions  `read:"properties,PropertyDefinition" inherit:"properties,Parent"`
	AttributeDefinitions           AttributeDefinitions `read:"attributes,AttributeDefinition" inherit:"attributes,Parent"`
	InterfaceDefinitions           InterfaceDefinitions `read:"interfaces,InterfaceDefinition" inherit:"interfaces,Parent"`
	ValidTargetCapabilityTypeNames *[]string            `read:"valid_target_types" inherit:"valid_target_types,Parent"`

	Parent                     *RelationshipType `lookup:"derived_from,ParentName" json:"-" yaml:"-"`
	ValidTargetCapabilityTypes CapabilityTypes   `lookup:"valid_target_types,ValidTargetCapabilityTypeNames" inherit:"valid_target_types,Parent" json:"-" yaml:"-"`
}

func NewRelationshipType

func NewRelationshipType(context *tosca.Context) *RelationshipType

func (*RelationshipType) GetParent

func (self *RelationshipType) GetParent() tosca.EntityPtr

tosca.Hierarchical interface

func (*RelationshipType) Inherit

func (self *RelationshipType) Inherit()

tosca.Inherits interface

type RelationshipTypes

type RelationshipTypes []*RelationshipType

type Repositories

type Repositories []*Repository

type Repository

type Repository struct {
	*Entity `name:"repository"`
	Name    string `namespace:""`

	Description *string `read:"description"`
	URL         *string `read:"url" require:""`
	Credential  *Value  `read:"credential,Value"` // tosca:Credential
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(context *tosca.Context) *Repository

func (*Repository) GetURL

func (self *Repository) GetURL() urlpkg.URL

func (*Repository) Render

func (self *Repository) Render()

parser.Renderable interface

type RequirementAssignment

type RequirementAssignment struct {
	*Entity `name:"requirement"`
	Name    string

	TargetCapabilityNameOrTypeName   *string                 `read:"capability"`
	TargetNodeTemplateNameOrTypeName *string                 `read:"node"`
	TargetNodeFilter                 *NodeFilter             `read:"node_filter,NodeFilter"`
	Relationship                     *RelationshipAssignment `read:"relationship,RelationshipAssignment"`
	Occurrences                      *RangeEntity            `read:"occurrences,RangeEntity"` // introduced in TOSCA 1.3

	TargetCapabilityType *CapabilityType `lookup:"capability,?TargetCapabilityNameOrTypeName" json:"-" yaml:"-"`
	TargetNodeTemplate   *NodeTemplate   `lookup:"node,TargetNodeTemplateNameOrTypeName" json:"-" yaml:"-"`
	TargetNodeType       *NodeType       `lookup:"node,TargetNodeTemplateNameOrTypeName" json:"-" yaml:"-"`
}

func NewDefaultRequirementAssignment

func NewDefaultRequirementAssignment(index int, definition *RequirementDefinition, context *tosca.Context) *RequirementAssignment

func NewRequirementAssignment

func NewRequirementAssignment(context *tosca.Context) *RequirementAssignment

func (*RequirementAssignment) GetDefinition

func (self *RequirementAssignment) GetDefinition(nodeTemplate *NodeTemplate) (*RequirementDefinition, bool)

func (*RequirementAssignment) Normalize

func (self *RequirementAssignment) Normalize(nodeTemplate *NodeTemplate, normalNodeTemplate *normal.NodeTemplate) *normal.Requirement

type RequirementAssignments

type RequirementAssignments []*RequirementAssignment

func (RequirementAssignments) Normalize

func (self RequirementAssignments) Normalize(nodeTemplate *NodeTemplate, normalNodeTemplate *normal.NodeTemplate)

func (*RequirementAssignments) Render

func (self *RequirementAssignments) Render(definitions RequirementDefinitions, context *tosca.Context)

type RequirementDefinition

type RequirementDefinition struct {
	*Entity `name:"requirement definition"`
	Name    string

	TargetCapabilityTypeName *string                 `read:"capability"` // required only if cannot be inherited
	TargetNodeTypeName       *string                 `read:"node"`
	RelationshipDefinition   *RelationshipDefinition `read:"relationship,RelationshipDefinition"`
	Occurrences              *RangeEntity            `read:"occurrences,RangeEntity"`

	TargetCapabilityType *CapabilityType `lookup:"capability,TargetCapabilityTypeName" json:"-" yaml:"-"`
	TargetNodeType       *NodeType       `lookup:"node,TargetNodeTypeName" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewRequirementDefinition

func NewRequirementDefinition(context *tosca.Context) *RequirementDefinition

func (*RequirementDefinition) GetKey

func (self *RequirementDefinition) GetKey() string

tosca.Mappable interface

func (*RequirementDefinition) Inherit

func (self *RequirementDefinition) Inherit(parentDefinition *RequirementDefinition)

func (RequirementDefinition) Render

func (self RequirementDefinition) Render()

parser.Renderable interface

type RequirementDefinitions

type RequirementDefinitions map[string]*RequirementDefinition

func (RequirementDefinitions) Inherit

func (self RequirementDefinitions) Inherit(parentDefinitions RequirementDefinitions)

type RequirementMapping

type RequirementMapping struct {
	*Entity `name:"requirement mapping"`
	Name    string

	NodeTemplateName *string
	RequirementName  *string

	NodeTemplate *NodeTemplate          `traverse:"ignore" json:"-" yaml:"-"`
	Requirement  *RequirementAssignment `traverse:"ignore" json:"-" yaml:"-"`
}

func NewRequirementMapping

func NewRequirementMapping(context *tosca.Context) *RequirementMapping

func (*RequirementMapping) GetKey added in v0.18.0

func (self *RequirementMapping) GetKey() string

tosca.Mappable interface

func (*RequirementMapping) GetRequirementDefinition added in v0.18.0

func (self *RequirementMapping) GetRequirementDefinition() (*RequirementDefinition, bool)

func (*RequirementMapping) Render

func (self *RequirementMapping) Render()

parser.Renderable interface

type RequirementMappings

type RequirementMappings map[string]*RequirementMapping

type ScalarUnit

type ScalarUnit struct {
	CanonicalString string      `json:"$string" yaml:"$string"`
	CanonicalNumber interface{} `json:"$number" yaml:"$number"` // float64 or uint64
	OriginalString  string      `json:"$originalString" yaml:"$originalString"`

	Scalar float64 `json:"scalar" yaml:"scalar"`
	Unit   string  `json:"unit" yaml:"unit"`
	// contains filtered or unexported fields
}

func ReadScalarUnit

func ReadScalarUnit(context *tosca.Context, name string, canonicalUnit string, canonicalUnitSingular string, canonicalUnitPlural string, re *regexp.Regexp, measures ScalarUnitMeasures, countable bool, caseSensitive bool) *ScalarUnit

func (*ScalarUnit) Compare

func (self *ScalarUnit) Compare(data interface{}) (int, error)

func (*ScalarUnit) String

func (self *ScalarUnit) String() string

fmt.Stringer interface

type ScalarUnitMeasures

type ScalarUnitMeasures map[string]float64

func (ScalarUnitMeasures) Get

func (self ScalarUnitMeasures) Get(unit string, caseSensitive bool) (string, float64)

type Schema

type Schema struct {
	*Entity `name:"schema"`

	DataTypeName      *string           `read:"type" require:""`
	Description       *string           `read:"description"`
	ConstraintClauses ConstraintClauses `read:"constraints,[]ConstraintClause"`

	DataType *DataType `lookup:"type,DataTypeName" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewSchema

func NewSchema(context *tosca.Context) *Schema

func (*Schema) GetConstraints

func (self *Schema) GetConstraints() ConstraintClauses

func (*Schema) LookupDataType

func (self *Schema) LookupDataType() bool

func (*Schema) Render

func (self *Schema) Render()

parser.Renderable interface

type ServiceTemplate

type ServiceTemplate struct {
	*Unit `name:"service template"`

	TopologyTemplate *TopologyTemplate `read:"topology_template,TopologyTemplate"`
}

func NewServiceTemplate

func NewServiceTemplate(context *tosca.Context) *ServiceTemplate

func (*ServiceTemplate) NormalizeServiceTemplate

func (self *ServiceTemplate) NormalizeServiceTemplate() *normal.ServiceTemplate

normal.Normalizable interface

type SubstitutionMappings

type SubstitutionMappings struct {
	*Entity `name:"substitution mappings"`

	NodeTypeName        *string             `read:"node_type" require:""`
	CapabilityMappings  CapabilityMappings  `read:"capabilities,CapabilityMapping"`
	RequirementMappings RequirementMappings `read:"requirements,RequirementMapping"`
	PropertyMappings    PropertyMappings    `read:"properties,PropertyMapping"`     // introduced in TOSCA 1.2
	AttributeMappings   AttributeMappings   `read:"attributes,AttributeMapping"`    // introduced in TOSCA 1.3
	InterfaceMappings   InterfaceMappings   `read:"interfaces,InterfaceMapping"`    // introduced in TOSCA 1.2
	SubstitutionFilter  NodeFilter          `read:"substitution_filter,NodeFilter"` // introduced in TOSCA 1.3

	NodeType *NodeType `lookup:"node_type,NodeTypeName" json:"-" yaml:"-"`
}

func NewSubstitutionMappings

func NewSubstitutionMappings(context *tosca.Context) *SubstitutionMappings

func (*SubstitutionMappings) IsRequirementMapped

func (self *SubstitutionMappings) IsRequirementMapped(nodeTemplate *NodeTemplate, requirementName string) bool

func (*SubstitutionMappings) Normalize

func (self *SubstitutionMappings) Normalize(normalServiceTemplate *normal.ServiceTemplate) *normal.Substitution

func (*SubstitutionMappings) Render added in v0.18.0

func (self *SubstitutionMappings) Render(inputDefinitions ParameterDefinitions)

type Timestamp

type Timestamp struct {
	CanonicalNumber int64  `json:"$number" yaml:"$number"`
	CanonicalString string `json:"$string" yaml:"$string"`
	OriginalString  string `json:"$originalString" yaml:"$originalString"`

	Year     uint32  `json:"year" yaml:"year"`
	Month    uint32  `json:"month" yaml:"month"`
	Day      uint32  `json:"day" yaml:"day"`
	Hour     uint32  `json:"hour" yaml:"hour"`
	Minute   uint32  `json:"minute" yaml:"minute"`
	Second   uint32  `json:"second" yaml:"second"`
	Fraction float64 `json:"fraction" yaml:"fraction"`
	TZSign   string  `json:"tzSign" yaml:"tzSign"`
	TZHour   uint32  `json:"tzHour" yaml:"tzHour"`
	TZMinute uint32  `json:"tzMinute" yaml:"tzMinute"`
}

func (*Timestamp) Compare

func (self *Timestamp) Compare(data interface{}) (int, error)

func (*Timestamp) Location

func (self *Timestamp) Location() *time.Location

Convert timezone to Go time.Location

func (*Timestamp) String

func (self *Timestamp) String() string

fmt.Stringer interface

func (*Timestamp) Time

func (self *Timestamp) Time() time.Time

Convert to Go time.Time

type TopologyTemplate

type TopologyTemplate struct {
	*Entity `name:"topology template"`

	Description           *string               `read:"description"`
	NodeTemplates         NodeTemplates         `read:"node_templates,NodeTemplate"`
	RelationshipTemplates RelationshipTemplates `read:"relationship_templates,RelationshipTemplate"`
	Groups                Groups                `read:"groups,Group"`
	Policies              Policies              `read:"policies,<>Policy"`
	InputDefinitions      ParameterDefinitions  `read:"inputs,ParameterDefinition"`
	OutputDefinitions     ParameterDefinitions  `read:"outputs,ParameterDefinition"`
	WorkflowDefinitions   WorkflowDefinitions   `read:"workflows,WorkflowDefinition"`
	SubstitutionMappings  *SubstitutionMappings `read:"substitution_mappings,SubstitutionMappings"`
}

func NewTopologyTemplate

func NewTopologyTemplate(context *tosca.Context) *TopologyTemplate

func (*TopologyTemplate) GetNodeTemplatesOfType

func (self *TopologyTemplate) GetNodeTemplatesOfType(nodeType *NodeType) []*NodeTemplate

func (*TopologyTemplate) Normalize

func (self *TopologyTemplate) Normalize(normalServiceTemplate *normal.ServiceTemplate)

func (*TopologyTemplate) Render

func (self *TopologyTemplate) Render()

parser.Renderable interface

func (*TopologyTemplate) SetInputs

func (self *TopologyTemplate) SetInputs(inputs map[string]ard.Value)

parser.HasInputs interface

type TriggerDefinition

type TriggerDefinition struct {
	*Entity `name:"trigger definition" json:"-" yaml:"-"`
	Name    string

	Description  *string                     `read:"description"`
	Event        *string                     `read:"event" require:""`
	Schedule     *Value                      `read:"schedule,Value"` // tosca:TimeInterval
	TargetFilter *EventFilter                `read:"target_filter,EventFilter"`
	Condition    *TriggerDefinitionCondition `read:"condition,TriggerDefinitionCondition"`
	Action       WorkflowActivityDefinitions `read:"action,[]WorkflowActivityDefinition" require:""`
}

func NewTriggerDefinition

func NewTriggerDefinition(context *tosca.Context) *TriggerDefinition

func (*TriggerDefinition) GetKey

func (self *TriggerDefinition) GetKey() string

tosca.Mappable interface

func (*TriggerDefinition) Normalize

func (self *TriggerDefinition) Normalize(normalPolicy *normal.Policy) *normal.PolicyTrigger

func (*TriggerDefinition) Render

func (self *TriggerDefinition) Render()

parser.Renderable interface

type TriggerDefinitionCondition

type TriggerDefinitionCondition struct {
	*Entity `name:"trigger definition condition" json:"-" yaml:"-"`

	ConstraintClauses ConstraintClauses `read:"constraint,[]ConstraintClause"` // this should be "constraints"...
	Period            *ScalarUnit       `read:"period,scalar-unit.time"`
	Evaluations       *int              `read:"evaluations"`
	Method            *string           `read:"method"`
}

func NewTriggerDefinitionCondition

func NewTriggerDefinitionCondition(context *tosca.Context) *TriggerDefinitionCondition

type TriggerDefinitions

type TriggerDefinitions map[string]*TriggerDefinition

func (TriggerDefinitions) Normalize

func (self TriggerDefinitions) Normalize(normalPolicy *normal.Policy)

type Type

type Type struct {
	*Entity `json:"-" yaml:"-"`
	Name    string `namespace:""`

	ParentName  *string  `read:"derived_from"`
	Version     *Version `read:"version,version"`
	Metadata    Metadata `read:"metadata,!Metadata"`
	Description *string  `read:"description"`
	// contains filtered or unexported fields
}

func NewType

func NewType(context *tosca.Context) *Type

func (*Type) GetDescription

func (self *Type) GetDescription() (string, bool)

tosca.HasMetadata interface

func (*Type) GetMetadata

func (self *Type) GetMetadata() (map[string]string, bool)

tosca.HasMetadata interface

func (*Type) GetMetadataValue

func (self *Type) GetMetadataValue(key string) (string, bool)

func (*Type) SetMetadata

func (self *Type) SetMetadata(name string, value string) bool

tosca.HasMetadata interface

type Unit

type Unit struct {
	*Entity `name:"unit"`

	ToscaDefinitionsVersion *string           `read:"tosca_definitions_version" require:""`
	Profile                 *string           `read:"profile"` // introduced in TOSCA 1.2 as "namespace", renamed in TOSCA 2.0
	Metadata                Metadata          `read:"metadata,!Metadata"`
	Description             *string           `read:"description"`
	Repositories            Repositories      `read:"repositories,Repository"`
	Imports                 Imports           `read:"imports,[]Import"`
	ArtifactTypes           ArtifactTypes     `read:"artifact_types,ArtifactType" hierarchy:""`
	CapabilityTypes         CapabilityTypes   `read:"capability_types,CapabilityType" hierarchy:""`
	DataTypes               DataTypes         `read:"data_types,DataType" hierarchy:""`
	GroupTypes              GroupTypes        `read:"group_types,GroupType" hierarchy:""`
	InterfaceTypes          InterfaceTypes    `read:"interface_types,InterfaceType" hierarchy:""`
	NodeTypes               NodeTypes         `read:"node_types,NodeType" hierarchy:""`
	PolicyTypes             PolicyTypes       `read:"policy_types,PolicyType" hierarchy:""`
	RelationshipTypes       RelationshipTypes `read:"relationship_types,RelationshipType" hierarchy:""`
}

func NewUnit

func NewUnit(context *tosca.Context) *Unit

func (*Unit) GetImportSpecs

func (self *Unit) GetImportSpecs() []*tosca.ImportSpec

parser.Importer interface

func (*Unit) Normalize

func (self *Unit) Normalize(normalServiceTemplate *normal.ServiceTemplate)

type Value

type Value struct {
	*Entity `name:"value"`
	Name    string

	ConstraintClauses ConstraintClauses
	Description       *string

	DataType    *DataType           `traverse:"ignore" json:"-" yaml:"-"`
	Information *normal.Information `traverse:"ignore" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewValue

func NewValue(context *tosca.Context) *Value

func ReadAndRenderBareAttribute

func ReadAndRenderBareAttribute(context *tosca.Context, dataType *DataType) *Value

func (*Value) GetKey

func (self *Value) GetKey() string

tosca.Mappable interface

func (*Value) Normalize

func (self *Value) Normalize() normal.Constrainable

func (*Value) RenderAttribute

func (self *Value) RenderAttribute(dataType *DataType, definition *AttributeDefinition, bare bool, allowNil bool)

func (*Value) RenderDataType

func (self *Value) RenderDataType(dataTypeName string)

func (*Value) RenderProperty

func (self *Value) RenderProperty(dataType *DataType, definition *PropertyDefinition)

func (*Value) String added in v0.16.0

func (self *Value) String() string

fmt.Stringer interface

type ValueList

type ValueList struct {
	EntryConstraints ConstraintClauses
	Slice            []interface{}
}

func NewValueList

func NewValueList(definition *AttributeDefinition, length int, entryConstraints ConstraintClauses) *ValueList

func (*ValueList) Normalize

func (self *ValueList) Normalize(context *tosca.Context) *normal.List

func (*ValueList) Set

func (self *ValueList) Set(index int, value interface{})

type ValueMap

type ValueMap struct {
	KeyConstraints   ConstraintClauses
	ValueConstraints ConstraintClauses
	Map              ard.Map
}

func NewValueMap

func NewValueMap(definition *AttributeDefinition, keyConstraints ConstraintClauses, valueConstraints ConstraintClauses) *ValueMap

func (*ValueMap) Normalize

func (self *ValueMap) Normalize(context *tosca.Context) *normal.Map

func (*ValueMap) Put

func (self *ValueMap) Put(key interface{}, value interface{})

type Values

type Values map[string]*Value

func (Values) CopyUnassigned

func (self Values) CopyUnassigned(values Values)

func (Values) Normalize

func (self Values) Normalize(normalConstrainables normal.Constrainables)

func (Values) RenderAttributes

func (self Values) RenderAttributes(definitions AttributeDefinitions, context *tosca.Context)

func (Values) RenderMissingValue

func (self Values) RenderMissingValue(definition *AttributeDefinition, kind string, required bool, context *tosca.Context)

func (Values) RenderProperties

func (self Values) RenderProperties(definitions PropertyDefinitions, kind string, context *tosca.Context)

type Version

type Version struct {
	CanonicalString string `json:"$string" yaml:"$string"`
	OriginalString  string `json:"$originalString" yaml:"$originalString"`
	Comparer        string `json:"$comparer" yaml:"$comparer"`

	Major     uint32 `json:"major" yaml:"major"`
	Minor     uint32 `json:"minor" yaml:"minor"`
	Fix       uint32 `json:"fix" yaml:"fix"`
	Qualifier string `json:"qualifier" yaml:"qualifier"`
	Build     uint32 `json:"build" yaml:"build"`
}

func (*Version) Compare

func (self *Version) Compare(data interface{}) (int, error)

func (*Version) SetComparer

func (self *Version) SetComparer(comparer string)

HasComparer interface

func (*Version) String

func (self *Version) String() string

fmt.Stringer interface

type WorkflowActivityCallOperation

type WorkflowActivityCallOperation struct {
	*Entity `name:"workflow activity call operation"`
	Name    string

	CallOperationSpec *string

	CallInterface *InterfaceAssignment `json:"-" yaml:"-"`
	CallOperation *OperationAssignment `json:"-" yaml:"-"`
}

func NewWorkflowActivityCallOperation

func NewWorkflowActivityCallOperation(context *tosca.Context) *WorkflowActivityCallOperation

func (*WorkflowActivityCallOperation) Render

func (self *WorkflowActivityCallOperation) Render(stepDefinition *WorkflowStepDefinition)

type WorkflowActivityDefinition

type WorkflowActivityDefinition struct {
	*Entity `name:"workflow activity definition"`

	DelegateWorkflowDefinitionName *string
	InlineWorkflowDefinitionName   *string
	SetNodeState                   *string
	CallOperationSpec              *string

	DelegateWorkflowDefinition *WorkflowDefinition  `lookup:"delegate,DelegateWorkflowDefinitionName" json:"-" yaml:"-"`
	InlineWorkflowDefinition   *WorkflowDefinition  `lookup:"inline,InlineWorkflowDefinitionName" json:"-" yaml:"-"`
	CallInterface              *InterfaceAssignment `json:"-" yaml:"-"`
	CallOperation              *OperationAssignment `json:"-" yaml:"-"`
}

func NewWorkflowActivityDefinition

func NewWorkflowActivityDefinition(context *tosca.Context) *WorkflowActivityDefinition

func (*WorkflowActivityDefinition) Normalize

func (self *WorkflowActivityDefinition) Normalize(normalWorkflowStep *normal.WorkflowStep) *normal.WorkflowActivity

func (*WorkflowActivityDefinition) Render

func (self *WorkflowActivityDefinition) Render(stepDefinition *WorkflowStepDefinition)

type WorkflowActivityDefinitions

type WorkflowActivityDefinitions []*WorkflowActivityDefinition

type WorkflowDefinition

type WorkflowDefinition struct {
	*Entity `name:"workflow definition"`
	Name    string `namespace:""`

	Metadata                Metadata                        `read:"metadata,Metadata"`
	Description             *string                         `read:"description"`
	InputDefinitions        PropertyDefinitions             `read:"inputs,PropertyDefinition"`
	PreconditionDefinitions WorkflowPreconditionDefinitions `read:"preconditions,WorkflowPreconditionDefinition"`
	StepDefinitions         WorkflowStepDefinitions         `read:"steps,WorkflowStepDefinition"`
}

func NewWorkflowDefinition

func NewWorkflowDefinition(context *tosca.Context) *WorkflowDefinition

func (*WorkflowDefinition) GetKey

func (self *WorkflowDefinition) GetKey() string

tosca.Mappable interface

func (*WorkflowDefinition) Normalize

func (self *WorkflowDefinition) Normalize(normalServiceTemplate *normal.ServiceTemplate) *normal.Workflow

func (*WorkflowDefinition) Render

func (self *WorkflowDefinition) Render()

parser.Renderable interface

type WorkflowDefinitions

type WorkflowDefinitions map[string]*WorkflowDefinition

func (WorkflowDefinitions) Normalize

func (self WorkflowDefinitions) Normalize(normalServiceTemplate *normal.ServiceTemplate)

type WorkflowPreconditionDefinition

type WorkflowPreconditionDefinition struct {
	*Entity `name:"workflow precondition definition"`

	TargetNodeTemplateOrGroupName *string          `read:"target" require:""`
	TargetNodeRequirementName     *string          `read:"target_relationship"`
	ConditionClauses              ConditionClauses `read:"condition,[]ConditionClause"`

	TargetNodeTemplate *NodeTemplate `lookup:"target,TargetNodeTemplateOrGroupName" json:"-" yaml:"-"`
	TargetGroup        *Group        `lookup:"target,TargetNodeTemplateOrGroupName" json:"-" yaml:"-"`
}

func NewWorkflowPreconditionDefinition

func NewWorkflowPreconditionDefinition(context *tosca.Context) *WorkflowPreconditionDefinition

type WorkflowPreconditionDefinitions

type WorkflowPreconditionDefinitions []*WorkflowPreconditionDefinition

type WorkflowStepDefinition

type WorkflowStepDefinition struct {
	*Entity `name:"workflow step definition"`
	Name    string

	TargetNodeTemplateOrGroupName *string                     `read:"target" require:""`
	TargetNodeRequirementName     *string                     `read:"target_relationship"`
	OperationHost                 *string                     `read:"operation_host"`
	FilterConditionClauses        ConditionClauses            `read:"filter,[]ConditionClause"` // spec is wrong, says constraint clause
	ActivityDefinitions           WorkflowActivityDefinitions `read:"activities,[]WorkflowActivityDefinition" require:""`
	OnSuccessStepNames            *[]string                   `read:"on_success"`
	OnFailureStepNames            *[]string                   `read:"on_failure"`

	TargetNodeTemplate *NodeTemplate             `lookup:"target,TargetNodeTemplateOrGroupName" json:"-" yaml:"-"`
	TargetGroup        *Group                    `lookup:"target,TargetNodeTemplateOrGroupName" json:"-" yaml:"-"`
	OnSuccessSteps     []*WorkflowStepDefinition // custom lookup
	OnFailureSteps     []*WorkflowStepDefinition // custom lookup
}

func NewWorkflowStepDefinition

func NewWorkflowStepDefinition(context *tosca.Context) *WorkflowStepDefinition

func (*WorkflowStepDefinition) GetKey

func (self *WorkflowStepDefinition) GetKey() string

tosca.Mappable interface

func (*WorkflowStepDefinition) Normalize

func (self *WorkflowStepDefinition) Normalize(normalWorkflow *normal.Workflow) *normal.WorkflowStep

func (*WorkflowStepDefinition) NormalizeNext

func (self *WorkflowStepDefinition) NormalizeNext(normalWorkflowStep *normal.WorkflowStep, normalWorkflow *normal.Workflow)

func (*WorkflowStepDefinition) Render

func (self *WorkflowStepDefinition) Render(definitions WorkflowStepDefinitions)

type WorkflowStepDefinitions

type WorkflowStepDefinitions map[string]*WorkflowStepDefinition

func (WorkflowStepDefinitions) Normalize

func (self WorkflowStepDefinitions) Normalize(normalWorkflow *normal.Workflow)

func (WorkflowStepDefinitions) Render

func (self WorkflowStepDefinitions) Render()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL