tosca

package
v4.0.7 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: Apache-2.0 Imports: 8 Imported by: 13

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	// Self is a Tosca keyword which indicates the related object is being referenced from the node itself.
	Self = "SELF"
	// Source is a Tosca keyword which indicates the related object is being referenced from the source relationship.
	Source = "SOURCE"
	// Target is a Tosca keyword which indicates the object is being referenced from the target relationship.
	Target = "TARGET"
	// Host is a Tosca keyword which indicates the object is being referenced from the host in an hostedOn relationship.
	Host = "HOST"
)
View Source
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"
)
View Source
const ComputeNodeEndpointCapabilityName = "endpoint"

ComputeNodeEndpointCapabilityName is the name of the administrator network endpoint capability of a Compute Node

View Source
const ComputeNodeNetworksAttributeName = "networks"

ComputeNodeNetworksAttributeName is the attribute name of the list of logical networks assigned to a Compute Node

See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#_Toc379455082

View Source
const ComputeNodePrivateAddressAttributeName = "private_address"

ComputeNodePrivateAddressAttributeName is the attribute name of the primary private IP address assigned to a Compute Node

See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#_Toc379455082

View Source
const ComputeNodePublicAddressAttributeName = "public_address"

ComputeNodePublicAddressAttributeName is the attribute name of the primary public IP address assigned to a Compute Node

See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#_Toc379455082

View Source
const ConfigureInterfaceName = "tosca.interfaces.relationships.configure"

ConfigureInterfaceName is the fully qualified name of the Configure interface

View Source
const ConfigureInterfaceShortName = "configure"

ConfigureInterfaceShortName is the short name of the Configure interface

View Source
const EndpointCapabilityIPAddressAttribute = "ip_address"

EndpointCapabilityIPAddressAttribute is the name of the attribute containing the ip_address or DNS name of tosca.capabilities.Endpoint

See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_TYPE_CAPABILITIES_ENDPOINT

View Source
const EndpointCapabilityPortProperty = "port"

EndpointCapabilityPortProperty is the name of the property containing the port of the endpoint

See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_TYPE_CAPABILITIES_ENDPOINT

View Source
const MetadataLocationNameKey = "location"

MetadataLocationNameKey is the node template metadata key whose value provides the name of the location where to create this node template

View Source
const NetworkAddressesProperty = "addresses"

NetworkAddressesProperty is the name of the property containing the list of IP addresses assigned from the underlying network

See https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/os/TOSCA-Simple-Profile-YAML-v1.2-os.html#TYPE_TOSCA_DATA_NETWORKINFO

View Source
const NetworkIDProperty = "network_id"

NetworkIDProperty is the name of the property containing the unique ID of a network

See https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/os/TOSCA-Simple-Profile-YAML-v1.2-os.html#TYPE_TOSCA_DATA_NETWORKINFO

View Source
const NetworkNameProperty = "network_name"

NetworkNameProperty is the name of the property containing the name of a logical network

See https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/os/TOSCA-Simple-Profile-YAML-v1.2-os.html#TYPE_TOSCA_DATA_NETWORKINFO

View Source
const RunnableCancelOperationName = RunnableInterfaceName + ".cancel"

RunnableCancelOperationName is the fully qualified name of the Cancel operation

View Source
const RunnableInterfaceName = "tosca.interfaces.node.lifecycle.runnable"

RunnableInterfaceName is the fully qualified name of the Runnable interface

View Source
const RunnableRunOperationName = RunnableInterfaceName + ".run"

RunnableRunOperationName is the fully qualified name of the Run operation

View Source
const RunnableSubmitOperationName = RunnableInterfaceName + ".submit"

RunnableSubmitOperationName is the fully qualified name of the Submit operation

View Source
const StandardInterfaceName = "tosca.interfaces.node.lifecycle.standard"

StandardInterfaceName is the fully qualified name of the Standard interface

View Source
const StandardInterfaceShortName = "standard"

StandardInterfaceShortName is the short name of the Standard interface

View Source
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

func IsBuiltinType(typeName string) bool

IsBuiltinType checks if a given type name corresponds to a TOSCA builtin type. It means either list, map or primitive type

func IsCustomNodeStateError

func IsCustomNodeStateError(err error) (bool, string)

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

func IsOperator(op string) bool

IsOperator checks if a given token is a known TOSCA function keyword

func IsPrimitiveType

func IsPrimitiveType(typeName string) bool

IsPrimitiveType checks if a given type name corresponds to a primitive type It means a data type that can'be broken down into a more simple data type. Known primitive types:

  • string
  • integer
  • float
  • boolean
  • timestamp
  • null
  • version
  • range
  • scalar-unit.size
  • scalar-unit.time
  • scalar-unit.frequency
  • scalar-unit.bitrate

Types

type Activity

type Activity struct {
	SetState      string             `yaml:"set_state,omitempty" json:"set_state,omitempty"`
	Delegate      *WorkflowActivity  `yaml:"delegate,omitempty" json:"delegate,omitempty"`
	CallOperation *OperationActivity `yaml:"call_operation,omitempty" json:"call_operation,omitempty"`
	Inline        *WorkflowActivity  `yaml:"inline,omitempty" json:"inline,omitempty"`
}

An Activity is the representation of a TOSCA Workflow Step Activity

http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/TOSCA-Simple-Profile-YAML-v1.3.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" json:"type,omitempty"`
	File        string `yaml:"file,omitempty" json:"file,omitempty"`
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	Repository  string `yaml:"repository,omitempty" json:"repository,omitempty"`
	DeployPath  string `yaml:"deploy_path,omitempty" json:"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" json:"mime_type,omitempty"`
	FileExt    []string                      `yaml:"file_ext,omitempty" json:"file_ext,omitempty"`
	Properties map[string]PropertyDefinition `yaml:"properties,omitempty" json:"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" json:"type"`
	Description string           `yaml:"description,omitempty" json:"description,omitempty"`
	Default     *ValueAssignment `yaml:"default,omitempty" json:"default,omitempty"`
	Status      string           `yaml:"status,omitempty" json:"status,omitempty"`
	EntrySchema EntrySchema      `yaml:"entry_schema,omitempty" json:"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 AttributeMapping

type AttributeMapping struct {
	Parameters []string
}

AttributeMapping is the representation of a Tosca attribute mapping Attribute mappings have the following grammar : [ <SELF | SOURCE | TARGET >, <optional_capability_name>, <attribute_name>, <nested_attribute_name_or_index_1>, ..., <nested_attribute_name_or_index_or_key_n> ]

func (*AttributeMapping) String

func (am *AttributeMapping) String() string

type CapReqMapping

type CapReqMapping struct {
	Mapping    []string                    `yaml:"mapping,omitempty,flow" json:"mapping,omitempty,flow"`
	Properties map[string]*ValueAssignment `yaml:"properties,omitempty" json:"properties,omitempty"`
	Attributes map[string]*ValueAssignment `yaml:"attributes,omitempty" json:"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" json:"properties,omitempty"`
	Attributes map[string]*ValueAssignment `yaml:"attributes,omitempty" json:"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" json:"type"`
	Description      string                      `yaml:"description,omitempty" json:"description,omitempty"`
	Properties       map[string]*ValueAssignment `yaml:"properties,omitempty" json:"properties,omitempty"`
	Attributes       map[string]*ValueAssignment `yaml:"attributes,omitempty" json:"attributes,omitempty"`
	ValidSourceTypes []string                    `yaml:"valid_source_types,omitempty,flow" json:"valid_source_types,omitempty"`
	Occurrences      Range                       `yaml:"occurrences,omitempty" json:"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" json:"properties,omitempty"`
	Attributes       map[string]AttributeDefinition `yaml:"attributes,omitempty" json:"attributes,omitempty"`
	ValidSourceTypes []string                       `yaml:"valid_source_types,omitempty,flow" json:"valid_source_types,omitempty"`
}

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" json:"token_type"`
	Token     string            `yaml:"token" json:"token"`
	User      string            `yaml:"user,omitempty" json:"user,omitempty"`
	Protocol  string            `yaml:"protocol,omitempty" json:"protocol,omitempty"`
	Keys      map[string]string `yaml:"keys,omitempty" json:"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" json:"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" json:"type"`
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
}

An EntrySchema is the representation of a TOSCA Entry Schema

type Function

type Function struct {
	Operator Operator
	Operands []Operand
}

Function models a TOSCA Function

A Function is composed by an Operator and a list of Operand

func ParseFunction

func ParseFunction(rawFunction string) (*Function, error)

ParseFunction allows to cast a string function representation in Function struct

func (*Function) GetFunctionsByOperator

func (f *Function) GetFunctionsByOperator(o Operator) []*Function

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

func (f Function) IsLiteral() bool

IsLiteral allows to know if an Operand is a LiteralOperand (true) or a TOSCA Function (false)

func (Function) String

func (f Function) String() string

func (*Function) UnmarshalYAML

func (f *Function) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshal a yaml into a Function

type Implementation

type Implementation struct {
	Primary       string             `yaml:"primary" json:"primary"`
	Dependencies  []string           `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
	Artifact      ArtifactDefinition `yaml:",inline" json:"artifact,omitempty"`
	OperationHost string             `yaml:"operation_host,omitempty" json:"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" json:"file"` // Required
	Repository      string `yaml:"repository,omitempty" json:"repository,omitempty"`
	NamespaceURI    string `yaml:"namespace_uri,omitempty" json:"namespace_uri,omitempty"` // Deprecated
	NamespacePrefix string `yaml:"namespace_prefix,omitempty" json:"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    `json:"value_assignment,omitempty"`
	PropDef     *PropertyDefinition `json:"property_definition,omitempty"`
}

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

func (i *Input) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a yaml into an Input

type InterfaceDefinition

type InterfaceDefinition struct {
	Type        string                         `yaml:"type,omitempty" json:"type,omitempty"`
	Description string                         `yaml:"description,omitempty" json:"description,omitempty"`
	Inputs      map[string]Input               `yaml:"inputs,omitempty" json:"inputs,omitempty"`
	Operations  map[string]OperationDefinition `yaml:",inline,omitempty" json:",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

func NodeStateString(s string) (NodeState, error)

NodeStateString returns the NodeState corresponding to the given string representation.

The given string is lowercased before checking it against node states representations.

func (NodeState) String

func (i NodeState) String() string

type NodeTemplate

type NodeTemplate struct {
	Type         string                          `yaml:"type" json:"type"`
	Description  string                          `yaml:"description,omitempty" json:"description,omitempty"`
	Directives   []string                        `yaml:"directives,omitempty" json:"directives,omitempty"`
	Properties   map[string]*ValueAssignment     `yaml:"properties,omitempty" json:"properties,omitempty"`
	Attributes   map[string]*ValueAssignment     `yaml:"attributes,omitempty" json:"attributes,omitempty"`
	Capabilities map[string]CapabilityAssignment `yaml:"capabilities,omitempty" json:"capabilities,omitempty"`
	Requirements []RequirementAssignmentMap      `yaml:"requirements,omitempty" json:"requirements,omitempty"`
	Artifacts    ArtifactDefMap                  `yaml:"artifacts,omitempty" json:"artifacts,omitempty"`
	Metadata     map[string]string               `yaml:"metadata,omitempty" json:"metadata,omitempty"`
	Interfaces   map[string]InterfaceDefinition  `yaml:"interfaces,omitempty" json:"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" json:"properties,omitempty"`
	Attributes   map[string]AttributeDefinition  `yaml:"attributes,omitempty" json:"attributes,omitempty"`
	Requirements []RequirementDefinitionMap      `yaml:"requirements,omitempty,flow" json:"requirements,omitempty"`
	Capabilities map[string]CapabilityDefinition `yaml:"capabilities,omitempty" json:"capabilities,omitempty"`
	Interfaces   map[string]InterfaceDefinition  `yaml:"interfaces,omitempty" json:"interfaces,omitempty"`
	Artifacts    ArtifactDefMap                  `yaml:"artifacts,omitempty" json:"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 OperationActivity

type OperationActivity struct {
	Operation string                         `yaml:"operation" json:"operation"`
	Inputs    map[string]ParameterDefinition `yaml:"inputs,omitempty" json:"inputs,omitempty"`
}

OperationActivity defines the name of an operation and optional input assignments

func (*OperationActivity) UnmarshalYAML

func (o *OperationActivity) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a yaml into a WorkflowActivity

type OperationDefinition

type OperationDefinition struct {
	Outputs        map[string]Output `yaml:"outputs,omitempty" json:"outputs,omitempty"`
	Inputs         map[string]Input  `yaml:"inputs,omitempty" json:"inputs,omitempty"`
	Description    string            `yaml:"description,omitempty" json:"description,omitempty"`
	Implementation Implementation    `yaml:"implementation,omitempty" json:"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 Output

type Output struct {
	ValueAssign      *ValueAssignment  `json:"value_assignment,omitempty"`
	AttributeMapping *AttributeMapping `json:"attribute_mapping,omitempty"`
}

An Output is the representation of the output part of a TOSCA Operation Definition

type ParameterDefinition

type ParameterDefinition struct {
	Type        string           `yaml:"type,omitempty" json:"type,omitempty"`
	Description string           `yaml:"description,omitempty" json:"description,omitempty"`
	Required    *bool            `yaml:"required,omitempty" json:"required,omitempty"`
	Default     *ValueAssignment `yaml:"default,omitempty" json:"default,omitempty"`
	Status      string           `yaml:"status,omitempty" json:"status,omitempty"`
	//Constraints []ConstraintClause `yaml:"constraints,omitempty"`
	EntrySchema EntrySchema      `yaml:"entry_schema,omitempty" json:"entry_schema,omitempty"`
	Value       *ValueAssignment `yaml:"value,omitempty" json:"value,omitempty"`
}

An ParameterDefinition is the representation of a TOSCA Parameter Definition

See https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/cos01/TOSCA-Simple-Profile-YAML-v1.3-cos01.html#DEFN_ELEMENT_PARAMETER_DEF for more details

func (*ParameterDefinition) UnmarshalYAML

func (p *ParameterDefinition) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a yaml into a ParameterDefinition

type Policy

type Policy struct {
	Type        string                      `yaml:"type" json:"type"`
	Description string                      `yaml:"description,omitempty" json:"description,omitempty"`
	Targets     []string                    `yaml:"targets,omitempty" json:"targets,omitempty"`
	Properties  map[string]*ValueAssignment `yaml:"properties,omitempty" json:"properties,omitempty"`
	Metadata    map[string]string           `yaml:"metadata,omitempty" json:"metadata,omitempty"`
}

A Policy represents a Tosca Policy definition See https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/os/TOSCA-Simple-Profile-YAML-v1.2-os.html#DEFN_ELEMENT_POLICY_DEF for the first implementation, we don't handle triggers

type PolicyMap

type PolicyMap map[string]Policy

PolicyMap is a map of Policy indexed by policy name

type PolicyType

type PolicyType struct {
	Type       `yaml:",inline"`
	Properties map[string]PropertyDefinition `yaml:"properties,omitempty" json:"properties,omitempty"`
	Targets    []string                      `yaml:"targets,omitempty,flow" json:"targets,omitempty"`
}

A PolicyType is the representation of a TOSCA Policy Type

See http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/TOSCA-Simple-Profile-YAML-v1.2.html#DEFN_ENTITY_POLICY_TYPE Triggers are not supported for more details

type PropAttrMapping

type PropAttrMapping struct {
	Mapping []string         `yaml:"mapping,omitempty,flow" json:"mapping,omitempty,flow"`
	Value   *ValueAssignment `yaml:"value,omitempty" json:"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" json:"type"`
	Description string           `yaml:"description,omitempty" json:"description,omitempty"`
	Required    *bool            `yaml:"required,omitempty" json:"required,omitempty"`
	Default     *ValueAssignment `yaml:"default,omitempty" json:"default,omitempty"`
	Status      string           `yaml:"status,omitempty" json:"status,omitempty"`
	//Constraints []ConstraintClause `yaml:"constraints,omitempty"`
	EntrySchema EntrySchema `yaml:"entry_schema,omitempty" json:"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

type Range struct {
	LowerBound uint64
	UpperBound uint64
}

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

func (r *Range) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a yaml into a Range

type RelationshipType

type RelationshipType struct {
	Type             `yaml:",inline"`
	Properties       map[string]PropertyDefinition  `yaml:"properties,omitempty" json:"properties,omitempty"`
	Attributes       map[string]AttributeDefinition `yaml:"attributes,omitempty" json:"attributes,omitempty"`
	Interfaces       map[string]InterfaceDefinition `yaml:"interfaces,omitempty" json:"interfaces,omitempty"`
	Artifacts        ArtifactDefMap                 `yaml:"artifacts,omitempty" json:"artifacts,omitempty"`
	ValidTargetTypes []string                       `yaml:"valid_target_types,omitempty" json:"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" json:"url,omitempty"`
	Type        string     `yaml:"type,omitempty" json:"type,omitempty"`
	Description string     `yaml:"description,omitempty" json:"description,omitempty"`
	Credit      Credential `yaml:"credential,omitempty" json:"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" json:"capability"`
	Node              string                      `yaml:"node,omitempty" json:"node,omitempty"`
	Relationship      string                      `yaml:"relationship,omitempty" json:"relationship,omitempty"`
	RelationshipProps map[string]*ValueAssignment `yaml:"relationship_props,omitempty" json:"relationship_props,omitempty"`
	// Non Tosca-Standard A4C type_requirement property
	TypeRequirement string `yaml:"type_requirement,omitempty" json:"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" json:"capability"`
	Node         string `yaml:"node,omitempty" json:"node,omitempty"`
	Relationship string `yaml:"relationship,omitempty" json:"relationship,omitempty"`
	Occurrences  Range  `yaml:"occurrences,omitempty" json:"occurrences,omitempty"`
	// Non Tosca-Standard A4C capability_name property
	CapabilityName string `yaml:"capability_name,omitempty" json:"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" json:"type"`
	Properties map[string]*ValueAssignment `yaml:"properties,omitempty" json:"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"`
}

A 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" json:"node_type"`
	Properties   map[string]PropAttrMapping `yaml:"properties,omitempty" json:"properties,omitempty"`
	Capabilities map[string]CapReqMapping   `yaml:"capabilities,omitempty" json:"capabilities,omitempty"`
	Requirements map[string]CapReqMapping   `yaml:"requirements,omitempty" json:"requirements,omitempty"`
	Attributes   map[string]PropAttrMapping `yaml:"attributes,omitempty" json:"attributes,omitempty"`
	Interfaces   map[string]string          `yaml:"interfaces,omitempty" json:"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" json:"tosca_definitions_version"`
	Description  string            `yaml:"description,omitempty" json:"description,omitempty"`
	Metadata     map[string]string `yaml:"metadata,omitempty" json:"metadata,omitempty"`

	Imports []ImportDefinition `yaml:"imports,omitempty" json:"imports,omitempty"`

	Repositories map[string]Repository `yaml:"repositories,omitempty" json:"repositories,omitempty"`

	DataTypes         map[string]DataType         `yaml:"data_types,omitempty" json:"data_types,omitempty"`
	ArtifactTypes     map[string]ArtifactType     `yaml:"artifact_types,omitempty" json:"artifact_types,omitempty"`
	NodeTypes         map[string]NodeType         `yaml:"node_types,omitempty" json:"node_types,omitempty"`
	CapabilityTypes   map[string]CapabilityType   `yaml:"capability_types,omitempty" json:"capability_types,omitempty"`
	RelationshipTypes map[string]RelationshipType `yaml:"relationship_types,omitempty" json:"relationship_types,omitempty"`
	// TODO Group Types
	PolicyTypes map[string]PolicyType `yaml:"policy_types,omitempty" json:"policy_types,omitempty"`

	TopologyTemplate TopologyTemplate `yaml:"topology_template" json:"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" json:"description,omitempty"`
	Inputs             map[string]ParameterDefinition `yaml:"inputs,omitempty" json:"inputs,omitempty"`
	NodeTemplates      map[string]NodeTemplate        `yaml:"node_templates" json:"node_templates"`
	Outputs            map[string]ParameterDefinition `yaml:"outputs,omitempty" json:"outputs,omitempty"`
	SubstitionMappings *SubstitutionMapping           `yaml:"substitution_mappings,omitempty" json:"substitution_mappings,omitempty"`
	Workflows          map[string]Workflow
	Policies           []PolicyMap `yaml:"policies,omitempty" json:"policies,omitempty"`
}

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 {
	Base        TypeBase          `yaml:"base,omitempty" json:"base,omitempty"`
	DerivedFrom string            `yaml:"derived_from,omitempty" json:"derived_from,omitempty"`
	Version     string            `yaml:"version,omitempty" json:"version,omitempty"`
	ImportPath  string            `yaml:"import_path,omitempty" json:"import_path,omitempty"`
	Description string            `yaml:"description,omitempty" json:"description,omitempty"`
	Metadata    map[string]string `yaml:"metadata,omitempty" json:"metadata,omitempty"`
}

Type is the base type for all TOSCA types (like node types, relationship types, ...)

type TypeBase

type TypeBase int

TypeBase is an enumerated type for TOSCA base types

ENUM( NODE RELATIONSHIP CAPABILITY POLICY ARTIFACT DATA )

const (
	// TypeBaseNODE is a TypeBase of type NODE
	TypeBaseNODE TypeBase = iota
	// TypeBaseRELATIONSHIP is a TypeBase of type RELATIONSHIP
	TypeBaseRELATIONSHIP
	// TypeBaseCAPABILITY is a TypeBase of type CAPABILITY
	TypeBaseCAPABILITY
	// TypeBasePOLICY is a TypeBase of type POLICY
	TypeBasePOLICY
	// TypeBaseARTIFACT is a TypeBase of type ARTIFACT
	TypeBaseARTIFACT
	// TypeBaseDATA is a TypeBase of type DATA
	TypeBaseDATA
)

func ParseTypeBase

func ParseTypeBase(name string) (TypeBase, error)

ParseTypeBase attempts to convert a string to a TypeBase

func (TypeBase) String

func (x TypeBase) String() string

String implements the Stringer interface.

type ValueAssignment

type ValueAssignment struct {
	Type  ValueAssignmentType `json:"type"`
	Value interface{}         `json:"value,omitempty"`
}

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 ToValueAssignment

func ToValueAssignment(value interface{}) (*ValueAssignment, error)

ToValueAssignment builds a ValueAssignment from a value by deducing its type

func (ValueAssignment) GetFunction

func (p ValueAssignment) GetFunction() *Function

GetFunction returns 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[string]interface{}

GetMap retruns the map associated with this ValueAssignment

If ValueAssignment.Type is not ValueAssignmentMap then nil is returned

func (ValueAssignment) String

func (p ValueAssignment) String() string

String retruns the textual representation of 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

func (*ValueAssignmentType) UnmarshalJSON

func (vat *ValueAssignmentType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals json into a ValueAssignmentType

type Workflow

type Workflow struct {
	Inputs  map[string]PropertyDefinition  `yaml:"inputs,omitempty" json:"inputs,omitempty"`
	Steps   map[string]*Step               `yaml:"steps,omitempty" json:"steps,omitempty"`
	Outputs map[string]ParameterDefinition `yaml:"outputs,omitempty" json:"outputs,omitempty"`
}

A Workflow is the representation of a TOSCA Workflow

type WorkflowActivity

type WorkflowActivity struct {
	Workflow string                         `yaml:"workflow" json:"workflow"`
	Inputs   map[string]ParameterDefinition `yaml:"inputs,omitempty" json:"inputs,omitempty"`
}

WorkflowActivity defines the name of a workflow and optional input assignments

func (*WorkflowActivity) UnmarshalYAML

func (w *WorkflowActivity) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a yaml into a WorkflowActivity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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