Categorygithub.com/dciangot/toscalib
modulepackage
0.0.0-20200214150212-d0d4f8631683
Repository: https://github.com/dciangot/toscalib.git
Documentation: pkg.go.dev

# README

Abstract

This library is an implementation of the TOSCA definition as described in the document written in pure GO TOSCA Simple Profile in YAML Version 1.1

Status

GoDoc GoCard coverage Build Status

Plans

ToDo Tasks

Normative Types

The normative types definitions are included de facto. The files are embeded using go-bindata.

Howto

Create a ServiceTemplateDefinition and call Parse(r io.Reader) of ParseCsar(c string) to fill it with a YAML definition.

Example

var t toscalib.ServiceTemplateDefinition
err := t.Parse(os.Stdin)
if err != nil {
    log.Fatal(err)
}
var t toscalib.ServiceTemplateDefinition
err := t.ParseCsar("tests/tosca_elk.zip")
if err != nil {
    log.Fatal(err)
}

Origins

Original implementation provided by Olivier Wulveryck at github.com/owulveryck/toscalib.

# Functions

Asset loads and returns the asset for the given name.
AssetDir returns the file names below a certain directory embedded in the file by go-bindata.
AssetInfo loads and returns the asset info for the given name.
AssetNames returns the names of the assets.
MustAsset is like Asset but panics when Asset would return an error.
RestoreAsset restores an asset under the given directory.
RestoreAssets restores an asset under the given directory recursively.

# Constants

Defines Tosca Function Names.
Valid values for Status as described in Appendix 5.7.3.
Valid values for Status as described in Appendix 5.7.3.
Defines Tosca Function Names.
Defines Tosca Function Names.
Defines Tosca Function Names.
Defines Tosca Function Names.
Defines Tosca Function Names.
Defines Tosca Function Names.
Host is a ref a TOSCA orchestrator will interpret this keyword to refer to the all nodes that “host” the node using this reference (i.e., as identified by its HostedOn relationship).
LocalFile will indicate the orchestrator is responsible for providing a path as the result of the get_artifact call where the artifact file can be accessed.
NetworkPrivate is an alias used to reference the first private network within a property or attribute of a Node or Capability which would be assigned to them by the underlying platform at runtime.
NetworkPublic is an alias used to reference the first public network within a property or attribute of a Node or Capability which would be assigned to them by the underlying platform at runtime.
Self is ref for a TOSCA orchestrator will interpret this keyword as the Node or Relationship Template instance that contains the function at the time the function is evaluated.
Source is a ref a TOSCA orchestrator will interpret this keyword as the Node Template instance that is at the source end of the relationship that contains the referencing function.
Node has been configured prior to being started.
Node is transitioning from created state to configured state.
Node software has been installed.
Node is transitioning from initial state to created state.
Node is transitioning from its current state to one where it is deleted and its state is =iota // longer tracked by the instance model.
Node is in an error state.
Node is not yet created.
Node is started.
Node is transitioning from configured state to started state.
Node is transitioning from its current state to a configured state.
Valid values for Status as described in Appendix 5.7.3.
Target is a ref a TOSCA orchestrator will interpret this keyword as the Node Template instance that is at the source end of the relationship that contains the referencing function.
Defines Tosca Function Names.
UNBOUNDED A.2.3 TOCSA range type.
Valid values for Status as described in Appendix 5.7.3.

# Variables

Functions is the list of Tosca Functions.
Operators is a list of supported constraint operators.

# Structs

ActivityDefinition structure to handle workflow step activity.
ArtifactDefinition defines a named, typed file that can be associated with Node Type or Node Template and used by orchestration engine to facilitate deployment and implementation of interface operations.
ArtifactType is a reusable entity that defines the type of one or more files that are used to define implementation or deployment artifacts that are referenced by nodes or relationships on their operations.
Assignment supports Value evaluation.
AttributeAssignment supports Value evaluation.
AttributeDefinition is a structure describing the property assignmenet in the node template This notion is described in appendix 5.9 of the document.
CapabilityAssignment allows node template authors to assign values to properties and attributes for a named capability definition that is part of a Node Template’s type definition.
CapabilityDefinition Appendix 6.1.
CapabilityType as described in appendix 6.6 A Capability Type is a reusable entity that describes a kind of capability that a Node Type can declare to expose.
ConstraintClause definition as described in Appendix 5.2.
DataType as described in Appendix 6.5 A Data Type definition defines the schema for new named datatypes in TOSCA.
EventFilterDefinition provides structure for event_filter of a Trigger.
GroupDefinition defines a logical grouping of node templates, typically for management purposes, but is separate from the application’s topology template.
GroupType defines logical grouping types for nodes, typically for different management purposes.
ImportDefinition is used within a TOSCA Service Template to locate and uniquely name another TOSCA Service Template file which has type and template definitions to be imported (included) and referenced within another Service Template.
InterfaceDefinition is related to a node type.
InterfaceType as described in Appendix A 6.4 An Interface Type is a reusable entity that describes a set of operations that can be used to interact with or manage a node or relationship in a TOSCA topology.
NodeTemplate as described in Appendix 7.3 A Node Template specifies the occurrence of a manageable software component as part of an application’s topology model which is defined in a TOSCA Service Template.
NodeType as described is Appendix 6.8.
OperationDefinition defines a named function or procedure that can be bound to an implementation artifact (e.g., a script).
ParserHooks provide callback functions for handling custom logic at key points within the overall parsing logic.
PolicyDefinition provides the structure for an instance of a Policy based on a PolicyType.
PolicyType provides the base structure for defining what a Policy is.
PreconditionDefinition structure to handle a condition that is checked before a step.
PropertyAssignment supports Value evaluation.
PropertyDefinition as described in Appendix 5.7: A property definition defines a named, typed value and related data that can be associated with an entity defined in this specification (e.g., Node Types, Relation ship Types, Capability Types, etc.).
RelationshipTemplate specifies the occurrence of a manageable relationship between node templates as part of an application’s topology model that is defined in a TOSCA Service Template.
RelationshipType as described in appendix 6.9 A Relationship Type is a reusable entity that defines the type of one or more relationships between Node Types or Node Templates.
RepositoryDefinition as desribed in Appendix 5.6 A repository definition defines a named external repository which contains deployment and implementation artifacts that are referenced within the TOSCA Service Template.
RequirementAssignment as described in Appendix 7.2.
RequirementDefinition as described in Appendix 6.2.
RequirementRelationship is the list of recognized keynames for a TOSCA requirement assignment’s relationship keyname which is used when Property assignments need to be provided to inputs of declared interfaces or their operations:.
RequirementRelationshipType defines the Relationship type of a Requirement Definition.
Scalar type as defined in Appendis 2.6.
ServiceTemplateDefinition is the meta structure containing an entire tosca document as described in http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/csd03/TOSCA-Simple-Profile-YAML-v1.0-csd03.html.
StepDefinition structure to handle workflow steps.
TimeInterval Datatype defined in Spec v1.2 section 5.3.3 The TimeInterval type is a complex TOSCA data Type used when describing a period of time using the YAML ISO 8601 format to declare the start and end times.
TopologyTemplateType as described in appendix A 8 This section defines the topology template of a cloud application.
TriggerCondition provides structure for condition of a Trigger.
TriggerDefinition provides the base structure for defining a Trigger for a Policy.
Version - The version have the following grammar: MajorVersion.MinorVersion[.FixVersion[.Qualifier[-BuildVersion]]] MajorVersion is a required integer value greater than or equ al to 0 (zero) MinorVersion is a required integer value greater than or equal to 0 (zero).
WorkflowDefinition structure to handle workflows as per tosca spec 1.2.

# Interfaces

CredentialDefinition as described in appendix C 2.1 The Credential type is a complex TOSCA data Type used when describing authorization credentials used to access network accessible resources.
Filter defines a generic interface to represent any condition.
NodeFilter Appendix 5.4 TODO: Implement NodeFilter struct A node filter definition defines criteria for selection of a TOSCA Node Template based upon the template’s property values, capabilities and capability properties.
Regex type used in the constraint definition (Appendix A 5.2.1).
ToscaInterfacesNodeLifecycleStandarder is a go interface for the standard normative lifecycle.
ToscaRange is defined in Appendix 2.3 The range type can be used to define numeric ranges with a lower and upper boundary.

# Type aliases

Constraints is an array of ConstraintClause.
Frequency type as described in appendix A 2.6.6.
Metadata is provides support for attaching provider specific attributes to different structures.
Resolver defines a function spec that the Parser will use to resolve remote Imports.
Size type as described in appendix A 2.6.4.
Status is used in the PropertyDefinition.
ToscaList is defined is Appendix 2.4.
ToscaMap type as described in appendix A.2.5 The map type allows for specifying multiple values for a param eter of property as a map.