TOSCA YAML/XML Converter

## Table of Contents 1. TOSCA type definitions 1. [Node type] 1. [Relationship type] 1. [Artifact type] 1. TOSCA simple profile definitions 1. [Node template] 1. TOSCA YAML specific elements 1. [Version] [Node type]: #/NodeType [Relationship type]: #/RelationshipType [Artifact type]: #/ArtifactType [Node template]: #/NodeTemplate [Version]: #/Version
## TOSCA Type Definitions - [Node type] [Node type]: #/NodeType
## Node Type - [TOSCA YAML Node type] - [TOSCA XML Node type] - [TOSCA XML Node type implementation] - [Combined Node type] [TOSCA YAML Node type]: #/YamlNodeType [TOSCA XML Node type]: #/XmlNodeType [TOSCA XML Node type implementation]: #/XmlNodeTypeImplementation [Combined Node type]: #/CombinedNodeType

TOSCA YAML Node type

NodeTypeName:
    derived_from: QName(NodeType)
    version: Version
    metadata: Metadata
    targetNamespace: Namespace
    description: Description
    attributes: AttributeDefinition*
    properties: PropertyDefinition*
    requirements: RequirementDefinition*
    capabilities: CapabilityDefinition*
    interfaces: InterfaceDefinitions*
    artifacts: ArtifactDefinition*

TOSCA XML Node type

NodeType:
    documentation: Documentation
    anyAttribute: any
    name: QName
    targetNamespace: Namespace
    abstract: Boolean
    final: Boolean
    Tags: Tag*
    DerivedFrom: QName(NodeType)
    PropertiesDefinition: PropertiesDefinition
    RequirementDefinitions: RequirementDefinition*
    CapabilityDefinitions: CapabilityDefinition*
    InstanceStates: InstanceState*
    Interfaces: Interface*

TOSCA XML Node type implementation

NodeTypeImplementation:
    name: QName
    targetNamespace: Namespace
    nodeType: QName(NodeType)
    abstract: Boolean
    final: Boolean
    Tags: Tag*
    Derived_from: QName(NodeTypeImplementation)?
    RequiredContainerFeatures: RequiredContainerFeature*
    ImplementationArtifacts: ImplementationArtifact*
    DeploymentArtifacts: DeploymentArtifact*

Combined Node type

NodeType:
    anyAttribute: any
    (NodeTypeName|name): String|QName
    derived_from: QName(NodeType)
    version: Version
    (metadata|Tags): (Metadata|Tag*)
        (targetNamespace): Namespace
        abstract: Boolean
        final: Boolean
    description: (Description|Documentation)
    attributes: AttributeDefinition*
    properties: (PropertyDefinition*|QName)
    requirements: RequirementDefinition*
    capabilities: CapabilityDefinition*
    interfaces: (InterfaceDefinitions*|Interface*)
    (artifacts|ImplementationArtifacts
        |DeploymentArtifacts): (ArtifactDefinition*
            |ImplementationArtifact*|DeploymentArtifact*)
    InstanceStates: InstanceState*

Artifact Type

Supported Artifact Types

## Other TOSCA Elements - [Metadata and Tags] - [Namespace] [Metadata and Tags]: #/MetadataAndTags [Namespace]: #/Namespace
### Metadata and Tags

Metadata

metadata:
    (key: value)*

key: string
value: string

Optional key names
metadata:
    template_name: string
    template_author: string
    template_version: Version
Converter specific key names
targetNamespace: Namespace

Tags

Tags: Tag*

Tag:
    name: string
    value: string
### Namespaces TOSCA XML Namespaces ```yaml TOSCA: http://docs.oasis-open.org/tosca/ns/2011/12 http://www.opentosca.org/winery/extensions/tosca/2013/02/12 ``` TOSCA YAML Namespaces ```yaml TOSCA YAML: http://docs.oasis-open.org/tosca/ns/simple/yaml/1.1 Default: http://www.eclipse.org/winery/ns/simple/yaml/1.1/default ``` User defined Namespaces ```yaml http://www.kleinech.uni-stuttgart.de/tosca/ns/ ```
#### OpenTOSCA Namespace conventions Namespace prefix ```yaml http://www.opentosca.org/ ``` followed by TOSCA component type ```yaml e.g. servicetemplates, nodetypes, ... ```
### Description and Documentation
#### Description Single line descriptions ```yaml description: string ``` Multi line descriptions ```yaml description: > this is the first line of the description this is appended to the first line of the description this is the second line of the description ``` See [YAML multi line strings](https://stackoverflow.com/a/21699210/8235252) for more different ways to write multi line descriptions.
#### Documentation

CSAR

## Other TOSCA YAML elements
### TOSCA Version | Shorthand Name | version | |---------------------|---------------| | Type Qualified Name | tosca:version | #### Grammar ```yaml major_version.minor_version [.fix_version[.qualifier[-build_version]]] ```

Attribute definition

  • Defines a named and typed value and is used to expose the actual state of some property of a TOSCA entity.
  • TOSCA orchestrators automatically create Attribute definitions for every Property Definition


Grammar
AttributeDefinitionName:
    type: DataType
    description: Description
    default: AttributeDefault
    status: StatusValue

Attribute default

MUST be derived or calculated from other Attributes or Operation output values

Example
AttributeName:
    type: string
    default: { get_operation_output: [ SELF, iface, op, name ] }

TOSCA functions

Errors

  • section 2.10
  • section 5.4
  • section 5.7
## Other TOSCA XML Elements

TOSCA Orchestrator

TOSCA Processor

TOSCA Normative type definitions

Property assignment

Used to assign values to named properties.

Grammar
propertyName: Name | ValueExpression
Example