Documentation ¶
Index ¶
- Constants
- func IsBuiltinType(typeName string) bool
- func IsCustomNodeStateError(err error) (bool, string)
- func IsOperator(op string) bool
- type Activity
- type ArtifactDefMap
- type ArtifactDefinition
- type ArtifactType
- type AttributeDefinition
- type CapReqMapping
- type CapabilityAssignment
- type CapabilityDefinition
- type CapabilityType
- type Credential
- type DataType
- type EntrySchema
- type Function
- type Implementation
- type ImportDefinition
- type Input
- type InterfaceDefinition
- type LiteralOperand
- type NodeState
- type NodeTemplate
- type NodeType
- type Operand
- type OperationDefinition
- type Operator
- type ParameterDefinition
- type PropAttrMapping
- type PropertyDefinition
- type Range
- type RelationshipType
- type Repository
- type RequirementAssignment
- type RequirementAssignmentMap
- type RequirementDefinition
- type RequirementDefinitionMap
- type RequirementRelationship
- type Step
- type SubstitutionMapping
- type Topology
- type TopologyTemplate
- type Type
- type ValueAssignment
- func (p ValueAssignment) GetFunction() *Function
- func (p ValueAssignment) GetList() []interface{}
- func (p ValueAssignment) GetLiteral() string
- func (p ValueAssignment) GetMap() map[interface{}]interface{}
- func (p *ValueAssignment) MarshalJSON() ([]byte, error)
- func (p ValueAssignment) String() string
- func (p *ValueAssignment) UnmarshalJSON(b []byte) error
- func (p *ValueAssignment) UnmarshalYAML(unmarshal func(interface{}) error) error
- type ValueAssignmentType
- type Workflow
Constants ¶
const ( // EndpointCapability is the default TOSCA type that should be used or // extended to define a network endpoint capability. EndpointCapability = "tosca.capabilities.Endpoint" // PublicEndpointCapability represents a public endpoint. PublicEndpointCapability = "tosca.capabilities.Endpoint.Public" )
const ( // TemplateName is the optional descriptive name for the template provided // in the template metadata TemplateName = "template_name" // TemplateVersion is the optional version for the template provided in the // template metadata TemplateVersion = "template_version" // TemplateAuthor is the optional declaration of the author of the template // provided in the template metadata TemplateAuthor = "template_author" )
const RunnableCancelOperationName = RunnableInterfaceName + ".cancel"
RunnableCancelOperationName is the fully qualified name of the Cancel operation
const RunnableInterfaceName = "tosca.interfaces.node.lifecycle.runnable"
RunnableInterfaceName is the fully qualified name of the Runnable interface
const RunnableRunOperationName = RunnableInterfaceName + ".run"
RunnableRunOperationName is the fully qualified name of the Run operation
const RunnableSubmitOperationName = RunnableInterfaceName + ".submit"
RunnableSubmitOperationName is the fully qualified name of the Submit operation
const UNBOUNDED uint64 = 18446744073709551615
UNBOUNDED is the maximum value of a Range Max uint64 as per https://golang.org/ref/spec#Numeric_types
Variables ¶
This section is empty.
Functions ¶
func IsBuiltinType ¶
IsBuiltinType checks if a given type name corresponds to a TOSCA builtin type.
Known builtin types:
- string
- integer
- float
- boolean
- timestamp
- null
- list
- map
- version
- range
- scalar-unit.size
- scalar-unit.time
func IsCustomNodeStateError ¶
IsCustomNodeStateError checks if the given error is due to a conversion of an non-normative state and if so returns this state as string
func IsOperator ¶
IsOperator checks if a given token is a known TOSCA function keyword
Types ¶
type Activity ¶
type Activity struct { SetState string `yaml:"set_state,omitempty" json:"set_state,omitempty"` Delegate string `yaml:"delegate,omitempty" json:"delegate,omitempty"` CallOperation string `yaml:"call_operation,omitempty" json:"call_operation,omitempty"` Inline string `yaml:"inline,omitempty" json:"inline,omitempty"` }
An Activity is the representation of a TOSCA Workflow Step Activity
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_WORKFLOW_ACTIVITY_DEFN for more details
type ArtifactDefMap ¶
type ArtifactDefMap map[string]ArtifactDefinition
ArtifactDefMap is a map of ArtifactDefinition
func (*ArtifactDefMap) UnmarshalYAML ¶
func (adm *ArtifactDefMap) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into an ArtifactDefMap
type ArtifactDefinition ¶
type ArtifactDefinition struct { Type string `yaml:"type,omitempty"` File string `yaml:"file,omitempty"` Description string `yaml:"description,omitempty"` Repository string `yaml:"repository,omitempty"` DeployPath string `yaml:"deploy_path,omitempty"` // contains filtered or unexported fields }
An ArtifactDefinition is the representation of a TOSCA Artifact Definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_ARTIFACT_DEF for more details
func (*ArtifactDefinition) UnmarshalYAML ¶
func (a *ArtifactDefinition) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into an ArtifactDefinition
type ArtifactType ¶
type ArtifactType struct { Type `yaml:",inline"` MimeType string `yaml:"mime_type,omitempty"` FileExt []string `yaml:"file_ext,omitempty"` Properties map[string]PropertyDefinition `yaml:"properties,omitempty"` }
An ArtifactType is the representation of a TOSCA Artifact Type
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_ARTIFACT_TYPE for more details
type AttributeDefinition ¶
type AttributeDefinition struct { Type string `yaml:"type"` Description string `yaml:"description,omitempty"` Default *ValueAssignment `yaml:"default,omitempty"` Status string `yaml:"status,omitempty"` EntrySchema EntrySchema `yaml:"entry_schema,omitempty"` }
An AttributeDefinition is the representation of a TOSCA Attribute Definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_ATTRIBUTE_DEFN for more details
func (*AttributeDefinition) UnmarshalYAML ¶
func (r *AttributeDefinition) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into an AttributeDefinition
type CapReqMapping ¶
type CapReqMapping struct { Mapping []string `yaml:"mapping,omitempty,flow"` Properties map[string]*ValueAssignment `yaml:"properties,omitempty"` Attributes map[string]*ValueAssignment `yaml:"attributes,omitempty"` }
CapReqMapping defines a capability mapping or a requirement mapping. It accepts two grammars.
- Single-line grammar: <capability_name>: [ <node_template_name>, <node_template_capability_name> ]
- Multi-line grammar: <capability_name>: mapping: [ <node_template_name>, <node_template_capability_name> ] <capability_name>: properties: <property_name>: <property_value> attributes: <attribute_name>: <attribute_value>
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html section 3.8.9 Capability mapping and 3.8.10 Requirement mapping
func (*CapReqMapping) UnmarshalYAML ¶
func (c *CapReqMapping) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into a CapReqMapping
type CapabilityAssignment ¶
type CapabilityAssignment struct { Properties map[string]*ValueAssignment `yaml:"properties,omitempty"` Attributes map[string]*ValueAssignment `yaml:"attributes,omitempty"` }
An CapabilityAssignment is the representation of a TOSCA Capability Assignment
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/TOSCA-Simple-Profile-YAML-v1.0.html#DEFN_ELEMENT_CAPABILITY_ASSIGNMENT for more details
type CapabilityDefinition ¶
type CapabilityDefinition struct { Type string `yaml:"type"` Description string `yaml:"description,omitempty"` Properties map[string]*ValueAssignment `yaml:"properties,omitempty"` Attributes map[string]*ValueAssignment `yaml:"attributes,omitempty"` ValidSourceTypes []string `yaml:"valid_source_types,omitempty,flow"` Occurrences Range `yaml:"occurrences,omitempty"` }
An CapabilityDefinition is the representation of a TOSCA Capability Definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_CAPABILITY_DEFN for more details NOTE: Here is Alien specific difference with Tosca Specification about Properties/Attributes maps of ValueAssignment instead of maps of PropertyDefinition in Tosca spec
func (*CapabilityDefinition) UnmarshalYAML ¶
func (c *CapabilityDefinition) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into an CapabilityDefinition
type CapabilityType ¶
type CapabilityType struct { Type `yaml:",inline"` Properties map[string]PropertyDefinition `yaml:"properties,omitempty"` Attributes map[string]AttributeDefinition `yaml:"attributes,omitempty"` ValidSourceTypes []string `yaml:"valid_source_types,omitempty,flow"` }
An CapabilityType is the representation of a TOSCA Capability Type
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_CAPABILITY_TYPE for more details
type Credential ¶
type Credential struct { TokenType string `yaml:"token_type"` Token string `yaml:"token"` User string `yaml:"user,omitempty"` Protocol string `yaml:"protocol,omitempty"` Keys map[string]string `yaml:"keys,omitempty"` }
A Credential is a representation of TOSCA Credential
type DataType ¶
type DataType struct { Type `yaml:",inline"` Properties map[string]PropertyDefinition `yaml:"properties,omitempty"` }
An DataType is the representation of a TOSCA Data Type
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_DATA_TYPE for more details
type EntrySchema ¶
type EntrySchema struct { Type string `yaml:"type"` Description string `yaml:"description,omitempty"` }
An EntrySchema is the representation of a TOSCA Entry Schema
type Function ¶
Function models a TOSCA Function
A Function is composed by an Operator and a list of Operand
func (*Function) GetFunctionsByOperator ¶
GetFunctionsByOperator returns the list of functions with a given Operator type contained in this Function
Note that Functions can be nested like in a concat for instance
func (Function) IsLiteral ¶
IsLiteral allows to know if an Operand is a LiteralOperand (true) or a TOSCA Function (false)
func (*Function) UnmarshalYAML ¶
UnmarshalYAML unmarshal a yaml into a Function
type Implementation ¶
type Implementation struct { Primary string `yaml:"primary"` Dependencies []string `yaml:"dependencies,omitempty"` Artifact ArtifactDefinition `yaml:",inline"` OperationHost string `yaml:"operation_host,omitempty"` }
An Implementation is the representation of the implementation part of a TOSCA Operation Definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_OPERATION_DEF for more details
func (*Implementation) UnmarshalYAML ¶
func (i *Implementation) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into an Implementation
type ImportDefinition ¶
type ImportDefinition struct { File string `yaml:"file"` // Required Repository string `yaml:"repository,omitempty"` NamespaceURI string `yaml:"namespace_uri,omitempty"` // Deprecated NamespacePrefix string `yaml:"namespace_prefix,omitempty"` }
An ImportDefinition is the representation of a TOSCA Import Definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_IMPORT_DEF for more details
func (*ImportDefinition) UnmarshalYAML ¶
func (i *ImportDefinition) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into an ImportDefinition
type Input ¶
type Input struct { ValueAssign *ValueAssignment PropDef *PropertyDefinition }
An Input is the representation of the input part of a TOSCA Operation Definition
It could be either a Value Assignment or a Property Definition.
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_OPERATION_DEF for more details
func (*Input) UnmarshalYAML ¶
UnmarshalYAML unmarshals a yaml into an Input
type InterfaceDefinition ¶
type InterfaceDefinition struct { Type string `yaml:"type,omitempty"` Inputs map[string]Input `yaml:"inputs,omitempty"` Operations map[string]OperationDefinition `yaml:",inline,omitempty"` }
An InterfaceDefinition is the representation of a TOSCA Interface Definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_INTERFACE_DEF for more details
type LiteralOperand ¶
type LiteralOperand string
LiteralOperand represents a literal in a TOSCA function
func (LiteralOperand) IsLiteral ¶
func (l LiteralOperand) IsLiteral() bool
IsLiteral allows to know if an Operand is a LiteralOperand (true) or a TOSCA Function (false)
func (LiteralOperand) String ¶
func (l LiteralOperand) String() string
type NodeState ¶
type NodeState int
NodeState represent the state of a node instance this part is normative
We added a non-normative special step "deleted" in order to track deleted instances
const ( // NodeStateInitial is a non-transitional state indicating that the node is not yet created. Node only exists as a template definition. NodeStateInitial NodeState = iota // NodeStateCreating is a transitional state indicating that the Node is transitioning from initial state to created state. NodeStateCreating // NodeStateCreated is a non-transitional state indicating that Node software has been installed. NodeStateCreated // NodeStateConfiguring is a transitional state indicating that Node is transitioning from created state to configured state. NodeStateConfiguring // NodeStateConfigured is a non-transitional state indicating that Node has been configured prior to being started. NodeStateConfigured // NodeStateStarting is a transitional state indicating that Node is transitioning from configured state to started state. NodeStateStarting // NodeStateStarted is a non-transitional state indicating that Node is started. NodeStateStarted // NodeStateStopping is a transitional state indicating that Node is transitioning from its current state to a configured state. NodeStateStopping // NodeStateDeleting is a transitional state indicating that Node is transitioning from its current state to one where it is deleted. // // We diverge here from the specification that states "and its state is no longer tracked by the instance model". NodeStateDeleting // NodeStateError is a non-transitional state indicating that the Node is in an error state. NodeStateError // NodeStateDeleted is a non-transitional state indicating that the Node is deleted. NodeStateDeleted )
func NodeStateString ¶
NodeStateString returns the NodeState corresponding to the given string representation.
The given string is lowercased before checking it against node states representations.
type NodeTemplate ¶
type NodeTemplate struct { Type string `yaml:"type"` Description string `yaml:"description,omitempty"` Directives []string `yaml:"directives,omitempty"` Properties map[string]*ValueAssignment `yaml:"properties,omitempty"` Attributes map[string]*ValueAssignment `yaml:"attributes,omitempty"` Capabilities map[string]CapabilityAssignment `yaml:"capabilities,omitempty"` Requirements []RequirementAssignmentMap `yaml:"requirements,omitempty"` Artifacts ArtifactDefMap `yaml:"artifacts,omitempty"` Metadata map[string]string `yaml:"metadata,omitempty"` Interfaces map[string]InterfaceDefinition `yaml:"interfaces,omitempty"` }
An NodeTemplate is the representation of a TOSCA Node Template
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_NODE_TEMPLATE for more details
type NodeType ¶
type NodeType struct { Type `yaml:",inline"` Properties map[string]PropertyDefinition `yaml:"properties,omitempty"` Attributes map[string]AttributeDefinition `yaml:"attributes,omitempty"` Requirements []RequirementDefinitionMap `yaml:"requirements,omitempty,flow"` Capabilities map[string]CapabilityDefinition `yaml:"capabilities,omitempty"` Interfaces map[string]InterfaceDefinition `yaml:"interfaces,omitempty"` Artifacts ArtifactDefMap `yaml:"artifacts,omitempty"` }
An NodeType is the representation of a TOSCA Node Type
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_NODE_TYPE for more details
type Operand ¶
type Operand interface { fmt.Stringer // IsLiteral allows to know if an Operand is a LiteralOperand (true) or a TOSCA Function (false) IsLiteral() bool }
Operand represents the parameters part of a TOSCA function it could be a LiteralOperand or a Function
type OperationDefinition ¶
type OperationDefinition struct { Inputs map[string]Input `yaml:"inputs,omitempty"` Description string `yaml:"description,omitempty"` Implementation Implementation `yaml:"implementation,omitempty"` }
An OperationDefinition is the representation of a TOSCA Operation Definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_OPERATION_DEF for more details
func (*OperationDefinition) UnmarshalYAML ¶
func (i *OperationDefinition) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into an InterfaceDefinition
type Operator ¶
type Operator string
Operator is the keyword of a given TOSCA operation
const ( // GetPropertyOperator is the Operator of the get_property function GetPropertyOperator Operator = "get_property" // GetAttributeOperator is the Operator of the get_attribute function GetAttributeOperator Operator = "get_attribute" // GetInputOperator is the Operator of the get_input function GetInputOperator Operator = "get_input" // GetOperationOutputOperator is the Operator of the get_operation_output function GetOperationOutputOperator Operator = "get_operation_output" // ConcatOperator is the Operator of the concat function ConcatOperator Operator = "concat" // GetSecretOperator is the Operator of the get_secret function (non-normative) GetSecretOperator Operator = "get_secret" )
type ParameterDefinition ¶
type ParameterDefinition struct { Type string `yaml:"type"` Description string `yaml:"description,omitempty"` Required *bool `yaml:"required,omitempty"` Default *ValueAssignment `yaml:"default,omitempty"` Status string `yaml:"status,omitempty"` //Constraints []ConstraintClause `yaml:"constraints,omitempty"` EntrySchema EntrySchema `yaml:"entry_schema,omitempty"` Value *ValueAssignment `yaml:"value,omitempty"` }
An ParameterDefinition is the representation of a TOSCA Parameter Definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_PARAMETER_DEF for more details
type PropAttrMapping ¶
type PropAttrMapping struct { Mapping []string `yaml:"mapping,omitempty,flow"` Value *ValueAssignment `yaml:"value,omitempty"` }
PropAttrMapping defines a property or attribute mapping. It accepts several grammars.
- Single-line grammar: <property_name>: <property_value> or <property_name>: [ <input_name> ] or <property_name>: [ <node_template_name>, <node_template_property_name> ] or <property_name>: [ <node_template_name>, <node_template_capability_name> | <node_template_requirement_name>, <property_name> ]
- Multi-line grammar: <property_name>: mapping: [ < input_name > ] or <property_name>: mapping: [ <node_template_name>, <node_template_property_name> ] or <property_name>: mapping: [ <node_template_name>, <node_template_capability_name> | <node_template_requirement_name>, <property_name> ] or <property_name>: value: <property_value>
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html section 3.8.8 Property mapping
func (*PropAttrMapping) UnmarshalYAML ¶
func (p *PropAttrMapping) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into a PropAttrMapping
type PropertyDefinition ¶
type PropertyDefinition struct { Type string `yaml:"type"` Description string `yaml:"description,omitempty"` Required *bool `yaml:"required,omitempty"` Default *ValueAssignment `yaml:"default,omitempty"` Status string `yaml:"status,omitempty"` //Constraints []ConstraintClause `yaml:"constraints,omitempty"` EntrySchema EntrySchema `yaml:"entry_schema,omitempty"` }
An PropertyDefinition is the representation of a TOSCA Property Definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_PROPERTY_DEFN for more details
type Range ¶
An Range is the representation of a TOSCA Range Type
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#TYPE_TOSCA_RANGE for more details
func (*Range) UnmarshalYAML ¶
UnmarshalYAML unmarshals a yaml into a Range
type RelationshipType ¶
type RelationshipType struct { Type `yaml:",inline"` Properties map[string]PropertyDefinition `yaml:"properties,omitempty"` Attributes map[string]AttributeDefinition `yaml:"attributes,omitempty"` Interfaces map[string]InterfaceDefinition `yaml:"interfaces,omitempty"` Artifacts ArtifactDefMap `yaml:"artifacts,omitempty"` ValidTargetTypes []string `yaml:"valid_target_types,omitempty"` }
An RelationshipType is the representation of a TOSCA Relationship Type
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_RELATIONSHIP_TYPE for more details
type Repository ¶
type Repository struct { URL string `yaml:"url,omitempty"` Type string `yaml:"type,omitempty"` Description string `yaml:"description,omitempty"` Credit Credential `yaml:"credential,omitempty"` }
A Repository is representation of TOSCA Repository
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/csprd01/TOSCA-Simple-Profile-YAML-v1.0-csprd01.html#_Toc430015673 for more details
type RequirementAssignment ¶
type RequirementAssignment struct { Capability string `yaml:"capability"` Node string `yaml:"node,omitempty"` Relationship string `yaml:"relationship,omitempty"` RelationshipProps map[string]*ValueAssignment // Non Tosca-Standard A4C type_requirement property TypeRequirement string `yaml:"type_requirement,omitempty"` }
An RequirementAssignment is the representation of a TOSCA Requirement Assignment
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_REQUIREMENT_ASSIGNMENT for more details
func (*RequirementAssignment) UnmarshalYAML ¶
func (r *RequirementAssignment) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into an RequirementAssignment
type RequirementAssignmentMap ¶
type RequirementAssignmentMap map[string]RequirementAssignment
RequirementAssignmentMap is a map of RequirementAssignment
type RequirementDefinition ¶
type RequirementDefinition struct { Capability string `yaml:"capability"` Node string `yaml:"node,omitempty"` Relationship string `yaml:"relationship,omitempty"` Occurrences Range `yaml:"occurrences,omitempty"` // Non Tosca-Standard A4C capability_name property CapabilityName string `yaml:"capability_name,omitempty"` // contains filtered or unexported fields }
An RequirementDefinition is the representation of a TOSCA Requirement Definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_REQUIREMENT_DEF for more details
func (*RequirementDefinition) UnmarshalYAML ¶
func (a *RequirementDefinition) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into an RequirementDefinition
type RequirementDefinitionMap ¶
type RequirementDefinitionMap map[string]RequirementDefinition
RequirementDefinitionMap is a map of RequirementDefinition indexed by name
func (*RequirementDefinitionMap) UnmarshalYAML ¶
func (rdm *RequirementDefinitionMap) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into an RequirementDefinitionMap
type RequirementRelationship ¶
type RequirementRelationship struct { Type string `yaml:"type"` Properties map[string]*ValueAssignment `yaml:"properties,omitempty"` }
An RequirementRelationship is the representation of the relationship part of a TOSCA Requirement Assignment
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_REQUIREMENT_ASSIGNMENT for more details
type Step ¶
type Step struct { Target string `yaml:"target,omitempty" json:"target,omitempty"` TargetRelationShip string `yaml:"target_relationship,omitempty" json:"target_relationship,omitempty"` Activities []Activity `yaml:"activities" json:"activities"` OnSuccess []string `yaml:"on_success,omitempty" json:"on_success,omitempty"` OnFailure []string `yaml:"on_failure,omitempty" json:"on_failure,omitempty"` OperationHost string `yaml:"operation_host,omitempty" json:"operation_host,omitempty"` // Non standard OnCancel []string `yaml:"on_cancel,omitempty" json:"on_cancel,omitempty"` }
An Step is the representation of a TOSCA Workflow Step
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_WORKFLOW_STEP_DEFN for more details
type SubstitutionMapping ¶
type SubstitutionMapping struct { NodeType string `yaml:"node_type"` Properties map[string]PropAttrMapping `yaml:"properties,omitempty"` Capabilities map[string]CapReqMapping `yaml:"capabilities,omitempty"` Requirements map[string]CapReqMapping `yaml:"requirements,omitempty"` Attributes map[string]PropAttrMapping `yaml:"attributes,omitempty"` Interfaces map[string]string `yaml:"interfaces,omitempty"` }
SubstitutionMapping allows to create a node type out of a given topology template. This allows the consumption of complex systems using a simplified vision.
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html section 3.8.12 Substitution mapping
type Topology ¶
type Topology struct { TOSCAVersion string `yaml:"tosca_definitions_version"` Description string `yaml:"description,omitempty"` Metadata map[string]string `yaml:"metadata,omitempty"` Imports []ImportDefinition `yaml:"imports,omitempty"` Repositories map[string]Repository `yaml:"repositories,omitempty"` DataTypes map[string]DataType `yaml:"data_types,omitempty"` ArtifactTypes map[string]ArtifactType `yaml:"artifact_types,omitempty"` NodeTypes map[string]NodeType `yaml:"node_types,omitempty"` CapabilityTypes map[string]CapabilityType `yaml:"capability_types,omitempty"` RelationshipTypes map[string]RelationshipType `yaml:"relationship_types,omitempty"` TopologyTemplate TopologyTemplate `yaml:"topology_template"` }
An Topology is the representation of a TOSCA Service Template definition
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_SERVICE_TEMPLATE for more details
type TopologyTemplate ¶
type TopologyTemplate struct { Description string `yaml:"description,omitempty"` Inputs map[string]ParameterDefinition `yaml:"inputs,omitempty"` NodeTemplates map[string]NodeTemplate `yaml:"node_templates"` Outputs map[string]ParameterDefinition `yaml:"outputs,omitempty"` SubstitionMappings *SubstitutionMapping `yaml:"substitution_mappings,omitempty"` Workflows map[string]Workflow }
An TopologyTemplate is the representation of a TOSCA Topology Template
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_TOPOLOGY_TEMPLATE for more details
type Type ¶
type Type struct { DerivedFrom string `yaml:"derived_from,omitempty"` Version string `yaml:"version,omitempty"` Description string `yaml:"description,omitempty"` Metadata map[string]string `yaml:"metadata,omitempty"` }
Type is the base type for all TOSCA types (like node types, relationship types, ...)
type ValueAssignment ¶
type ValueAssignment struct { Type ValueAssignmentType Value interface{} }
An ValueAssignment is the representation of a TOSCA Value Assignment
See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_PROPERTY_VALUE_ASSIGNMENT and http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ELEMENT_ATTRIBUTE_VALUE_ASSIGNMENT for more details
func (ValueAssignment) GetFunction ¶
func (p ValueAssignment) GetFunction() *Function
GetFunction retruns the TOSCA Function of a this ValueAssignment
If ValueAssignment.Type is not ValueAssignmentFunction then nil is returned
func (ValueAssignment) GetList ¶
func (p ValueAssignment) GetList() []interface{}
GetList retruns the list associated with this ValueAssignment
If ValueAssignment.Type is not ValueAssignmentList then nil is returned
func (ValueAssignment) GetLiteral ¶
func (p ValueAssignment) GetLiteral() string
GetLiteral retruns the string representation of a literal value
If ValueAssignment.Type is not ValueAssignmentLiteral then an empty string is returned
func (ValueAssignment) GetMap ¶
func (p ValueAssignment) GetMap() map[interface{}]interface{}
GetMap retruns the map associated with this ValueAssignment
If ValueAssignment.Type is not ValueAssignmentMap then nil is returned
func (*ValueAssignment) MarshalJSON ¶
func (p *ValueAssignment) MarshalJSON() ([]byte, error)
MarshalJSON is marshaling only the Value field of a ValueAssignment
func (ValueAssignment) String ¶
func (p ValueAssignment) String() string
String retruns the textual representation of a ValueAssignment
func (*ValueAssignment) UnmarshalJSON ¶
func (p *ValueAssignment) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals json into a ValueAssignment
func (*ValueAssignment) UnmarshalYAML ¶
func (p *ValueAssignment) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml into a ValueAssignment
type ValueAssignmentType ¶
type ValueAssignmentType uint64
ValueAssignmentType defines the type of value for an assignment
const ( // ValueAssignmentLiteral defines an assignment of a literal ValueAssignmentLiteral ValueAssignmentType = iota // ValueAssignmentFunction defines an assignment of a TOSCA function ValueAssignmentFunction // ValueAssignmentList defines an assignment of a list ValueAssignmentList // ValueAssignmentMap defines an assignment of a map or a complex type ValueAssignmentMap )
func ValueAssignmentTypeFromString ¶
func ValueAssignmentTypeFromString(s string) (ValueAssignmentType, error)
ValueAssignmentTypeFromString converts a textual representation of a ValueAssignmentType into its value
func (ValueAssignmentType) String ¶
func (vat ValueAssignmentType) String() string