TOSCA Version 2.0

Committee Specification Draft 03

28 October 2020

This version:

https://docs.oasis-open.org/tosca/TOSCA/v2.0/csd03/TOSCA-v2.0-csd03.docx (Authoritative)

https://docs.oasis-open.org/tosca/TOSCA/v2.0/csd03/TOSCA-v2.0-csd03.html

https://docs.oasis-open.org/tosca/TOSCA/v2.0/csd03/TOSCA-v2.0-csd03.pdf

Previous version:

https://docs.oasis-open.org/tosca/TOSCA/v2.0/csd02/TOSCA-v2.0-csd02.docx (Authoritative)

https://docs.oasis-open.org/tosca/TOSCA/v2.0/csd02/TOSCA-v2.0-csd02.html

https://docs.oasis-open.org/tosca/TOSCA/v2.0/csd02/TOSCA-v2.0-csd02.pdf

Latest version:

https://docs.oasis-open.org/tosca/TOSCA/v2.0/TOSCA-v2.0.docx (Authoritative)

https://docs.oasis-open.org/tosca/TOSCA/v2.0/TOSCA-v2.0.html

https://docs.oasis-open.org/tosca/TOSCA/v2.0/TOSCA-v2.0.pdf

Technical Committee:

OASIS Topology and Orchestration Specification for Cloud Applications (TOSCA) TC

Chairs:

Paul Lipton (paul.lipton@live.com), Individual Member

Chris Lauwers (lauwers@ubicity.com), Individual Member

Editors:

Chris Lauwers (lauwers@ubicity.com), Individual Member

Calin Curescu (calin.curescu@ericsson.com), Ericsson

Related work:

This specification replaces or supersedes:

·         Topology and Orchestration Specification for Cloud Applications Version 1.0. Edited by Derek Palma and Thomas Spatzier. OASIS Standard. Latest version: http://docs.oasis-open.org/tosca/TOSCA/v1.0/TOSCA-v1.0.html.

·         TOSCA Simple Profile in YAML Version 1.3. Edited by Matt Rutkowski, Chris Lauwers, Claude Noshpitz, and Calin Curescu. Latest version: https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/TOSCA-Simple-Profile-YAML-v1.3.html.

This specification is related to:

·         Introduction to TOSCA Version 2.0. Edited by Chris Lauwers and Calin Curescu. Work in progress.

Declared XML namespaces:

·         http://docs.oasis-open.org/tosca/ns/2.0

Abstract:

The OASIS TOSCA TC works to enhance the portability of cloud applications and services across their entire lifecycle. TOSCA will enable the interoperable description of application and infrastructure cloud services, the relationships between parts of the service, and the operational behavior of these services (e.g., deploy, patch, shutdown) independent of the supplier creating the service or of any particular cloud provider or hosting technology. TOSCA will also make it possible for higher-level operational behavior to be associated with cloud infrastructure management.

By increasing service and application portability in a vendor-neutral ecosystem, TOSCA will enable:

·         Portable deployment to any compliant cloud

·         Smoother migration of existing applications to the cloud

·         Flexible bursting (consumer choice)

·         Dynamic, multi-cloud provider applications

Status:

This document was last revised or approved by the OASIS Topology and Orchestration Specification for Cloud Applications (TOSCA) TC on the above date. The level of approval is also listed above. Check the “Latest version” location noted above for possible later revisions of this document. Any other numbered Versions and other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=tosca#technical.

TC members should send comments on this specification to the TC’s email list. Others should send comments to the TC’s public comment list, after subscribing to it by following the instructions at the “Send A Comment” button on the TC’s web page at https://www.oasis-open.org/committees/tosca/.

This specification is provided under the RF on Limited Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC’s web page (https://www.oasis-open.org/committees/tosca/ipr.php).

Note that any machine-readable content (Computer Language Definitions) declared Normative for this Work Product is provided in separate plain text files. In the event of a discrepancy between any such plain text file and display content in the Work Product's prose narrative document(s), the content in the separate plain text file prevails.

Citation format:

When referencing this specification, the following citation format should be used:

[TOSCA-v2.0]

TOSCA Version 2.0. Edited by Chris Lauwers and Calin Curescu. 28 October 2020. OASIS Committee Specification Draft 03. https://docs.oasis-open.org/tosca/TOSCA/v2.0/csd03/TOSCA-v2.0-csd03.html. Latest version: https://docs.oasis-open.org/tosca/TOSCA/v2.0/TOSCA-v2.0.html.

Notices

Copyright © OASIS Open 2020. All Rights Reserved.

All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the OASIS website.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

As stated in the OASIS IPR Policy, the following three paragraphs in brackets apply to OASIS Standards Final Deliverable documents (Committee Specification, Candidate OASIS Standard, OASIS Standard, or Approved Errata).

[OASIS requests that any OASIS Party or any other party that believes it has patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this deliverable.]

[OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable by a patent holder that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this OASIS Standards Final Deliverable. OASIS may include such claims on its website, but disclaims any obligation to do so.]

[OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS' procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]

The name "OASIS" is a trademark of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see https://www.oasis-open.org/policies-guidelines/trademark for above guidance.

Table of Contents

1        Introduction. 17

1.1 IPR Policy. 17

1.2 Terminology. 17

1.3 Normative References. 17

1.4 Non-Normative References. 17

2        Overview. 19

2.1 Objective. 19

2.2 Application Domains. 19

2.3 Implementations. 19

2.4 Glossary. 20

3        TOSCA core concepts. 21

3.1 Topology Templates, Node Templates, and Relationships. 21

3.2 Interfaces, Operations, and Artifacts. 22

3.3 Workflows. 22

3.4 Requirements and Capabilities. 22

3.5 Decomposition of Service Templates. 23

3.6 Policies in TOSCA. 24

3.7 Archive Format for Cloud Applications. 24

4        TOSCA definitions in YAML. 26

4.1 TOSCA Metamodel 26

4.1.1 Modeling concepts and goals. 26

4.1.2 Modeling definitions and reuse. 26

4.1.3 Goal of the derivation and refinement rules. 26

4.1.4 Mandatory Keynames. 27

4.2 TOSCA Service. 27

4.2.1 Service Template definition. 27

4.2.1.1 Keynames. 27

4.2.1.1.1 Metadata keynames. 28

4.2.1.2 Grammar 28

4.2.1.2.1 Requirements. 29

4.2.1.2.2 Notes. 29

4.2.1.3 Top-level keyname definitions. 30

4.2.1.3.1 tosca_definitions_version. 30

4.2.1.3.1.1     Keyname. 30

4.2.1.3.1.2     Grammar 30

4.2.1.3.1.3     Examples: 30

4.2.1.3.2 profile. 30

4.2.1.3.2.1     Keyname. 30

4.2.1.3.2.2     Grammar 30

4.2.1.3.2.3     Examples. 31

4.2.1.3.3 metadata. 31

4.2.1.3.3.1     Keyname. 31

4.2.1.3.3.2     Grammar 31

4.2.1.3.3.3     Example. 31

4.2.1.3.4 template_name. 31

4.2.1.3.4.1     Keyname. 31

4.2.1.3.4.2     Grammar 31

4.2.1.3.4.3     Example. 31

4.2.1.3.5 template_author 32

4.2.1.3.5.1     Keyname. 32

4.2.1.3.5.2     Grammar 32

4.2.1.3.5.3     Example. 32

4.2.1.3.6 template_version. 32

4.2.1.3.6.1     Keyname. 32

4.2.1.3.6.2     Grammar 32

4.2.1.3.6.3     Example. 32

4.2.1.3.6.4     Notes: 32

4.2.1.3.7 description. 32

4.2.1.3.7.1     Keyname. 32

4.2.1.3.8 dsl_definitions. 32

4.2.1.3.8.1     Keyname. 33

4.2.1.3.8.2     Grammar 33

4.2.1.3.8.3     Example. 33

4.2.1.3.9 repositories. 33

4.2.1.3.9.1     Keyname. 33

4.2.1.3.9.2     Grammar 33

4.2.1.3.9.3     Example. 33

4.2.1.3.10 imports. 33

4.2.1.3.10.1     Keyname. 34

4.2.1.3.10.2     Grammar 34

4.2.1.3.10.3     Example. 34

4.2.1.3.11 artifact_types. 34

4.2.1.3.11.1     Keyname. 34

4.2.1.3.11.2     Grammar 34

4.2.1.3.11.3     Example. 34

4.2.1.3.12 data_types. 34

4.2.1.3.12.1     Keyname. 34

4.2.1.3.12.2     Grammar 35

4.2.1.3.12.3     Example. 35

4.2.1.3.13 capability_types. 35

4.2.1.3.13.1     Keyname. 35

4.2.1.3.13.2     Grammar 35

4.2.1.3.13.3     Example. 35

4.2.1.3.14 interface_types. 36

4.2.1.3.14.1     Keyname. 36

4.2.1.3.14.2     Grammar 36

4.2.1.3.14.3     Example. 36

4.2.1.3.15 relationship_types. 36

4.2.1.3.15.1     Keyname. 36

4.2.1.3.15.2     Grammar 36

4.2.1.3.15.3     Example. 36

4.2.1.3.16 node_types. 37

4.2.1.3.16.1     Keyname. 37

4.2.1.3.16.2     Grammar 37

4.2.1.3.16.3     Example. 37

4.2.1.3.17 group_types. 37

4.2.1.3.17.1     Keyname. 37

4.2.1.3.17.2     Grammar 37

4.2.1.3.17.3     Example. 37

4.2.1.3.18 policy_types. 38

4.2.1.3.18.1     Keyname. 38

4.2.1.3.18.2     Grammar 38

4.2.1.3.18.3     Example. 38

4.2.2 Profiles. 38

4.2.2.1 Examples. 38

4.2.2.2 Defining Profiles. 39

4.2.2.3 Profile Versions. 39

4.2.3 Imports and Namespaces. 41

4.2.3.1 Import definition. 41

4.2.3.1.1 Keynames. 41

4.2.3.1.2 Grammar 41

4.2.3.1.2.1     Single-line grammar: 41

4.2.3.1.2.2     Multi-line grammar 41

4.2.3.1.3 Import processing rules. 42

4.2.3.1.3.1     Importing profiles. 42

4.2.3.1.3.2     Importing service templates. 42

4.2.3.1.4 Examples. 43

4.2.3.2 Namespaces. 44

4.2.3.2.1 Additional Requirements. 46

4.2.3.3 Repository definition. 47

4.2.3.3.1 Keynames. 47

4.2.3.3.2 Grammar 47

4.2.3.3.2.1     Single-line grammar: 47

4.2.3.3.2.2     Multi-line grammar 47

4.2.3.3.3 Example. 47

4.2.4 Additional information definitions. 47

4.2.4.1 Description definition. 47

4.2.4.1.1 Keyname. 47

4.2.4.1.2 Grammar 48

4.2.4.1.3 Examples. 48

4.2.4.1.4 Notes. 48

4.2.4.2 Metadata. 48

4.2.4.2.1 Keyname. 48

4.2.4.2.2 Grammar 48

4.2.4.2.3 Examples. 48

4.2.4.2.4 Notes. 49

4.2.4.3 DSL Definitions. 49

4.2.5 Type definitions. 49

4.2.5.1 General derivation and refinement rules. 49

4.2.5.2 Common keynames in type definitions. 50

4.2.5.2.1 Keynames. 50

4.2.5.2.2 Grammar 50

4.2.5.2.3 Derivation rules. 50

4.2.6 Topology Template definition. 51

4.2.6.1 Keynames. 51

4.2.6.2 Grammar 51

4.2.6.2.1 inputs. 52

4.2.6.2.1.1     Grammar 52

4.2.6.2.1.2     Examples. 53

4.2.6.2.2 node_templates. 53

4.2.6.2.2.1     grammar 53

4.2.6.2.2.2     Example. 53

4.2.6.2.3 relationship_templates. 53

4.2.6.2.3.1     Grammar 54

4.2.6.2.3.2     Example. 54

4.2.6.2.4 outputs. 54

4.2.6.2.4.1     Grammar 54

4.2.6.2.4.2     Example. 54

4.2.6.2.5 groups. 54

4.2.6.2.5.1     Grammar 54

4.2.6.2.5.2     Example. 55

4.2.6.2.6 policies. 55

4.2.6.2.6.1     Grammar 55

4.2.6.2.6.2     Example. 55

4.2.6.2.7 substitution_mapping. 55

4.2.6.2.7.1     requirement_mapping. 55

4.2.6.2.7.2     Example. 56

4.2.6.2.8 Notes. 57

4.3 Nodes and Relationships. 57

4.3.1 Node Type. 57

4.3.1.1 Keynames. 57

4.3.1.2 Grammar 57

4.3.1.3 Derivation rules. 58

4.3.1.4 Additional Requirements. 59

4.3.1.5 Example. 59

4.3.2 Node Template. 59

4.3.2.1 Keynames. 59

4.3.2.2 Grammar 60

4.3.2.3 Additional requirements. 61

4.3.2.4 Example. 61

4.3.3 Relationship Type. 61

4.3.3.1 Keynames. 61

4.3.3.2 Grammar 62

4.3.3.3 Derivation rules. 62

4.3.3.4 Examples. 62

4.3.4 Relationship Template. 63

4.3.4.1 Keynames. 63

4.3.4.2 Grammar 63

4.3.4.3 Additional requirements. 64

4.3.4.4 Example. 64

4.3.5 Capabilities and Requirements. 64

4.3.5.1 Capability Type. 64

4.3.5.1.1 Keynames. 64

4.3.5.1.2 Grammar 65

4.3.5.1.3 Derivation rules. 65

4.3.5.1.4 Example. 65

4.3.5.2 Capability definition. 65

4.3.5.2.1 Keynames. 66

4.3.5.2.2 Grammar 66

4.3.5.2.2.1     Short notation. 67

4.3.5.2.2.2     Extended notation. 67

4.3.5.2.3 Refinement rules. 67

4.3.5.2.4 Examples. 68

4.3.5.2.4.1     Simple notation example. 68

4.3.5.2.4.2     Full notation example. 68

4.3.5.2.5 Additional requirements. 68

4.3.5.3 Capability assignment 68

4.3.5.3.1 Keynames. 68

4.3.5.3.2 Grammar 69

4.3.5.3.3 Example. 69

4.3.5.3.3.1     Notation example. 69

4.3.5.4 Requirement Type. 69

4.3.5.5 Requirement definition. 70

4.3.5.5.1 Keynames. 70

4.3.5.5.1.1     Additional Keynames for multi-line relationship grammar 70

4.3.5.5.2 Grammar 71

4.3.5.5.2.1     Simple grammar (Capability Type only) 71

4.3.5.5.2.2     Extended grammar (with Node and Relationship Types) 71

4.3.5.5.2.3     Extended grammar for declaring Parameter Definitions on the relationship’s Interfaces. 71

4.3.5.5.3 Refinement rules. 72

4.3.5.5.4 Additional requirements. 72

4.3.5.5.5 Notes. 72

4.3.5.5.6 Requirement definition is a tuple with a filter 72

4.3.5.6 Requirement assignment 73

4.3.5.6.1 Keynames. 73

4.3.5.6.2 Grammar 74

4.3.5.6.2.1     Short notation: 74

4.3.5.6.2.2     Extended notation: 74

4.3.5.6.2.3     Extended grammar with Property Assignments and Interface Assignments for the relationship  74

4.3.5.6.3 Examples. 76

4.3.5.6.3.1     Example 1 – Hosting requirement on a Node Type. 76

4.3.5.6.3.2     Example 2 - Requirement with Node Template and a custom Relationship Type. 76

4.3.5.6.3.3     Example 3 - Requirement for a Compute node with additional selection criteria (filter) 77

4.3.5.6.3.4     Example 4 - Requirement assignment for definition with occurrences: [2,2] 77

4.3.5.7 Node Filter definition. 77

4.3.5.7.1 Keynames. 77

4.3.5.7.2 Additional filtering on capability properties. 78

4.3.5.7.3 Grammar 78

4.3.5.7.4 Additional requirements. 79

4.3.5.7.5 Example. 79

4.3.5.8 Property Filter definition. 79

4.3.5.8.1 Grammar 79

4.3.5.8.1.1     Short notation: 79

4.3.5.8.1.2     Extended notation: 79

4.3.5.8.2 Additional Requirements. 80

4.3.6 Interfaces. 80

4.3.6.1 Interface Type. 80

4.3.6.1.1 Keynames. 80

4.3.6.1.2 Grammar 80

4.3.6.1.3 Derivation rules. 81

4.3.6.1.4 Example. 81

4.3.6.1.5 Additional Requirements. 81

4.3.6.2 Interface definition. 81

4.3.6.2.1 Keynames. 81

4.3.6.2.2 Grammar 82

4.3.6.2.3 Refinement rules. 82

4.3.6.3 Interface assignment 83

4.3.6.3.1 Keynames. 83

4.3.6.3.2 Grammar 83

4.3.6.4 Operation definition. 83

4.3.6.4.1 Keynames. 84

4.3.6.4.2 Grammar 84

4.3.6.4.2.1     Short notation. 84

4.3.6.4.2.2     Extended notation. 84

4.3.6.4.3 Refinement rules. 85

4.3.6.4.4 Additional requirements. 85

4.3.6.4.5 Examples. 85

4.3.6.4.5.1     Single-line example. 85

4.3.6.4.5.2     Multi-line example with shorthand implementation definitions. 85

4.3.6.4.5.3     Multi-line example with extended implementation definitions. 86

4.3.6.5 Operation assignment 86

4.3.6.5.1 Keynames. 86

4.3.6.5.2 Grammar 87

4.3.6.5.2.1     Short notation. 87

4.3.6.5.2.2     Extended notation. 87

4.3.6.5.3 Additional requirements. 87

4.3.6.5.4 Examples. 87

4.3.6.6 Notification definition. 88

4.3.6.6.1 Keynames. 88

4.3.6.6.2 Grammar 88

4.3.6.6.2.1     Short notation. 88

4.3.6.6.2.2     Extended notation. 88

4.3.6.6.3 Refinement rules. 89

4.3.6.6.4 Additional requirements. 89

4.3.6.6.5 Examples. 89

4.3.6.7 Notification assignment 89

4.3.6.7.1 Keynames. 90

4.3.6.7.2 Grammar 90

4.3.6.7.2.1     Short notation. 90

4.3.6.7.2.2     Extended notation. 90

4.3.6.7.3 Additional requirements. 91

4.3.6.7.4 Examples. 91

4.3.6.8 Operation and notification implementation definition. 91

4.3.6.8.1 Keynames. 91

4.3.6.8.2 Grammar 91

4.3.6.8.2.1     Short notation for use with single artifact 91

4.3.6.8.2.2     Short notation for use with multiple artifacts. 92

4.3.6.8.2.3     Extended notation for use with single artifact 92

4.3.6.8.2.4     Extended notation for use with multiple artifacts. 92

4.3.7 Artifacts. 93

4.3.7.1 Artifact Type. 93

4.3.7.1.1 Keynames. 93

4.3.7.1.2 Grammar 93

4.3.7.1.3 Derivation rules. 93

4.3.7.1.4 Examples. 94

4.3.7.1.5 Additional Requirements. 94

4.3.7.1.6 Notes. 94

4.3.7.2 Artifact definition. 94

4.3.7.2.1 Keynames. 94

4.3.7.2.2 Grammar 95

4.3.7.2.2.1     Short notation. 95

4.3.7.2.2.2     Extended notation: 95

4.3.7.2.3 Refinement rules. 96

4.3.7.2.4 Examples. 96

4.4 Properties, Attributes, and Parameters. 96

4.4.1 Primitive Types. 97

4.4.1.1 string. 97

4.4.1.1.1 Notes: 98

4.4.1.2 integer 98

4.4.1.2.1 Notes. 98

4.4.1.3 float 99

4.4.1.3.1 Notes. 99

4.4.1.4 boolean. 99

4.4.1.5 bytes. 99

4.4.1.5.1 Notes. 100

4.4.1.6 nil 100

4.4.2 Special Types. 101

4.4.2.1 TOSCA version. 101

4.4.2.1.1 Grammar 101

4.4.2.1.2 Version Comparison. 101

4.4.2.1.3 Examples. 101

4.4.2.1.4 Notes. 102

4.4.2.1.5 Additional Requirements. 102

4.4.2.2 TOSCA range type. 102

4.4.2.2.1 Grammar 102

4.4.2.2.2 Keywords. 102

4.4.2.2.3 Examples. 102

4.4.2.3 TOSCA timestamp type. 102

4.4.2.3.1 Notes. 103

4.4.2.4 TOSCA scalar-unit type. 103

4.4.2.4.1 Grammar 103

4.4.2.4.2 Additional requirements. 103

4.4.2.4.3 Concrete Types. 104

4.4.2.4.4 scalar-unit.size. 104

4.4.2.4.4.1     Recognized Units. 104

4.4.2.4.4.2     Examples. 104

4.4.2.4.4.3     Notes. 104

4.4.2.4.5 scalar-unit.time. 105

4.4.2.4.5.1     Recognized Units. 105

4.4.2.4.5.2     Examples. 105

4.4.2.4.5.3     Notes. 105

4.4.2.4.6 scalar-unit.frequency. 105

4.4.2.4.6.1     Recognized Units. 105

4.4.2.4.6.2     Examples. 105

4.4.2.4.6.3     Notes. 106

4.4.2.4.7 scalar-unit.bitrate. 106

4.4.2.4.7.1     Recognized Units. 106

4.4.2.4.7.2     Examples. 106

4.4.3 Collection Types. 106

4.4.3.1 TOSCA list type. 106

4.4.3.1.1 Grammar 106

4.4.3.1.1.1     Square bracket notation. 107

4.4.3.1.1.2     Bulleted list notation. 107

4.4.3.1.2 Declaration Examples. 107

4.4.3.1.2.1     List declaration using a simple type. 107

4.4.3.1.2.2     List declaration using a complex type. 107

4.4.3.1.3 Definition Examples. 107

4.4.3.1.3.1     Square bracket notation. 107

4.4.3.1.3.2     Bulleted list notation. 108

4.4.3.2 TOSCA map type. 108

4.4.3.2.1 Grammar 108

4.4.3.2.1.1     Single-line grammar 108

4.4.3.2.1.2     Multi-line grammar 108

4.4.3.2.2 Declaration Examples. 108

4.4.3.2.2.1     Map declaration using a simple type. 108

4.4.3.2.2.2     Map declaration using a complex type. 108

4.4.3.2.3 Definition Examples. 109

4.4.3.2.3.1     Single-line notation. 109

4.4.3.2.3.2     Multi-line notation. 109

4.4.4 Data Type. 109

4.4.4.1 Keynames. 109

4.4.4.2 Grammar 110

4.4.4.3 Derivation rules. 110

4.4.4.4 Additional Requirements. 110

4.4.4.5 Examples. 111

4.4.4.5.1 Defining a complex datatype. 111

4.4.4.5.2 Defining a datatype derived from an existing datatype. 111

4.4.5 Schema definition. 111

4.4.5.1 Keynames. 111

4.4.5.2 Grammar 112

4.4.5.3 Refinement rules. 112

4.4.6 Constraint clause definition. 112

4.4.6.1 Operator keynames. 113

4.4.6.1.1 Comparable value types. 113

4.4.6.2 Schema Constraint purpose. 113

4.4.6.3 Additional Requirements. 114

4.4.6.4 Grammar 114

4.4.6.5 Examples. 114

4.4.7 Property definition. 115

4.4.7.1 Attribute and Property reflection. 115

4.4.7.2 Keynames. 115

4.4.7.3 Status values. 116

4.4.7.4 Grammar 116

4.4.7.5 Refinement rules. 118

4.4.7.6 Additional Requirements. 118

4.4.7.7 Examples. 118

4.4.8 Property assignment 119

4.4.8.1 Keynames. 119

4.4.8.2 Grammar 119

4.4.8.2.1 Short notation: 119

4.4.8.3 Additional Requirements. 120

4.4.9 Attribute definition. 120

4.4.9.1 Attribute and Property reflection. 120

4.4.9.2 Keynames. 120

4.4.9.3 Grammar 121

4.4.9.4 Refinement rules. 121

4.4.9.5 Additional Requirements. 122

4.4.9.6 Notes. 122

4.4.9.7 Example. 122

4.4.10 Attribute assignment 122

4.4.10.1 Keynames. 122

4.4.10.2 Grammar 122

4.4.10.2.1 Short notation: 122

4.4.10.3 Additional requirements. 123

4.4.11 Parameter definition. 123

4.4.11.1 Keynames. 123

4.4.11.2 Grammar 124

4.4.11.3 Refinement rules. 125

4.4.11.4 Additional requirements. 126

4.4.11.5 Example. 126

4.4.12 Parameter value assignment 126

4.4.12.1 Keynames. 126

4.4.12.2 Grammar 126

4.4.12.3 Additional requirements. 127

4.4.13 Parameter mapping assignment 127

4.4.13.1 Keynames. 127

4.4.13.2 Grammar 127

4.4.13.3 Attribute selection format 127

4.4.13.4 Additional requirements. 128

4.5 Substitution. 128

4.5.1 Substitution mapping. 128

4.5.1.1 Keynames. 128

4.5.1.2 Grammar 129

4.5.1.3 Examples. 129

4.5.1.4 Additional requirements. 129

4.5.1.5 Notes. 129

4.5.2 Property mapping. 129

4.5.2.1 Keynames. 130

4.5.2.2 Grammar 130

4.5.2.3 Notes. 130

4.5.2.4 Additional constraints. 130

4.5.3 Attribute mapping. 131

4.5.3.1 Keynames. 131

4.5.3.2 Grammar 131

4.5.4 Capability mapping. 131

4.5.4.1 Keynames. 131

4.5.4.2 Grammar 131

4.5.5 Requirement mapping. 132

4.5.5.1 Keynames. 132

4.5.5.2 Grammar 132

4.5.6 Interface mapping. 133

4.5.6.1 Grammar 133

4.5.6.2 Notes. 133

4.6 Groups and Policies. 133

4.6.1 Group Type. 133

4.6.1.1 Keynames. 134

4.6.1.2 Grammar 134

4.6.1.3 Derivation rules. 134

4.6.1.4 Example. 135

4.6.2 Group definition. 135

4.6.2.1 Keynames. 135

4.6.2.2 Grammar 135

4.6.2.3 Example. 136

4.6.3 Policy Type. 136

4.6.3.1 Keynames. 136

4.6.3.2 Grammar 136

4.6.3.3 Derivation rules. 137

4.6.3.4 Example. 137

4.6.4 Policy definition. 137

4.6.4.1 Keynames. 137

4.6.4.2 Grammar 138

4.6.4.3 Example. 138

4.6.5 Trigger definition. 138

4.6.5.1 Keynames. 138

4.6.5.2 Additional keynames for the extended condition notation. 139

4.6.5.3 Grammar 139

4.6.5.3.1 Short notation. 139

4.6.5.3.2 Extended notation: 139

4.6.6 Event Filter definition. 140

4.6.6.1 Keynames. 140

4.6.6.2 Grammar 140

4.6.7 Condition clause definition. 141

4.6.7.1 Keynames. 141

4.6.7.2 Grammar 141

4.6.7.2.1 And clause. 141

4.6.7.2.2 Or clause. 142

4.6.7.2.3 Not clause. 142

4.6.7.3 Direct assertion definition. 142

4.6.7.4 Additional Requirement 142

4.6.7.5 Notes. 142

4.6.7.6 Example. 142

4.6.8 Assertion definition. 143

4.6.8.1 Keynames. 143

4.6.8.2 Grammar 144

4.6.8.3 Example. 144

4.6.9 Activity definitions. 144

4.6.9.1 Delegate workflow activity definition. 144

4.6.9.1.1 Keynames. 144

4.6.9.1.2 Grammar 145

4.6.9.1.2.1     Short notation. 145

4.6.9.1.2.2     Extended notation. 145

4.6.9.2 Set state activity definition. 145

4.6.9.2.1 Keynames. 145

4.6.9.2.2 Grammar 145

4.6.9.3 Call operation activity definition. 146

4.6.9.3.1 Keynames. 146

4.6.9.3.2 Grammar 146

4.6.9.3.2.1     Short notation. 146

4.6.9.3.2.2     Extended notation. 146

4.6.9.4 Inline workflow activity definition. 147

4.6.9.4.1 Keynames. 147

4.6.9.4.2 Grammar 147

4.6.9.4.2.1     Short notation. 147

4.6.9.4.2.2     Extended notation. 147

4.6.9.5 Example. 147

4.7 Workflows. 148

4.7.1 Imperative Workflow definition. 148

4.7.1.1 Keynames. 148

4.7.1.2 Grammar 148

4.7.2 Workflow precondition definition. 149

4.7.2.1 Keynames. 149

4.7.2.2 Grammar 149

4.7.3 Workflow step definition. 149

4.7.3.1 Keynames. 149

4.7.3.2 Grammar 150

4.8 Normative values. 151

4.8.1 Node States. 151

4.8.2 Relationship States. 151

4.8.2.1 Notes. 152

4.8.3 Directives. 152

4.8.4 Network Name aliases. 152

4.8.4.1 Usage. 152

5        TOSCA functions. 153

5.1 Reserved Function Keywords. 153

5.2 Environment Variable Conventions. 153

5.2.1 Reserved Environment Variable Names and Usage. 153

5.2.2 Prefixed vs. Unprefixed TARGET names. 155

5.2.2.1 Notes. 155

5.3 Intrinsic functions. 155

5.3.1 concat 155

5.3.1.1 Grammar 155

5.3.1.2 Parameters. 155

5.3.1.3 Examples. 156

5.3.2 join. 156

5.3.2.1 Grammar 156

5.3.2.2 Parameters. 156

5.3.2.3 Examples. 156

5.3.3 token. 156

5.3.3.1 Grammar 156

5.3.3.2 Parameters. 156

5.3.3.3 Examples. 157

5.4 Property functions. 157

5.4.1 get_input 157

5.4.1.1 Grammar 157

5.4.1.2 Parameters. 157

5.4.1.3 Examples. 158

5.4.2 get_property. 159

5.4.2.1 Grammar 159

5.4.2.2 Parameters. 159

5.4.2.3 Examples. 159

5.5 Attribute functions. 160

5.5.1 get_attribute. 160

5.5.1.1 Grammar 161

5.5.1.2 Parameters. 161

5.5.1.3 Examples: 161

5.5.1.4 Notes. 161

5.6 Operation functions. 161

5.6.1 get_operation_output 162

5.6.1.1 Grammar 162

5.6.1.2 Parameters. 162

5.6.1.3 Notes. 162

5.7 Navigation functions. 162

5.7.1 get_nodes_of_type. 162

5.7.1.1 Grammar 162

5.7.1.2 Parameters. 162

5.7.1.3 Returns. 163

5.8 Artifact functions. 163

5.8.1 get_artifact 163

5.8.1.1 Grammar 163

5.8.1.2 Parameters. 163

5.8.1.3 Examples. 164

5.8.1.3.1 Example: Retrieving artifact without specified location. 164

5.8.1.3.2 Example: Retrieving artifact as a local path. 164

5.8.1.3.3 Example: Retrieving artifact in a specified location. 164

5.9 Context-based Entity names (global) 165

5.9.1 Goals. 165

6        TOSCA Cloud Service Archive (CSAR) format 166

6.1 Overall Structure of a CSAR. 166

6.2 TOSCA Meta File. 166

6.2.1 Custom keynames in the TOSCA.meta file. 167

6.2.2 Example. 167

6.3 Archive without TOSCA-Metadata. 167

6.3.1 Example. 167

7        Security Considerations. 169

8        Conformance. 170

8.1 Conformance Targets. 170

8.2 Conformance Clause 1: TOSCA YAML service template. 170

8.3 Conformance Clause 2: TOSCA processor 170

8.4 Conformance Clause 3: TOSCA orchestrator 170

8.5 Conformance Clause 4: TOSCA generator 171

8.6 Conformance Clause 5: TOSCA archive. 171

Appendix A. Acknowledgments. 172

Appendix B. Example Title. 174

B.1 Subsidiary section. 174

B.1.1 Sub-subsidiary section. 174

B.1.1.1 Sub-sub-subsidiary section. 174

B.1.1.1.1 Sub-sub-sub-subsidiary section. 174

Appendix C. Revision History. 175

 

 


1      Introduction

[All text is normative unless otherwise labeled]

1.1 IPR Policy

This specification is provided under the RF on Limited Terms Mode of the OASIS IPR Policy, the mode chosen when the Technical Committee was established. For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the TC’s web page (https://www.oasis-open.org/committees/tosca/ipr.php).

1.2 Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] and [RFC8174] when, and only when, they appear in all capitals, as shown here.

1.3 Normative References

[RFC2119]               Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <http://www.rfc-editor.org/info/rfc2119>.

[RFC8174]               Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <http://www.rfc-editor.org/info/rfc8174>.

[YAML-1.2]              YAML, Version 1.2, 3rd Edition, Patched at 2009-10-01, Oren Ben-Kiki, Clark Evans, Ingy döt Net http://www.yaml.org/spec/1.2/spec.html

[YAML-TS-1.1]         Timestamp Language-Independent Type for YAML Version 1.1, Working Draft 2005-01-18, http://yaml.org/type/timestamp.html

[ISO-IEC-21320-1]    ISO/IEC 21320-1 "Document Container File — Part 1: Core", https://www.iso.org/standard/60101.html 

 

1.4 Non-Normative References

[Apache]                 Apache Server, https://httpd.apache.org/

[Chef]                     Chef, https://wiki.opscode.com/display/chef/Home

[NodeJS]                Node.js, https://nodejs.org/

[Puppet]                 Puppet, http://puppetlabs.com/

[WordPress]            WordPress, https://wordpress.org/

[Maven-Version]      Apache Maven version policy draft: https://cwiki.apache.org/confluence/display/MAVEN/Version+number+policy

[JSON-Spec]           The JSON Data Interchange Format (ECMA and IETF versions):

·         http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf

·         https://tools.ietf.org/html/rfc7158

[JSON-Schema]      JSON Schema specification:

·         http://json-schema.org/documentation.html

[XMLSpec]              XML Specification, W3C Recommendation, February 1998, http://www.w3.org/TR/1998/REC-xml-19980210

[XML Schema Part 1]    XML Schema Part 1: Structures, W3C Recommendation, October 2004, http://www.w3.org/TR/xmlschema-1/

[XML Schema Part 2]    XML Schema Part 2: Datatypes, W3C Recommendation, October 2004, http://www.w3.org/TR/xmlschema-2/

[IANA register for Hash Function Textual Names]            https://www.iana.org/assignments/hash-function-text-names/hash-function-text-names.xhtml

[Jinja2]                    Jinja2, jinja.pocoo.org/

[Twig]                     Twig, https://twig.symfony.com

 

(Note: Each reference to a separate document or artifact in this work must be listed here and must be identified as either a Normative or a Non-Normative Reference.

For all References – Normative and Non-Normative:

Recommended approach: Set up [Reference] label elements as "Bookmarks", then create hyperlinks to them within the document. (Here's how: Insert hyperlinkàPlace in this documentàscroll down to Bookmarks, select appropriate one.)

Use the "Ref" paragraph style to format references.

The proper format for citation of technical work produced by an OASIS TC (whether Standards Track or Non-Standards Track) is:

[Citation Label]  Work Product title (italicized). Edited by Albert Alston, Bob Ballston, and Calvin Carlson. Approval date (DD Month YYYY). OASIS Stage Identifier and Revision Number (e.g., OASIS Committee Specification Draft 01). Principal URI (version-specific URI, e.g., with stage component: somespec-v1.0-csd01.html). Latest version: (latest version URI, without stage identifiers).

For example:

[OpenDoc-1.2]  Open Document Format for Office Applications (OpenDocument) Version 1.2. Edited by Patrick Durusau and Michael Brauer. 19 January 2011. OASIS Committee Specification Draft 07. http://docs.oasis-open.org/office/v1.2/csd07/OpenDocument-v1.2-csd07.html. Latest version: http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html.

Reference sources:

For references to IETF RFCs, use the approved citation formats at:
http://docs.oasis-open.org/templates/ietf-rfc-list/ietf-rfc-list.html.

For references to W3C Recommendations, use the approved citation formats at:
http://docs.oasis-open.org/templates/w3c-recommendations-list/w3c-recommendations-list.html.

Remove this note before submitting for publication.)

 

2      Overview

2.1 Objective

Cloud computing can become more valuable if the creation and lifecycle management of application, infrastructure, and network services can be fully automated and supported across a variety of deployment environments. The core TOSCA specification provides a language for describing service components and their relationships using a service topology, and it provides for specifying the lifecycle management procedures that allow for creation or modification of services using orchestration processes. The combination of topology and orchestration in a Service Template describes what is needed in different environments to enable automated deployment of services and their management throughout the complete service lifecycle (e.g. scaling, patching, monitoring, etc.).

2.2 Application Domains

TOSCA can be used to specify automated lifecycle management of the following:

·         Infrastructure-as-a-Service Clouds: automate the deployment and management of workloads in IaaS clouds such as OpenStack, Amazon Web Services, Microsoft Azure, and others.

·         Cloud-native applications: deploy containerized applications and micro-services, for example by interfacing to orchestration platforms such as Kubernetes.

·         Network Functions Virtualization: define the management of Virtual Network Functions and their composition into complex network services.

·         Software Defined Networking: support on-demand creation of network services (for example SD-WAN).

·         Functions-as-a-Service: define abstract software applications without any deployment or operational considerations.

·         IoT and Edge computing: deploy services at the network edge with the goal of minimizing latency.

·         Process automation: support open and interoperable process control architectures.

This list is by no means intended to be exhaustive and only serves to demonstrate the breadth of application domains that can benefit from TOSCA’s automated lifecycle management capabilities.

2.3 Implementations

Different kinds of processors and artifacts qualify as implementations of TOSCA. Those that this specification is explicitly mentioning or referring to fall into the following categories:

·         TOSCA YAML service template (or “service template”): A YAML document artifact containing a (TOSCA) topology template (see sections 3.9 “Service template definition”) that represents a Cloud application. (see sections 3.8 “Topology template definition”)

·         TOSCA processor (or “processor”): An engine or tool that is capable of parsing and interpreting a TOSCA service template for a particular purpose. For example, the purpose could be validation, translation or visual rendering.

·         TOSCA orchestrator (also called orchestration engine): A TOSCA processor that interprets a TOSCA service template or a TOSCA CSAR in order to instantiate, deploy, and manage the described application in a Cloud.

·         TOSCA translator: A tool that translates TOSCA service templates into documents that use another language, such as Kubernetes Helm charts or Amazon CloudFormation templates.

·         TOSCA template generator: A tool that generates a TOSCA service template. An example of generator is a modeling tool capable of generating or editing a TOSCA service template (often such a tool would also be a TOSCA processor).

·         TOSCA archive (or TOSCA Cloud Service Archive, or “CSAR”): a package artifact that contains a TOSCA service template and other artifacts usable by a TOSCA orchestrator to deploy an application.

The above list is not exclusive. The above definitions should be understood as referring to and implementing TOSCA as described in this document.

2.4 Glossary

The following terms are used throughout this specification and have the following definitions when used in context of this document.

Term

Definition

Instance Model

A deployed service is a running instance of a Service Template. More precisely, the instance is derived by instantiating the Topology Template of its Service Template, most often by running a declarative workflow that is automatically generated based on the node templates and relationship templates defined in the Topology Template.

Node Template

A Node Template specifies the occurrence of a component node as part of a Topology Template. Each Node Template refers to a Node Type that defines the semantics of the node (e.g., properties, attributes, requirements, capabilities, interfaces). Node Types are defined separately for reuse purposes.

Relationship Template

A Relationship Template specifies the occurrence of a relationship between nodes in a Topology Template. Each Relationship Template refers to a Relationship Type that defines the semantics relationship (e.g., properties, attributes, interfaces, etc.). Relationship Types are defined separately for reuse purposes.

Service Template

A Service Template is typically used to specify the “topology” (or structure) and “orchestration” (or invocation of management behavior) of IT services so that they can be provisioned and managed in accordance with constraints and policies.

Specifically, TOSCA Service Templates optionally allow definitions of a TOSCA Topology Template, TOSCA types (e.g., Node, Relationship, Capability, Artifact, etc.), groupings, policies and constraints along with any input or output declarations.

Topology Model

The term Topology Model is often used synonymously with the term Topology Template with the use of “model” being prevalent when considering a Service Template’s topology definition as an abstract representation of an application or service to facilitate understanding of its functional components and by eliminating unnecessary details.

Topology Template

A Topology Template defines the structure of a service in the context of a Service Template. A Topology Template consists of a set of Node Template and Relationship Template definitions that together define the topology model of a service as a (not necessarily connected) directed graph.The term Topology Template is often used synonymously with the term Topology Model.  The distinction is that a topology template can be used to instantiate and orchestrate the model as a reusable pattern and includes all details necessary to accomplish it.

Abstract Node Template

An abstract node template is a node template that doesn’t define any implementations for the TOSCA lifecycle management operations. Service designers explicitly mark node templates as abstract using the substitute directive. TOSCA orchestrators provide implementations for abstract node templates by finding substituting templates for those node templates.

3      TOSCA core concepts

The TOSCA language introduces a YAML-based grammar for creating service templates that define the lifecycle management of application, infrastructure, and network services. The language defines a metamodel for specifying both the structure of a service as well as its management aspects. Within a service template, a Topology Template defines the structure of a service. Interfaces, Operations, and Workflows define how service elements can be created and terminated as well as how they can be managed during their whole lifetimes. Policies specify operational behavior of the service such as quality-of-service objectives, performance objectives, and security constraints, and allow for closed-loop automation. The major elements defining a service are depicted in Figure 1.

3.1 Topology Templates, Node Templates, and Relationships

Within a Service Template, a Topology Template defines the topology model of a service as a directed graph. Each node in this graph is represented by a Node Template. A Node Template specifies the presence of an entity of a specific Node Type as a component of a service. A Node Type defines the properties of such a component (via Node Type Properties) and the operations (via Interfaces) available to manipulate the component. Node Types are defined separately for reuse purposes. In a Topology template a Node Template assigns values to the properties defined in the Node Type.

Figure 1: Structural Elements of a Service Template and their Relations

For example, consider a service that consists of an application server, a process engine, and a process model. A Topology Template defining that service would include one Node Template of Node Type “application server”, another Node Template of Node Type “process engine”, and a third Node Template of Node Type “process model”. The application server Node Type defines properties like the IP address of an instance of this type, an operation for installing the application server with the corresponding IP address, and an operation for shutting down an instance of this application server. A constraint in the Node Template can specify a range of IP addresses available when making a concrete application server available.

Node templates may include one or more relationships to other node templates in the Topology Template. Relationships represent the edges in the service topology graph. The node template that includes the relationship definition is implicitly defined as the source node of the relationship and the target node is explicitly specified as part of the relationship definition.  Each relationship definition refers to a Relationship Type that defines the semantics and any properties of the relationship. Relationship Types are defined separately for reuse purposes.

In the example above, a relationship can be established from the process engine Node Template to the application server Node Template with the meaning “hosted by”, and from the process model Node Template to the process engine Node Template with meaning “deployed on”.

3.2 Interfaces, Operations, and Artifacts

Both node and relationship types may define lifecycle operations that implement the behavior an orchestration engine can invoke when instantiating a service template. For example, a node type for some software product might provide a ‘create’ operation to handle the creation of an instance of a component at runtime, or a ‘start’ or ‘stop’ operation to handle a start or stop event triggered by an orchestration engine.

Operations that are related to the same management mission (e.g. lifecycle management) are grouped together in Interfaces that are defined by node and relationship types. Just like other TOSCA entities, interfaces refer to their corresponding Interface Type that defines the group of operations that are part of the interface. Interface Types can also define notifications that represent external events that are generated by the outside world and received by the orchestrator.

The implementations of interface operations can be provided as TOSCA artifacts. An artifact represents the content needed to provide an implementation for an interface operation. A TOSCA artifact could be an executable (e.g. a script, an executable program, an image), a configuration file or data file, or something that might be needed so that another executable can run (e.g. a library). Artifacts can be of different types, for example EJBs or python scripts. The content of an artifact depends on its type. Typically, descriptive metadata (such as properties) will also be provided along with the artifact. This metadata might be needed to properly process the artifact, for example by describing the appropriate execution environment.

3.3 Workflows

A deployed service is an instance of a Service Template. More precisely, the instance is created by instantiating the Topology Template of its Service Template by running workflows that are most often automatically created by the orchestrator and that invoke the interface operations of the Node Types or the Node Templates. Orchestrators can automatically generate workflows by using the relationship between components to derive the order of component instantiation. For example, during the instantiation of a two-tier application that includes a web application that depends on a database, an orchestration engine would first invoke the ‘create’ operation on the database component to install and configure the database, and it would then invoke the ‘create’ operation of the web application to install and configure the application (which includes configuration of the database connection).

Interface operations invoked by workflows must use actual values for the various properties of the various Node Templates and Relationship Templates of the Topology Template. These values can come from input passed in by users as triggered by human interactions with the orchestrator or the templates can specify default values for some properties. For example, the application server Node Template will be instantiated by installing an actual application server at a concrete IP address considering the specified range of IP addresses. Next, the process engine Node Template will be instantiated by installing a concrete process engine on that application server (as indicated by the “hosted by” relationship template). Finally, the process model Node Template will be instantiated by deploying the process model on that process engine (as indicated by the “deployed on” relationship template).

3.4 Requirements and Capabilities

We discussed earlier how relationships are used to link node templates together into a service topology graph. However, it may not always be possible to define all node templates for a given service topology within a single service template. For example, modular design practices may dictate that different service subcomponents be modeled using separate service templates. This may result in relationships that need to be established across multiple service templates. Additionally, relationships may need to target components that already exists and do not need to be instantiated by an orchestrator. For example, relationships may reference physical resources that are managed in a resource inventory. Service topology templates may not include node templates for these resources.

TOSCA accommodates these scenarios using requirements and capabilities of node templates. A requirement expresses that one component depends on (requires) a feature provided by another component, or that a component has certain requirements against the hosting environment such as for the allocation of certain resources or the enablement of a specific mode of operation. Capabilities represent features exposed by components that can be used to fulfill requirements of other components.

Relationships are the result of fulfilling a requirement in one node template using a capability of a different node template. If both source and target node templates are defined in the same service template, service designers typically define the relationship between these node templates explicitly. Requirements that do not explicitly specify a target node must be fulfilled by the orchestrator at service deployment time. Orchestrators can take multiple service templates into account when fulfilling requirements, or they can attempt to use resources managed in an inventory, which will result in relationships that are established across service template boundaries.

Requirements and capabilities are modeled by annotating Node Types with Requirement Definitions and Capability Definitions. Capability Types are defined as reusable entities so that those definitions can be used in the context of several Node Types. Requirement definitions can specify the relationship type that will be used when creating the relationship that fulfills the requirement.

Figure 2: Requirements and Capabilities

 

Node Templates which have corresponding Node Types with Requirement Definitions or Capability Definitions will include representations of the respective Requirements and Capabilities with content specific to the respective Node Template.

Requirements can be matched in two ways as briefly indicated above: (1) requirements of a Node Template can be matched by capabilities of another Node Template in the same Service Template by connecting the respective requirement-capability-pairs via relationships; (2) requirements of a Node Template can be matched by the orchestrator, for example by allocating needed resources for a Node Template during instantiation.

3.5 Decomposition of Service Templates

TOSCA provides support for decomposing service components using the Substitution Mapping feature. For example, a Service Template for a business application that is hosted on an application server tier might focus on defining the structure and manageability behavior of the business application itself. The structure of the application server tier hosting the application can be provided in a separate Service Template built by another vendor specialized in deploying and managing application servers. This approach enables separation of concerns and re-use of common infrastructure templates.

Figure 3: Service Template Decomposition

From the point of view of a Service Template (e.g. the business application Service Template from the example above) that uses another Service Template, the other Service Template (e.g. the application server tier) “looks” like just a Node Template. During deployment, however, this Node Template can be substituted by the second Service Template if it exposes the same external façade (i.e. properties, capabilities, etc.) as the Node Template. Thus, a substitution with any Service Template that has the same facade as a certain Node Template in one Service Template becomes possible, allowing for a flexible composition of different Service Templates. This concept also allows for providing substitutable alternatives in the form of Service Templates. For example, a Service Template for a single node application server tier and a Service Template for a clustered application server tier might exist, and the appropriate option can be selected per deployment.

3.6 Policies in TOSCA

Non-functional behavior or quality-of-services are defined in TOSCA by means of policies. A Policy can express such diverse things like monitoring behavior, payment conditions, scalability, or continuous availability, for example.

A Node Template can be associated with a set of Policies collectively expressing the non-functional behavior or quality-of-services that each instance of the Node Template will expose. Each Policy specifies the actual properties of the non-functional behavior, like the concrete payment information (payment period, currency, amount etc.) about the individual instances of the Node Template.

These properties are defined by a Policy Type. Policy Types might be defined in hierarchies to properly reflect the structure of non-functional behavior or quality-of-services in particular domains. Furthermore, a Policy Type might be associated with a set of Node Types the non-functional behavior or quality-of-service it describes.

Policy Templates provide actual values of properties of the types defined by Policy Types. For example, a Policy Template for monthly payments for US customers will set the “payment period” property to “monthly” and the “currency” property to “US$”, leaving the “amount” property open. The “amount” property will be set when the corresponding Policy Template is used for a Policy within a Node Template. Thus, a Policy Template defines the invariant properties of a Policy, while the Policy sets the variant properties resulting from the actual usage of a Policy Template in a Node Template.

3.7 Archive Format for Cloud Applications

In order to support in a certain environment for the execution and management of the lifecycle of a cloud application, all corresponding artifacts have to be available in that environment. This means that beside the service template of the cloud application, the deployment artifacts and implementation artifacts have to be available in that environment. To ease the task of ensuring the availability of all of these, this specification defines a corresponding archive format called CSAR (Cloud Service ARchive).

A CSAR is a container file, i.e. it contains multiple files of possibly different file types. These files are typically organized in several subdirectories, each of which contains related files (and possibly other subdirectories etc). The organization into subdirectories and their content is specific for a particular cloud application. CSARs are zip files, typically compressed. A CSAR may contain a file called TOSCA.meta that describes the organization of the CSAR.

4      TOSCA definitions in YAML

Except for the examples, this section is normative and describes all of the YAML grammar, definitions and block structure for all keys and mappings that are defined for the TOSCA Version 2.0 specification that are needed to describe a TOSCA Service Template (in YAML).

4.1 TOSCA Metamodel

This section defines the models and the modeling goals that comprise the TOSCA Version 2.0 specification.

4.1.1 Modeling concepts and goals

TBD. Here we should have selected core concepts of TOSCA 1.0 from section “3        Core Concepts and Usage Pattern” and this section should be a more in-depth section than section 2.1 in this document.

 

4.1.2 Modeling definitions and reuse

The TOSCA metamodel includes complex definitions used in types and templates. Reuse concepts simplify the design of TOSCA templates by allowing relevant TOSCA entities to use and/or modify definitions already specified during entity type design. The following four concepts are clarified next:

·         Definition:

·         The TOSCA specification is based on defining modeling entities.

·         Entity definitions are based on different sets of keynames (with specific syntax and semantics) that are associated with values (of a specific format).

·         Derivation:

·         Specific TOSCA entities support a type definition.

·         When defining a type, it can be derived from a parent type.

·         The derivation rules describe what (keyname) definitions are inherited from the parent type and further if and how they can be expanded or modified.

·         Refinement:

·         Definitions within a type definition consist of the definition of keynames and other TOSCA entities (e.g. properties, requirements, capabilities, etc.).

·         The refinement rules pertaining to an entity describe how such entity definitions that are inherited from the parent type during a type derivation can be expanded or modified.

·         Assignment:

·         When creating a topology template, we specify several entities that are part of the template (e.g. nodes, relationships, groups, etc.).

·         When adding such an entity in the topology template, for some definitions that appear in the corresponding entity type (e.g. properties, operations, requirements, etc.) we may (or must) assign a certain specification (or value).

4.1.3 Goal of the derivation and refinement rules

The main reason for derivation and refinement rules is to create a framework useful for a consistent TOSCA type profile creation. The intuitive idea is that a derived type follows to a large extent the structure and behavior of a parent type, otherwise it would be better to define a new "not derived" type.

The guideline regarding the derivation rules is that a node of a derived type should be usable instead of a node of the parent type during the selection and substitution mechanisms. These two mechanisms are used by TOSCA templates to connect to TOSCA nodes and services defined by other TOSCA templates:

·         The selection mechanism allows a node instance created a-priori by another service template to be selected for usage (i.e. building relationships) to the current TOSCA template.

·         The substitution mechanism allows a node instance to be represented by a service created simultaneously via a substitution template.

It is relevant to emphasize the cross-template usage, as only in this case we deal with templates defined at different design time-points, with potentially different editing and maintenance restrictions.

4.1.4 Mandatory Keynames

The TOSCA metamodel includes complex definitions used in types (e.g., Node Types, Relationship Types, Capability Types, Data Types, etc.), definitions and refinements (e.g. Requirement Definitions, Capability Definitions, Property and Parameter Definitions, etc.) and templates (e.g. Service Template, Topology Template, Node Template, etc.) each of which include their own list of reserved keynames that are sometimes marked as mandatory. If a keyname is marked as mandatory it MUST be defined in that particular definition context. In some definitions, certain keywords may be mandatory depending on the value of other keywords in the definition. In that case, the keyword will be marked as conditional and the condition will be explained in the description column. Note that in the context of type definitions, types may be used to derive other types, and keyname definitions MAY be inherited from parent types (according to the derivation rules of that type entity). If a keyname definition is inherited, the derived type does not have to provide such definition.

4.2 TOSCA Service

A TOSCA Service is specified by a TOSCA Service Template.

4.2.1 Service Template definition

A TOSCA Service Template (YAML) document contains element definitions of building blocks for cloud application, or complete models of cloud applications. This section describes the top-level structural elements (TOSCA keynames) along with their grammars, which are allowed to appear in a TOSCA Service Template document.

4.2.1.1 Keynames

The following is the list of recognized keynames for a TOSCA Service Template definition:

Keyname

Mandatory

Type

Description

tosca_definitions_version

yes

string

Defines the version of the TOSCA specification the template (grammar) complies with.

profile

no

string

The optional profile name that can be used by other TOSCA service templates to import the type definitions in this document.

metadata

no

map of string

Defines a section used to declare additional metadata information.  Domain-specific TOSCA profile specifications may define keynames that are mandatory for their implementations.

description

no

string

Declares a description for this Service Template and its contents.

dsl_definitions

no

N/A

Declares optional DSL-specific definitions and conventions.  For example, in YAML, this allows defining reusable YAML macros (i.e., YAML alias anchors) for use throughout the TOSCA Service Template.

repositories

no

map of

Repository definitions

Declares the map of external repositories which contain artifacts that are referenced in the service template along with their addresses used to connect to them in order to retrieve the artifacts.

imports

no

list of

Import Definitions

Declares a list import statements pointing to external TOSCA Definitions documents. For example, these may be file location or URIs relative to the service template file within the same TOSCA CSAR file.

artifact_types

no

map of

Artifact Types

This section contains an optional map of artifact type definitions for use in the service template

data_types

no

map of

Data Types

Declares a map of optional TOSCA Data Type definitions.

capability_types

no

map of

Capability Types

This section contains an optional map of capability type definitions for use in the service template.

interface_types

no

map of

Interface Types

This section contains an optional map of interface type definitions for use in the service template.

relationship_types

no

map of

Relationship Types

This section contains a map of relationship type definitions for use in the service template.

node_types

no

map of

Node Types

This section contains a map of node type definitions for use in the service template.

group_types

no

map of

Group Types

This section contains a map of group type definitions for use in the service template.

policy_types

no

map of

Policy Types

This section contains a list of policy type definitions for use in the service template.

topology_template

no

Topology Template definition

Defines the topology template of an application or service, consisting of node templates that represent the application’s or service’s components, as well as relationship templates representing relations between the components.

4.2.1.1.1 Metadata keynames

The following is the list of recognized metadata keynames for a TOSCA Service Template definition:

Keyname

Mandatory

Type

Description

template_name

no

string

Declares a descriptive name for the template. 

template_author

no

string

Declares the author(s) or owner of the template.

template_version

no

string

Declares the version string for the template.

4.2.1.2 Grammar

The overall structure of a TOSCA Service Template and its top-level key collations using TOSCA is shown below:

# Mandatory TOSCA Definitions version string

tosca_definitions_version: <value>  # Mandatory, see section 3.1 for usage

profile: <string>                   # Optional, see section 3.2 for usage

 

# Optional metadata keyname: value pairs

metadata:

  template_name: <value>            # Optional, name of this service template

  template_author: <value>          # Optional, author of this service template

  template_version: <value>         # Optional, version of this service template

  #  More optional entries of domain or profile specific metadata keynames

 

# Optional description of the definitions inside the file.

description: <template_ description>

 

dsl_definitions:

  # map of YAML alias anchors (or macros)

 

repositories:

  # map of external repository definitions which host TOSCA artifacts

 

imports:

  # ordered list of import definitions

 

artifact_types:

  # map of artifact type definitions

 

data_types:

  # map of datatype definitions

 

capability_types:

  # map of capability type definitions

 

interface_types

  # map of interface type definitions

 

relationship_types:

  # map of relationship type definitions

 

node_types:

  # map of node type definitions

 

group_types:

  # map of group type definitions

 

policy_types:

  # map of policy type definitions

 

topology_template:

  # topology template definition of the cloud application or service

4.2.1.2.1 Requirements

·         The key “tosca_definitions_version” MUST be the first line of each Service Template.

4.2.1.2.2 Notes

·         TOSCA Service Templates do not have to contain a topology_template and MAY contain simply type definitions (e.g., Artifact, Interface, Capability, Node, Relationship Types, etc.) and be imported for use as type definitions in other TOSCA Service Templates.

4.2.1.3 Top-level keyname definitions

4.2.1.3.1 tosca_definitions_version

This mandatory element provides a means to include a reference to the TOSCA specification within the TOSCA Definitions YAML file.  It is an indicator for the version of the TOSCA grammar that should be used to parse the remainder of the document.

4.2.1.3.1.1     Keyname

tosca_definitions_version

4.2.1.3.1.2     Grammar

Single-line form:

tosca_definitions_version: <tosca_ version>

TOSCA uses the following version strings for the various revisions of the TOSCA specification:

Version String

TOSCA Specification

tosca_2_0

TOSCA Version 2.0

tosca_simple_yaml_1_3

TOSCA Simple Profile in YAML Version 1.3

tosca_simple_yaml_1_2

TOSCA Simple Profile in YAML Version 1.2

tosca_simple_yaml_1_1

TOSCA Simple Profile in YAML Version 1.1

tosca_simple_yaml_1_0

TOSCA Simple Profile in YAML Version 1.0

 

Note that it is not mandatory for TOSCA Version 2.0 implementations to support older versions of the TOSCA specifications.

4.2.1.3.1.3     Examples:

A service template designed using the TOSCA Version 2.0 specification:

tosca_definitions_version: tosca_2_0

4.2.1.3.2 profile

The profile keyword is used to assign a profile name to the collection of types defined in this service template. TOSCA implementations use profile names to register known profiles into an internal repository. These profiles can then be imported by other service templates using the profile keyword in their import statement.

4.2.1.3.2.1     Keyname

profile

4.2.1.3.2.2     Grammar

profile: <string_value>

TOSCA does not place any restrictions on the value of the profile name string. However, we encourage a Java-style reverse-domain notation with version as a best-practice convention.

4.2.1.3.2.3     Examples

The following is an example of a TOSCA Service Template that defines TOSCA Simple Profile Version 2.0 types:

profile: org.oasis-open.tosca.simple:2.0

The following defines a domain-specific profile for Kubernetes:

profile: io.kubernetes:1.18

4.2.1.3.3 metadata

This keyname is used to associate domain-specific metadata with the Service Template.  The metadata keyname allows a declaration of a map of keynames with string values.

4.2.1.3.3.1     Keyname

metadata

4.2.1.3.3.2     Grammar

metadata:

  <map_of_string_values>

4.2.1.3.3.3     Example

metadata:

  creation_date: 2015-04-14

  date_updated: 2015-05-01

  status: developmental 

4.2.1.3.4 template_name

This optional metadata keyname can be used to declare the name of service template as a single-line string value.

4.2.1.3.4.1     Keyname

template_name

4.2.1.3.4.2     Grammar

template_name: <name string>

4.2.1.3.4.3     Example

template_name: My service template

4.2.1.3.5 template_author

This optional metadata keyname can be used to declare the author(s) of the service template as a single-line string value.

4.2.1.3.5.1     Keyname

template_author

4.2.1.3.5.2     Grammar

template_author: <author string>

4.2.1.3.5.3     Example

template_author: OASIS TOSCA TC

4.2.1.3.6 template_version

This optional metadata keyname can be used to declare a domain specific version of the service template as a single-line string value.

4.2.1.3.6.1     Keyname

template_version

4.2.1.3.6.2     Grammar

template_version: <version>

4.2.1.3.6.3     Example

template_version: 2.0.17

4.2.1.3.6.4     Notes:

·         Some service templates are designed to be referenced and reused by other service templates and have a lifecycle of their own.  Therefore, in these cases, a template_version value SHOULD be included and used in conjunction with a unique template_name value to enable lifecycle management of the service template and its contents. 

4.2.1.3.7 description

This optional keyname provides a means to include single or multiline descriptions within a TOSCA template as a scalar string value.

4.2.1.3.7.1     Keyname

description

4.2.1.3.8 dsl_definitions

This optional keyname provides a section to define macros (e.g., YAML-style macros when using the TOSCA specification).

4.2.1.3.8.1     Keyname

dsl_definitions

4.2.1.3.8.2     Grammar

dsl_definitions:

   <dsl_definition_1>

   ...

   <dsl_definition_n>

4.2.1.3.8.3     Example

dsl_definitions:

    ubuntu_image_props: &ubuntu_image_props

      architecture: x86_64

      type: linux

      distribution: ubuntu

      os_version: 14.04

 

    redhat_image_props: &redhat_image_props

      architecture: x86_64

      type: linux

      distribution: rhel

      os_version: 6.6

4.2.1.3.9 repositories

This optional keyname provides a section to define external repositories which may contain artifacts or other TOSCA Service Templates which might be referenced or imported by the TOSCA Service Template definition.

4.2.1.3.9.1     Keyname

repositories

4.2.1.3.9.2     Grammar

repositories:

   <repository_definition_1>

   ...

   <repository_definition_n>

4.2.1.3.9.3     Example

repositories:

  my_project_artifact_repo:

    description: development repository for TAR archives and Bash scripts

    url: http://mycompany.com/repository/myproject/

4.2.1.3.10 imports

This optional keyname provides a way to import a block sequence of one or more TOSCA Definitions documents.  TOSCA Definitions documents can contain reusable TOSCA type definitions (e.g., Node Types, Relationship Types, Artifact Types, etc.) defined by other authors. This mechanism provides an effective way for companies and organizations to define domain-specific types and/or describe their software applications for reuse in other TOSCA Service Templates.

4.2.1.3.10.1   Keyname

imports

4.2.1.3.10.2   Grammar

imports:

   - <import_definition_1>

   - ...

   - <import_definition_n>

4.2.1.3.10.3   Example

# An example import of definitions files from a location relative to the

# file location of the service template declaring the import.

imports:

  - relative_path/my_defns/my_typesdefs_1.yaml

  - url: my_defns/my_typesdefs_n.yaml   

    repository: my_company_repo

    namespace: mycompany

4.2.1.3.11 artifact_types

This optional keyname lists the Artifact Types that are defined by this Service Template.

4.2.1.3.11.1   Keyname

artifact_types

4.2.1.3.11.2   Grammar

artifact_types:

  <artifact_type_defn_1>

  ...

  <artifact type_defn_n>

4.2.1.3.11.3   Example

artifact_types:

  mycompany.artifacttypes.myFileType:

    derived_from: tosca.artifacts.File

4.2.1.3.12 data_types

This optional keyname provides a section to define new data types in TOSCA.

4.2.1.3.12.1   Keyname

data_types

4.2.1.3.12.2   Grammar

data_types:

   <tosca_datatype_def_1>

   ...

   <tosca_datatype_def_n>

4.2.1.3.12.3   Example

data_types:

  # A complex datatype definition

  simple_contactinfo_type:

    properties:

      name:

        type: string

      email:

        type: string

      phone:

        type: string

 

  # datatype definition derived from an existing type

  full_contact_info:

    derived_from: simple_contact_info

    properties:

      street_address:

        type: string

      city:

        type: string

      state:

        type: string

      postalcode:

        type: string

4.2.1.3.13 capability_types

This optional keyname lists the Capability Types that provide the reusable type definitions that can be used to describe features of Node Templates or Node Types that can be used to fulfill requirements of other nodes.

4.2.1.3.13.1   Keyname

capability_types

4.2.1.3.13.2   Grammar

capability_types:

  <capability_type_defn_1>

  ...

  <capability type_defn_n>

4.2.1.3.13.3   Example

capability_types:

  mycompany.mytypes.myCustomEndpoint:

    derived_from: tosca.capabilities.Endpoint

    properties:

      # more details ...

 

  mycompany.mytypes.myCustomFeature:

    derived_from: tosca.capabilities.Feature

    properties:

      # more details ...

4.2.1.3.14 interface_types

This optional keyname lists the Interface Types that provide the reusable type definitions that can be used to describe operations exposed by TOSCA entities such as Relationship Types and Node Types.

4.2.1.3.14.1   Keyname

interface_types

4.2.1.3.14.2   Grammar

interface_types:

  <interface_type_defn_1>

  ...

  <interface type_defn_n>

4.2.1.3.14.3   Example

interface_types:

  mycompany.interfaces.service.Signal:

    operations:

      signal_begin_receive:

        description: Operation to signal start of some message processing.

      signal_end_receive:

        description: Operation to signal end of some message processed.

4.2.1.3.15 relationship_types

This optional keyname lists the Relationship Types that provide the reusable type definitions that can be used to describe dependent relationships between Node Templates or Node Types.

4.2.1.3.15.1   Keyname

relationship_types

4.2.1.3.15.2   Grammar

relationship_types:

  <relationship_type_defn_1>

  ...

  <relationship type_defn_n>

4.2.1.3.15.3   Example

relationship_types:

  mycompany.mytypes.myCustomClientServerType:

    derived_from: tosca.relationships.HostedOn

    properties:

      # more details ...

  mycompany.mytypes.myCustomConnectionType:

    derived_from: tosca.relationships.ConnectsTo

    properties:

      # more details ...

4.2.1.3.16 node_types

This optional keyname lists the Node Types that provide the reusable type definitions for software components that Node Templates can be based upon.

4.2.1.3.16.1   Keyname

node_types

4.2.1.3.16.2   Grammar

node_types:

  <node_type_defn_1>

  ...

  <node_type_defn_n>

4.2.1.3.16.3   Example

node_types:

  my_webapp_node_type:

    derived_from: WebApplication

    properties:

      my_port:

        type: integer

 

  my_database_node_type:

    derived_from: Database

    capabilities:

      mytypes.myfeatures.transactSQL

4.2.1.3.17 group_types

This optional keyname lists the Group Types that are defined by this Service Template.

4.2.1.3.17.1   Keyname

group_types

4.2.1.3.17.2   Grammar

group_types:

  <group_type_defn_1>

  ...

  <group type_defn_n>

4.2.1.3.17.3   Example

group_types:

  mycompany.mytypes.myScalingGroup:

    derived_from: tosca.groups.Root

4.2.1.3.18 policy_types

This optional keyname lists the Policy Types that are defined by this Service Template.

4.2.1.3.18.1   Keyname

policy_types

4.2.1.3.18.2   Grammar

policy_types:

  <policy_type_defn_1>

  ...

  <policy type_defn_n>

4.2.1.3.18.3   Example

policy_types:

  mycompany.mytypes.myScalingPolicy:

    derived_from: tosca.policies.Scaling

4.2.2 Profiles

A profile is a named collection of TOSCA type definitions, artifacts, and topology templates that logically belong together. One can think of TOSCA profiles as platform libraries exposed by the TOSCA orchestration platform and made available to all services that use that platform. Profiles in TOSCA are similar to libraries in traditional computer programming languages.

Profiles contain a collection of pre-defined components that can be used by service designers to compose complex service templates, Entities defined in TOSCA profiles are used as follows:

·         Types defined in a TOSCA profile provide reusable building blocks from which services can be composed.

·         Artifacts and Topology Templates defined in a TOSCA profile provide implementations for the TOSCA types defined in the profile. Whereas artifacts provide interface operation implementations for concrete nodes and relationships, topology templates defined in TOSCA profiles are intended to implement abstract nodes through substitution mapping.

TOSCA implementations can organize supported profiles in a catalog to allow other service templates to import those profiles by profile name. This avoids the need for every service that use those profiles to include the profile type definitions in their service definition packages.

4.2.2.1 Examples

Version 1.x of the TOSCA specification included a collection of normative type definitions for building cloud applications. This collection of type definitions was defined as the TOSCA Simple Profile. Implementations of TOSCA Version 1.x were expected to include implementations for the types defined in the TOSCA Simple Profile, and service templates defined using TOSCA Version 1.x implicitly imported the corresponding TOSCA Simple Profile version.

Starting with TOSCA Version 2.0, the TOSCA Simple Profile type definitions are no longer part of the TOSCA standard and support for the TOSCA Simple Profile is no longer mandatory. Instead, the definition of the TOSCA Simple Profile has been moved to an OASIS Open Github repository with the goal of being maintained by the TOSCA community and governed as an open source project. In addition, TOSCA Version 2.0 removes the implicit import of the TOSCA Simple Profile. Service templates that want to continue to use the TOSCA Simple Profile type definitions must explicitly import that profile.

Eliminating mandatory support for the TOSCA Simple Profile makes it easier for TOSCA to be used for additional application domains. For example, the European Telecommunications Standards Institute (ETSI) has introduced a TOSCA profile for Network Functions Virtualization defines Virtualized Network Function Descriptors (VNFDs), Network Service Descriptors (NSDs) and a Physical Network Function Descriptors (PNFDs).

We should give a couple of additional examples.

4.2.2.2 Defining Profiles

A TOSCA Service Template defines a TOSCA Profile if the profile keyword is used in that service template. The value of the profile keyword defines the name for the profile, which allows other service templates to import the profile by name.

TOSCA does not impose naming conventions for profile names, but as a best practice we recommend a domain-name-like structure as used for Java package naming. For example, the following profile statement is used to define TOSCA Simple Profile Version 2.0 types:

profile: org.oasis-open.tosca.simple:2.0

This section must further define rules for defining profiles. For example:

-       what happens if a file imported by a template that defines a profile in turn defines a profile as well?

-       what happens if a template imports a file that defines a profile? Is that an error?

·         TOSCA Service Templates that define a profile (i.e. that contain a profile keyname) MUST NOT also define a topology_template.

·         TOSCA Topology Templates defined in profiles MUST advertise substitution mapping to allow them to be used as implementations for abstract nodes defined using profile types.

4.2.2.3 Profile Versions

TOSCA Profiles are likely to evolve over time and profile designers will release different versions of their profiles. For example, the TOSCA Simple Profile has gone through minor revisions with each release of the TOSCA Version 1 standard. It is expected that profile designers will use a version qualifier to distinguish between different versions of their profiles, and service template designers must use the proper string name to make sure they import the desired versions of these profiles.

Do we impose a structure on profile names that distinguishes the version qualifier from the base profile name? If so, is there a specific separator character or string (in which case the use of the separator must be escaped somehow (or disallowed) in profile names.

When multiple versions of the same profile exist, it is possibly that service templates could mix and match different versions of a profile in the same service definition. The following code snippets illustrate this scenario:

Assume a profile designer creates version 1 of a base profile that defines (among other things) a Host capability type and a corresponding HostedOn relationship type as follows:

tosca_definitions_version: tosca_2_0

profile: org.base.v1

capability_types:

  Host:

    description: Hosting capability

relationship_types:

  HostedOn:

    valid_target_types: [ Host ]

Now let’s assume a different profile designer creates a platform-specific profile that defines (among other things) a Platform node type. The Platform node type defines a capability of type Host. Since the Host capability is defined in the org.base.v1 profile, that profile must be imported as shown in the snippet below:

tosca_definitions_version: tosca_2_0

profile: org.platform

imports:

  - profile: org.base.v1

    namespace: p1

node_types:

  Platform:

    capabilities:

      host:

        type: p1:Host

At some later point of time, the original profile designer updates the org.base profile to Version 2. The updated version of this profile just adds a Credential data type (in addition to defining the Host capability type and the HostedOn relationship type), as follows:

tosca_definitions_version: tosca_2_0

profile: org.base.v2

capability_types:

  Host:

    description: Hosting capability

relationship_types:

  HostedOn:

    valid_target_types: [ Host ]

data_types:

  Credential:

    properties:

      key:

        type: string

Finally, let’s assume a service designer creates a template for a service that is to be hosted on the platform defined in the org.platform profile. The template introduces a Service node type that has a requirement for the platform’s Host capability. It also has a credential property of type Credential as defined in org.base.v2:

tosca_definitions_version: tosca_2_0

imports:

  - profile: org.base.v2

    namespace: p2

  - profile: org.platform

    namespace_prefix: pl

node_types:

  Service:

    properties:

      credential:

        type: p2:Credential

    requirements:

      - host:

          capability: p2:Host

          relationship: p2:HostedOn

topology_template:

  node_templates:

    service:

      type: Service

      properties:

        credential:

          key: password

      requirements:

        - host: platform

    platform:

      type: pl:Platform

 

This service template is invalid, since the platform node template does not define a capability of a type that is compatible with the valid_target_types specified by the host requirement in the service node template. TOSCA grammar extensions are needed to specify that the Host capability type defined in org.base.v2 is the same as the Host capability type defined in org.base.v1

The example in this section illustrates a general version compatibility issue that exists when different versions of the same profile are used in a TOSCA service.

A number of suggestions for these extensions are currently being discussed. Grammar extensions will be included in this document one they are agreed upon.

4.2.3 Imports and Namespaces

4.2.3.1 Import definition

An import definition 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.

4.2.3.1.1 Keynames

The following is the list of recognized keynames for a TOSCA import definition:

Keyname

Mandatory

Type

Description

url

conditional

string

The url that references a service template to be imported. An import statement must include either a url or a profile, but not both.

profile

conditional

string

The profile name that references a named type profile to be imported. An import statement must include either a url or a profile, but not both.

repository

conditional

string

The optional symbolic name of the repository definition where the imported file can be found as a string. The repository name can only be used when a url is specified.

namespace

no

string

The optional namespace into which to import the type definitions from the imported template or profile.

4.2.3.1.2 Grammar

Import definitions have one the following grammars:

4.2.3.1.2.1     Single-line grammar:

When using the single-line grammar, the url keyword is assumed:

imports:

  - <URI_1>

  - <URI_2>

4.2.3.1.2.2     Multi-line grammar

The following multi-line grammar can be used for importing service template files:

imports: 

  - url: <file_URI>  

    repository: <repository_name>

    namespace: <namespace_name>

The following multi-line grammar can be used for importing type profiles:

imports: 

  - profile: <profile_name>  

    namespace: <namespace_name>

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         file_uri: contains the URL that references the service template file to be imported as a string.

·         repository_name: represents the optional symbolic name of the repository definition where the imported file can be found as a string.

·         profile_name: the name of the well-known profile to be imported.

·         namespace_name: represents the optional name of the namespace into which type definitions will be imported. The namespace name can be used to form a namespace-qualified name that uniquely references type definitions from the imported file or profile. If no namespace name is specified, type definitions will be imported into the root namespace.

4.2.3.1.3 Import processing rules

TOSCA Orchestrators, Processors and tooling SHOULD handle import statements as follows:

4.2.3.1.3.1     Importing profiles

If the profile keyname is used in the import definition, then the TOSCA orchestrator or processor SHOULD attempt to import the profile by name:

·         If <profile_name> represents the name of a profile that is known to the TOSCA orchestrator or processor, then it SHOULD cause the Profile Type definitions to be imported.

·         If <profile_name> is not known, the import SHOULD be considered a failure.

4.2.3.1.3.2     Importing service templates

If the url keyname is used, the TOSCA orchestrator or processor SHOULD attempt to import the file referenced by <file_URI> as follows:

·         If the <file_URI> includes a URL scheme (e.g. file: or https:) then<file_URI> is considered to be a network accessible resource. If the resource identified by <file_URL> represents a valid TOSCA Service Template, then it SHOULD cause the remote Service Template to be imported.

      Note that if in addition to a URL with a URL scheme, the import definition also specifies a <repository_name> (using the repository key), then that import definition SHOULD be considered invalid.

·         If the <file_URI> does not include a URL scheme, it is a considered a relative path URL. The TOSCA orchestrator or processor SHOULD handle such a <file_URI> as follows:

      If the import definition also specifies a <repository_name> (using the repository keyname), then <file_URI> refers to the path name of a file relative to the root of the named repository

      If the import definition does not specify a <profile_name> then <file_URI> refers to a TOSCA service template located in the repository that contains the Service Template file that includes the import definition. If the importing service template is located in a CSAR file, then that CSAR file should be treated as the repository in which to locate the service template file that must be imported.

·         If <file_URI> starts with a leading slash (‘/’) then <file_URI> specifies a path name starting at the root of the repository.

·         If <file_URI> does not start with a leading slash, then <file_URI> specifies a path that is relative to the importing document’s location within the repository. Double dot notation (‘../’) can be used to refer to parent directories in a file path name.

·         If <file_URI> does not reference a valid TOSCA Service Template file, then the import SHOULD be considered a failure.

4.2.3.1.4 Examples

The first example shows how to use an import definition import a well-known profile by name:

# Importing a profile

imports:

- profile: org.oasis-open.tosca.simple:2.0

The next example shows an import definition used to import a network-accessible resource using the https protocol:

# Absolute URL with scheme

imports:

- url: https://myorg.org/tosca/types/mytypes.yaml

The following represents shows an import definition used to import a service template in the same repository as the importing template. The template to be imported is referenced using a path name that is relative to the location of the importing template. This example shows the short notation:

# Short notation supported

imports:

- ../types/mytypes.yaml

The following shows the same example but using the long notation:

# Long notation

imports:

- url: ../types/mytypes.yaml

The following example shows how to import service templates using absolute path names (i.e. path names that start at the root of the repository):

# Root file

imports:

- url: /base.yaml

And finally, the following shows how to import templates from a repository that is different than the repository that contains the importing template:

# External repository

imports:

- url: types/mytypes.yaml

  repository: my_repository

4.2.3.2 Namespaces

When importing service templates or type profiles, there exists a possibility for namespace collision. For example, an imported template may define a node type with the same name as a node type defined in the importing template.

For example, let say we have two Service Templates, A and B, both of which contain a Node Type definition for “MyNode”:

Service Template B

tosca_definitions_version: tosca_2_0

description: Service Template B

 

node_types:

  MyNode:

    derived_from: SoftwareComponent

    properties:

      # omitted here for brevity

    capabilities:

      # omitted here for brevity

Service Template A

tosca_definitions_version: tosca_2_0

description: Service Template A

 

imports:

  - url: /templates/ServiceTemplateB.yaml

 

node_types:

  MyNode:

    derived_from: Root

    properties:

      # omitted here for brevity

    capabilities:

      # omitted here for brevity

 

topology_template:

  node_templates:

    my_node:

      type: MyNode

As you can see, Service Template A imports Service Template B which results in duplicate definitions of the MyNode node type. In this example, it is not clear which type is intended to be used for the my_node node template.

To address this issue, TOSCA uses the concept of namespaces:

·         Each TOSCA service template defines a root namespace for all type definitions defined in that template. Root namespaces are unnamed.

·         When a TOSCA service template imports other templates, it has two options:

      It can import any type definitions from the imported templates into its root namespace

      Or it can import type definitions from the imported templates into a separate named namespace. This is done using the namespace keyname in the associated import statement. When using types imported into a named namespace, those type names must be qualified using the namespace name.

The following snippets update the previous example using namespaces to disambiguate between the two MyNode type definitions. This first snippet shows the scenario where the MyNode definition from Service Template B is intended to be used:

tosca_definitions_version: tosca_2_0

description: Service Template A

 

imports:

  - url: /templates/ServiceTemplateB.yaml

    namespace: templateB

 

node_types:

  MyNode:

    derived_from: Root

    properties:

      # omitted here for brevity

    capabilities:

      # omitted here for brevity

 

topology_template:

  node_templates:

    my_node:

      type: templateB:MyNode

The second snippet shows the scenario where the MyNode definition from Service Template A is intended to be used:

tosca_definitions_version: tosca_2_0

description: Service Template A

 

imports:

  - url: /templates/ServiceTemplateB.yaml

    namespace: templateB

 

node_types:

  MyNode:

    derived_from: Root

    properties:

      # omitted here for brevity

    capabilities:

      # omitted here for brevity

 

topology_template:

  node_templates:

    my_node:

      type: MyNode

 

In many scenarios, imported service templates may in turn import their own service templates, and introduce their own namespaces to avoid name collisisions. In those scenarios, nested namespace names are used to uniquely identify type definitions in the import tree.

The following example shows a mytypes.yaml service template that imports a Kubernetes profile into the k8s namespace. It defines a SuperPod node type that derives from the Pod node type defined in that Kubernetes profile:

tosca_definitions_version: tosca_2_0

description: mytypes.yaml

 

imports:

- profile: io.kubernetes:1.18

  namespace: k8s

 

node_types:

  MyNode: {}

  SuperPod:

    derived_from: k8s:Pod

The mytypes.yaml template is then imported into the main.yaml service template, which defines both a node template of type SuperPod as well as a node template of type Pod. Nested namespace names are used to identify the Pod node type from the Kubernetes profile:

tosca_definitions_version: tosca_2_0

description: main.yaml

 

imports:

- url: mytypes.yaml

  namespace: my

 

topology_template:

  node_templates:

    mynode:

      type: my:MyType

    pod:

      type: my:k8s:Pod

4.2.3.2.1 Additional Requirements

Within each namespace, names must be unique. This means the following:

·         Duplicate local names (i.e., within the same Service Template SHALL be considered an error.  These include, but are not limited to duplicate names found for the following definitions:

      Repositories (repositories)

      Data Types (data_types)

      Node Types (node_types)

      Relationship Types (relationship_types)

      Capability Types (capability_types)

      Artifact Types (artifact_types)

      Interface Types (interface_types)

·         Duplicate Template names within a Service Template’s Topology Template SHALL be considered an error.  These include, but are not limited to duplicate names found for the following template types:

      Node Templates (node_templates)

      Relationship Templates (relationship_templates)

      Inputs (inputs)

      Outputs (outputs)

·         Duplicate names for the following keynames within Types or Templates SHALL be considered an error.  These include, but are not limited to duplicate names found for the following keynames:

      Properties (properties)

      Attributes (attributes)

      Artifacts (artifacts)

      Requirements (requirements)

      Capabilities (capabilities)

      Interfaces (interfaces)

      Policies (policies)

      Groups (groups)

4.2.3.3 Repository definition

A repository definition defines an external repository which contains deployment and implementation artifacts that are referenced within the TOSCA Service Template.

4.2.3.3.1 Keynames

The following is the list of recognized keynames for a TOSCA repository definition:

Keyname

Mandatory

Type

Description

description

no

string

The optional description for the repository.

url

yes

string

The mandatory URL or network address used to access the repository.

4.2.3.3.2 Grammar

Repository definitions have one the following grammars:

4.2.3.3.2.1     Single-line grammar:

<repository_name>: <repository_address>

4.2.3.3.2.2     Multi-line grammar

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         repository_name: represents the mandatory symbolic name of the repository as a string.

·         repository_description: contains an optional description of the repository.

·         repository_address: represents the mandatory URL of the repository as a string.

4.2.3.3.3 Example

The following represents a repository definition:

repositories:

  my_code_repo:

    description: My project’s code repository in GitHub

    url: https://github.com/my-project/

 

4.2.4 Additional information definitions

4.2.4.1 Description definition

This optional element provides a means include single or multiline descriptions within a TOSCA template as a scalar string value.

4.2.4.1.1 Keyname

The following keyname is used to provide a description within the TOSCA specification:

description

4.2.4.1.2 Grammar

Description definitions have the following grammar:

description: <description_string>

4.2.4.1.3 Examples

Simple descriptions are treated as a single literal that includes the entire contents of the line that immediately follows the description key:

description: This is an example of a single line description (no folding).

The YAML “folded” style may also be used for multi-line descriptions which “folds” line breaks as space characters.

description: >

  This is an example of a multi-line description using YAML. It permits for line       

  breaks for easier readability...

 

  if needed.  However, (multiple) line breaks are folded into a single space  

  character when processed into a single string value.

4.2.4.1.4 Notes

·         Use of “folded” style is discouraged for the YAML string type apart from when used with the description keyname.

4.2.4.2 Metadata

This optional element provides a means to include optional metadata as a map of strings.

4.2.4.2.1 Keyname

The following keyname is used to provide metadata within the TOSCA specification:

metadata

4.2.4.2.2 Grammar

Metadata definitions have the following grammar:

metadata:

  map of <string>

4.2.4.2.3 Examples

metadata:

  foo1: bar1

  foo2: bar2

  ...

4.2.4.2.4 Notes

·         Data provided within metadata, wherever it appears, MAY be ignored by TOSCA Orchestrators and SHOULD NOT affect runtime behavior.

4.2.4.3 DSL Definitions

TBD.

 

4.2.5 Type definitions

TOSCA provides a type system to describe possible building blocks to construct a topology template (i.e. for the nodes, relationship, group and policy templates, and the data, capabilities, interfaces, and artifacts used in the node and relationship templates). TOSCA types are reusable TOSCA entities and are defined in their specific sections in the service template, see Section 4.2.1 Service Template definition.

Next, in Section 4.2.5.2 Common keynames in type definitions we present the definitions of common keynames that are used by all TOSCA types. Type-specific definitions for the different TOSCA type entities are presented further in the document:

·         Node Type in Section 4.3.1 Node Type.

·         Relationship Type in Section 4.3.3 Relationship Type.

·         Interface Type in Section 4.3.6.1 Interface Type.

·         Capability Type in Section 4.3.5.1 Capability Type.

·         Requirement Type in Section 4.3.5.4 Requirement Type.

·         Data Type in Section 4.4.4 Data Type.

·         Artifact Type in Section 4.3.7.1 Artifact Type.

·         Group Type in Section 4.6.1 Group Type.

·         Policy Type in Section 4.6.3 Policy Type.

4.2.5.1 General derivation and refinement rules

To simplify type creation and to promote type extensibility TOSCA allows the definition of a new type (the derived type) based on another type (the parent type). The derivation process can be applied recursively, where a type may be derived from a long list of ancestor types (the parent, the parent of the parent, etc).

Unless specifically stated in the derivation rules, when deriving new types from parent types the keyname definitions are inherited from the parent type. Moreover, the inherited definitions may be refined according to the derivation rules of that particular type entity.

For definitions that are not inherited, a new definition MUST be provided (if the keyname is mandatory) or MAY be provided (if the keyname is not mandatory). If not provided, the keyname remains undefined. For definitions that are inherited, a refinement of the inherited definition is not mandatory even for mandatory keynames (since it has been inherited). A definition refinement that is exactly the same as the definition in the parent type does not change in any way the inherited definition. While unnecessary, it is not wrong.

The following are some generic derivation rules used during type derivation (the specific rules of each TOSCA type entity are presented in their respective sections):

·         If not refined, usually a keyname/entity definition, is inherited unchanged from the parent type, unless explicitly specified in the rules that it is “not inherited”.

·         New entities (such as properties, attributes, capabilities, requirements, interfaces, operations, notification, parameters) may be added during derivation.

·         Already defined entities that have a type may be redefined to have a type derived from the original type.

·         New constraints are added to already defined keynames/entities (i.e. the defined constraints do not replace the constraints defined in the parent type but are added to them).

·         Some definitions must be totally flexible, so they will overwrite the definition in the parent type.

·         Some definitions must not be changed at all once defined (i.e. they represent some sort of “signature”).

 

4.2.5.2 Common keynames in type definitions

The following keynames are used by all TOSCA type entities in the same way. This section serves to define them at once.

4.2.5.2.1 Keynames

The following is the list of recognized keynames used by all TOSCA type definitions:

Keyname

Mandatory

Type

Description

derived_from

no

string

An optional parent type name from which this type derives.

version

no

version

An optional version for the type definition.

metadata

no

map of string

Defines a section used to declare additional metadata information.

description

no

string

An optional description for the type.

4.2.5.2.2 Grammar

The common keynames in type definitions have the following grammar:

<type_name>:

  derived_from: <parent_type_name>

  version: <version_number>

  metadata:

    <metadata_map>

  description: <type_description>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         parent_type_name: represents the optional parent type name.

·         version_number: represents the optional TOSCA version number for the type.

·         entity_description: represents the optional description string for the type.

·         metadata_map: represents the optional metadata map of string.

4.2.5.2.3 Derivation rules

During type derivation the common keyname definitions use the following rules:

·         derived_from: obviously, the definition is not inherited from the parent type. If not defined, it remains undefined and this type does not derive from another type. If defined, then this type derives from another type, and all its keyname definitions must respect the derivation rules of the type entity.

·         version: the definition is not inherited from the parent type. If undefined, it remains undefined.

·         metadata: the definition is not inherited from the parent type. If undefined, it remains undefined.

·         description: the definition is not inherited from the parent type. If undefined, it remains undefined.

 

4.2.6 Topology Template definition

This section defines the topology template of a cloud application. The main ingredients of the topology template are node templates representing components of the application and relationship templates representing links between the components. These elements are defined in the nested node_templates section and the nested relationship_templates sections, respectively.  Furthermore, a topology template allows for defining input parameters, output parameters as well as grouping of node templates.

4.2.6.1 Keynames

The following is the list of recognized keynames for a TOSCA Topology Template:

Keyname

Mandatory

Type

Description

description

no

string

The optional description for the Topology Template.

inputs

no

map of

parameter definitions

An optional map of input parameters (i.e., as parameter definitions) for the Topology Template.

node_templates

yes

map of

node templates

An mandatory map of node template definitions for the Topology Template.

relationship_templates

no

map of

relationship templates

An optional map of relationship templates for the Topology Template.

groups

no

map of

group definitions

An optional map of Group definitions whose members are node templates defined within this same Topology Template.

policies

no

list of

policy definitions

An optional list of Policy definitions for the Topology Template.

outputs

no

map of

parameter definitions

An optional map of output parameters (i.e., as parameter definitions) for the Topology Template.

substitution_mappings

no

substitution_mapping

An optional declaration that exports the topology template as an implementation of a Node type.

 

This also includes the mappings between the external Node Types capabilities and requirements to existing implementations of those capabilities and requirements on Node templates declared within the topology template.

workflows

no

map of imperative workflow definitions

An optional map of imperative workflow definition for the Topology Template.

4.2.6.2 Grammar

The overall grammar of the topology_template section is shown below.Detailed grammar definitions are provided in subsequent subsections.

topology_template:

  description: <template_description>

  inputs: <input_parameters>

  outputs: <output_parameters>

  node_templates: <node_templates>

  relationship_templates: <relationship_templates>

  groups: <group_definitions>

  policies:

    - <policy_definition_list>

  workflows: <workflows>

  # Optional declaration that exports the Topology Template

  # as an implementation of a Node Type.

  substitution_mappings:

    <substitution_mappings>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         template_description: represents the optional description string for Topology Template.

·         input_parameters: represents the optional map of input parameter definitions for the Topology Template.

·         output_parameters: represents the optional map of output parameter definitions for the Topology Template.

·         group_definitions: represents the optional map of group definitions whose members are node templates that also are defined within this Topology Template.

·         policy_definition_list: represents the optional list of sequenced policy definitions for the Topology Template.

·         workflows: represents the optional map of imperative workflow definitions for the Topology Template.

·         node_templates: represents the mandatory map of node template definitions for the Topology Template.

·         relationship_templates: represents the optional map of relationship templates for the Topology Template.

·         node_type_name: represents the optional name of a Node Type that the Topology Template implements as part of the substitution_mappings.

·         map_of_capability_mappings_to_expose: represents the mappings that expose internal capabilities from node templates (within the topology template) as capabilities of the Node Type definition that is declared as part of the substitution_mappings.

·         map_of_requirement_mappings_to_expose: represents the mappings of link requirements of the Node Type definition that is declared as part of the substitution_mappings to internal requirements implementations within node templates (declared within the topology template).

More detailed explanations for each of the Topology Template grammar’s keynames appears in the sections below.

4.2.6.2.1 inputs

The inputs section provides a means to define parameters using TOSCA parameter definitions, their allowed values via constraints and default values within a TOSCA template. Input parameters defined in the inputs section of a topology template can be mapped to properties of node templates or relationship templates within the same topology template and can thus be used for parameterizing the instantiation of the topology template.

When deploying a service from the service template, values must be provided for all mandatory input parameters that have no default value defined. If no input is provided, then the default value is used.

4.2.6.2.1.1     Grammar

The grammar of the inputs section is as follows:

inputs:

  <parameter_definitions>

4.2.6.2.1.2     Examples

This section provides a set of examples for the single elements of a topology template.

Simple inputs example without any constraints:

inputs:

  fooName:

    type: string

    description: Simple string typed parameter definition with no constraints.

    default: bar

Example of inputs with constraints:

inputs:

  SiteName:

    type: string

    description: string typed parameter definition with constraints

    default: My Site

    constraints:

      - min_length: 9

4.2.6.2.2 node_templates

The node_templates section lists the Node Templates that describe the (software) components that are used to compose cloud applications.

4.2.6.2.2.1     grammar

The grammar of the node_templates section is a follows:

node_templates:

  <node_template_defn_1>

  ...

  <node_template_defn_n>

4.2.6.2.2.2     Example

Example of node_templates section:

node_templates:

  my_webapp_node_template:

    type: WebApplication

 

  my_database_node_template:

    type: Database

4.2.6.2.3 relationship_templates

The relationship_templates section lists the Relationship Templates that describe the relations between components that are used to compose cloud applications.

Note that in TOSCA, the explicit definition of relationship templates as it was required in TOSCA v1.0 is optional, since relationships between nodes get implicitly defined by referencing other node templates in the requirements sections of node templates.

4.2.6.2.3.1     Grammar

The grammar of the relationship_templates section is as follows:

relationship_templates:

  <relationship_template_defn_1>

  ...

  <relationship_template_defn_n>

4.2.6.2.3.2     Example

Example of relationship_templates section:

relationship_templates:

  my_connectsto_relationship:

    type: tosca.relationships.ConnectsTo

    interfaces:

      Configure:

        inputs:

          speed: { get_attribute: [ SOURCE, connect_speed ] }     

4.2.6.2.4 outputs

The outputs section provides a means to define the output parameters that are available from a TOSCA service template. It allows for exposing attributes of node templates or relationship templates within the containing topology_template to users of a service.

4.2.6.2.4.1     Grammar

The grammar of the outputs section is as follows:

outputs:

  <parameter_definitions>

4.2.6.2.4.2     Example

Example of the outputs section:

outputs:

  server_address:

    description: The first private IP address for the provisioned server.

    value: { get_attribute: [ node5, networks, private, addresses, 0 ] }

4.2.6.2.5 groups

The groups section allows for grouping one or more node templates within a TOSCA Service Template and for assigning special attributes like policies to the group.

4.2.6.2.5.1     Grammar

The grammar of the groups section is as follows:

groups:

  <group_defn_1>

  ...

  <group_defn_n>

4.2.6.2.5.2     Example

The following example shows the definition of three Compute nodes in the node_templates section of a topology_template as well as the grouping of two of the Compute nodes in a group server_group_1.

node_templates:

  server1:

    type: tosca.nodes.Compute

    # more details ...

 

  server2:

    type: tosca.nodes.Compute

    # more details ...

 

  server3:

    type: tosca.nodes.Compute

    # more details ...

 

groups:

  # server2 and server3 are part of the same group

  server_group_1:

    type: tosca.groups.Root

    members: [ server2, server3 ]

4.2.6.2.6 policies

The policies section allows for declaring policies that can be applied to entities in the topology template.

4.2.6.2.6.1     Grammar

The grammar of the policies section is as follows:

policies:

  - <policy_defn_1>

  - ...

  - <policy_defn_n>

4.2.6.2.6.2     Example

The following example shows the definition of a placement policy.

policies:

  - my_placement_policy:

      type: mycompany.mytypes.policy.placement

4.2.6.2.7 substitution_mapping
4.2.6.2.7.1     requirement_mapping

The grammar of a requirement_mapping is as follows:

<requirement_name>: [ <node_template_name>, <node_template_requirement_name> ]

The multi-line grammar is as follows :

<requirement_name>:

  mapping: [ <node_template_name>, <node_template_capability_name> ]

  properties:

    <property_name>: <property_value>

·         requirement_name: represents the name of the requirement as it appears in the Node Type definition for the Node Type (name) that is declared as the value for on the substitution_mappings’ “node_type” key.

·         node_template_name: represents a valid name of a Node Template definition (within the same topology_template declaration as the substitution_mapping is declared).

·         node_template_requirement_name: represents a valid name of a requirement definition within the <node_template_name> declared in this mapping.

4.2.6.2.7.2     Example

The following example shows the definition of a placement policy.

topology_template:

 

inputs:

   cpus:

     type: integer

     constraints:

       less_than: 2 # OR use “defaults” key

 

substitution_mappings:

    node_type: MyService

    properties:  # Do not care if running or matching (e.g., Compute node)

      # get from outside?  Get from contsraint?

      num_cpus: cpus # Implied “PUSH”

      # get from some node in the topology…

      num_cpus: [ <node>, <cap>, <property> ]

      # 1) Running

      architecture:

        # a) Explicit

        value: { get_property: [some_service, architecture] }

        # b) implicit

        value: [ some_service, <req | cap name>, <property name> architecture ]

        default: “amd”

        # c) INPUT mapping?

        ???

      # 2) Catalog (Matching)

      architecture:

         contraints: equals: “x86”

 

    capabilities:

      bar: [ some_service, bar ]

    requirements:

      foo: [ some_service, foo ]

 

  node_templates:

    some_service:

      type: MyService

      properties:

        rate: 100

      capabilities:

        bar:

          ...

      requirements:

        - foo:

            ...

 

 

4.2.6.2.8 Notes

·         The parameters (properties) that are part of the inputs block can be mapped to PropertyMappings provided as part of BoundaryDefinitions as described by the TOSCA v1.0 specification.

·         The node templates that are part of the node_templates block can be mapped to the NodeTemplate definitions provided as part of TopologyTemplate of a ServiceTemplate as described by the TOSCA v1.0 specification.

·         The relationship templates that are part of the relationship_templates block can be mapped to the RelationshipTemplate definitions provided as part of TopologyTemplate of a ServiceTemplate as described by the TOSCA v1.0 specification.

·         The output parameters that are part of the outputs section of a topology template can be mapped to PropertyMappings provided as part of BoundaryDefinitions as described by the TOSCA v1.0 specification.

      Note, however, that TOSCA v1.0 does not define a direction (input vs. output) for those mappings, i.e. TOSCA v1.0 PropertyMappings are underspecified in that respect and TOSCA ’s inputs and outputs provide a more concrete definition of input and output parameters.

4.3 Nodes and Relationships

4.3.1 Node Type

A Node Type is a reusable entity that defines the type of one or more Node Templates. As such, a Node Type defines the structure of observable properties and attributes, the capabilities and requirements of the node as well as its supported interfaces and the artifacts it uses.

4.3.1.1 Keynames

The Node Type is a TOSCA type entity and has the common keynames listed Section 4.2.5.2 Common keynames in type definitions. In addition, the Node Type has the following recognized keynames:

Keyname

Mandatory

Type

Description

properties

no

map of

property definitions

An optional map of property definitions for the Node Type.

attributes

no

map of

attribute definitions

An optional map of attribute definitions for the Node Type.

capabilities

no

map of

capability definitions

An optional map of capability definitions for the Node Type.

requirements

no

list of

requirement definitions

An optional list of requirement definitions for the Node Type.

interfaces

no

map of

interface definitions

An optional map of interface definitions supported by the Node Type.

artifacts

no

map of

artifact definitions

An optional map of artifact definitions for the Node Type.

4.3.1.2 Grammar

Node Types have following grammar:

<node_type_name>: 

  derived_from: <parent_node_type_name>

  version: <version_number>

  metadata:

    <map of string>

  description: <node_type_description>

  properties:

    <property_definitions>

  attributes:

    <attribute_definitions>

  capabilities:

    <capability_definitions>

  requirements:

    - <requirement_definitions>

  interfaces:

    <interface_definitions>

  artifacts:

    <artifact_definitions>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         node_type_name: represents the mandatory symbolic name of the Node Type being declared.

·         parent_node_type_name: represents the name (string) of the Node Type this Node Type definition derives from (i.e. its parent type).

·         version_number: represents the optional TOSCA version number for the Node Type.

·         node_type_description: represents the optional description string for the corresponding node_type_name.

·         property_definitions: represents the optional map of property definitions for the Node Type.

·         attribute_definitions: represents the optional map of attribute definitions for the Node Type.

·         capability_definitions: represents the optional map of capability definitions for the Node Type.

·         requirement_definitions: represents the optional list of requirement definitions for the Node Type.

·         interface_definitions: represents the optional map of one or more interface definitions supported by the Node Type.

·         artifact_definitions: represents the optional map of artifact definitions for the Node Type

4.3.1.3 Derivation rules

During Node Type derivation the keyname definitions follow these rules:

·         properties: existing property definitions may be refined; new property definitions may be added.

·         attributes: existing attribute definitions may be refined; new attribute definitions may be added.

·         capabilities: existing capability definitions may be refined; new capability definitions may be added.

·         requirements: existing requirement definitions may be refined; new requirement definitions may be added.

·         interfaces: existing interface definitions may be refined; new interface definitions may be added.

·         artifacts: existing artifact definitions (identified by their symbolic name) may be redefined; new artifact definitions may be added.

o    note that an artifact is created for a specific purpose and corresponds to a specific file (with e.g. a path name and checksum); if it cannot meet its purpose in a derived type then a new artifact should be defined and used.

o    thus, if an artifact defined in a parent node type does not correspond anymore with the needs in the child node type, its definition may be completely redefined; thus, an existing artifact definition is not refined, but completely overwritten.

4.3.1.4 Additional Requirements

·         Requirements are intentionally expressed as a list of TOSCA Requirement definitions which SHOULD be resolved (processed) in sequence by TOSCA Orchestrators.

4.3.1.5 Example

my_company.my_types.my_app_node_type:

  derived_from: tosca.nodes.SoftwareComponent

  description: My company’s custom applicaton

  properties:

    my_app_password:

      type: string

      description: application password

      constraints:

        - min_length: 6

        - max_length: 10

  attributes:

    my_app_port:

      type: integer

      description: application port number

  requirements:

    - some_database:

        capability: EndPoint.Database

        node: Database   

        relationship: ConnectsTo

 

4.3.2 Node Template

A Node Template specifies the occurrence of a manageable component as part of an application’s topology model which is defined in a TOSCA Service Template.  A Node Template is an instance of a specified Node Type and can provide customized properties, constraints, relationships or interfaces which complement and change the defaults provided by its Node Type.

4.3.2.1 Keynames

The following is the list of recognized keynames for a TOSCA Node Template definition:

Keyname

Mandatory

Type

Description

type

yes

string

The mandatory name of the Node Type the Node Template is based upon.

description

no

string

An optional description for the Node Template.

metadata

no

map of string

Defines a section used to declare additional metadata information.

directives

no

list of string

An optional list of directive values to provide processing instructions to orchestrators and tooling.

properties

no

map of

property assignments

An optional map of property value assignments for the Node Template.

attributes

no

map of

attribute assignments

An optional map of attribute value assignments for the Node Template.

requirements

no

list of

requirement assignments

An optional list of requirement assignments for the Node Template.

capabilities

no

map of

capability assignments

An optional map of capability assignments for the Node Template.

interfaces

no

map of

interface assignments

An optional map of interface assignments for the Node Template.

artifacts

no

map of

artifact definitions

 

An optional map of artifact definitions for the Node Template.

node_filter

no

node filter

The optional filter definition that TOSCA orchestrators will use to select the correct target node. 

copy

no

string

The optional (symbolic) name of another node template to copy into (all keynames and values) and use as a basis for this node template.

4.3.2.2 Grammar

<node_template_name>:

  type: <node_type_name>

  description: <node_template_description>

  directives: [<directives>]

  metadata:

    <map of string>

  properties:

    <property_assignments>

  attributes:

    <attribute_assignments>

  requirements:

    - <requirement_assignments>

  capabilities:

    <capability_assignments>

  interfaces:

    <interface_assignments>

  artifacts:

    <artifact_definitions>

  node_filter:

    <node_filter_definition>

  copy: <source_node_template_name>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         node_template_name: represents the mandatory symbolic name of the Node Template being declared.

·         node_type_name: represents the name of the Node Type the Node Template is based upon.

·         node_template_description: represents the optional description string for Node Template.

·         directives: represents the optional list of processing instruction keywords (as strings) for use by tooling and orchestrators.

·         property_assignments: represents the optional map of property assignments for the Node Template that provide values for properties defined in its declared Node Type.

·         attribute_assignments: represents the optional map of attribute assignments for the Node Template that provide values for attributes defined in its declared Node Type.

·         requirement_assignments: represents the optional list of requirement assignments for the Node Template for requirement definitions provided in its declared Node Type.

·         capability_assignments: represents the optional map of capability assignments for the Node Template for capability definitions provided in its declared Node Type.

·         interface_assignments: represents the optional map of interface assignments for the Node Template interface definitions provided in its declared Node Type.

·         artifact_definitions: represents the optional map of artifact definitions for the Node Template that augment those provided by its declared Node Type.

·         node_filter_definition: represents the optional node filter TOSCA orchestrators will use for selecting a matching node template.

·         source_node_template_name: represents the optional (symbolic) name of another node template to copy into (all keynames and values) and use as a basis for this node template.

4.3.2.3 Additional requirements

·         The source node template provided as a value on the copy keyname MUST NOT itself use the copy keyname (i.e., it must itself be a complete node template description and not copied from another node template).

4.3.2.4 Example

node_templates:

  mysql:

    type: tosca.nodes.DBMS.MySQL

    properties:

      root_password: { get_input: my_mysql_rootpw }

      port: { get_input: my_mysql_port }

    requirements:

      - host: db_server

    interfaces:

      Standard:

        operations:

          configure: scripts/my_own_configure.sh

 

4.3.3 Relationship Type

A Relationship Type is a reusable entity that defines the type of one or more relationships between Node Types or Node Templates.

4.3.3.1 Keynames

The Relationship Type is a TOSCA type entity and has the common keynames listed in Section 4.2.5.2 Common keynames in type definitions. In addition, the Relationship Type has the following recognized keynames:

Keyname

Mandatory

Definition/Type

Description

properties

no

map of

property definitions

An optional map of property definitions for the Relationship Type.

attributes

no

map of

attribute definitions

An optional map of attribute definitions for the Relationship Type.

interfaces

no

map of

interface definitions

An optional map of interface definitions supported by the Relationship Type.

valid_target_types

no

list of string

An optional list of one or more names of Capability Types that are valid targets for this relationship. If undefined, all Capability Types are valid target targets.

4.3.3.2 Grammar

Relationship Types have following grammar:

<relationship_type_name>:

  derived_from: <parent_relationship_type_name>

  version: <version_number>

  metadata:

    <map of string>

  description: <relationship_description>

  properties:

    <property_definitions>

  attributes:

    <attribute_definitions>

  interfaces:

    <interface_definitions>

  valid_target_types: [ <capability_type_names> ]

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         relationship_type_name: represents the mandatory symbolic name of the Relationship Type being declared as a string.

·         parent_relationship_type_name: represents the name (string) of the Relationship Type this Relationship Type definition derives from (i.e., its “parent” type).

·         relationship_description: represents the optional description string for the corresponding relationship_type_name.

·         version_number: represents the optional TOSCA version number for the Relationship Type.

·         property_definitions: represents the optional map of property definitions for the Relationship Type.

·         attribute_definitions: represents the optional map of attribute definitions for the Relationship Type.

·         interface_definitions: represents the optional map of interface definitions supported by the Relationship Type.

·         capability_type_names: represents the optional list of valid target Capability Types for the relationship; if undefined, the valid target types are not restricted at all (i.e. all Capability Types are valid).

4.3.3.3 Derivation rules

During Relationship Type derivation the keyname definitions follow these rules:

·         properties: existing property definitions may be refined; new property definitions may be added.

·         attributes: existing attribute definitions may be refined; new attribute definitions may be added.

·         interfaces: existing interface definitions may be refined; new interface definitions may be added.

·         valid_target_types: if valid_target_types is defined in the parent type, each element in this list must either be in the parent type list or derived from an element in the parent type list; if valid_target_types is not defined in the parent type then no restrictions are applied.

4.3.3.4 Examples

mycompanytypes.myrelationships.AppDependency:

  derived_from: tosca.relationships.DependsOn

  valid_target_types: [ mycompanytypes.mycapabilities.SomeAppCapability ]

 

4.3.4 Relationship Template

A Relationship Template 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.  A Relationship template is an instance of a specified Relationship Type and can provide customized properties, constraints or operations which complement and change the defaults provided by its Relationship Type and its implementations.

4.3.4.1 Keynames

The following is the list of recognized keynames for a TOSCA Relationship Template definition:

Keyname

Mandatory

Type

Description

type

yes

string

The mandatory name of the Relationship Type the Relationship Template is based upon.

description

no

string

An optional description for the Relationship Template.

metadata

no

map of string

Defines a section used to declare additional metadata information.

properties

no

map of

property assignments

An optional map of property assignments for the Relationship Template.

attributes

no

map of

attribute assignments

An optional map of attribute assignments for the Relationship Template.

interfaces

no

map of

interface assignments

An optional map of interface assignments for the relationship template.

copy

no

string

The optional (symbolic) name of another relationship template to copy into (all keynames and values) and use as a basis for this relationship template.

4.3.4.2 Grammar

<relationship_template_name>:

  type: <relationship_type_name>

  description: <relationship_type_description>

  metadata:

    <map of string>

  properties:

    <property_assignments>

  attributes:

    <attribute_assignments>

  interfaces:

    <interface_assignments>

  copy:

    <source_relationship_template_name>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         relationship_template_name: represents the mandatory symbolic name of the Relationship Template being declared.

·         relationship_type_name: represents the name of the Relationship Type the Relationship Template is based upon.

·         relationship_template_description: represents the optional description string for the Relationship Template.

·         property_assignments: represents the optional map of property assignments for the Relationship Template that provide values for properties defined in its declared Relationship Type.

·         attribute_assignments: represents the optional map of attribute assignments for the Relationship Template that provide values for attributes defined in its declared Relationship Type.

·         interface_assignments: represents the optional map of interface assignments for the Relationship Template for interface definitions provided by its declared Relationship Type.

·         source_relationship_template_name: represents the optional (symbolic) name of another relationship template to copy into (all keynames and values) and use as a basis for this relationship template.

4.3.4.3 Additional requirements

·         The source relationship template provided as a value on the copy keyname MUST NOT itself use the copy keyname (i.e., it must itself be a complete relationship template description and not copied from another relationship template).

4.3.4.4 Example

relationship_templates:

  storage_attachment:

    type: AttachesTo

    properties:

      location: /my_mount_point

 

4.3.5 Capabilities and Requirements

4.3.5.1 Capability Type

A Capability Type is a reusable entity that describes a kind of capability that a Node Type can declare to expose.  Requirements (implicit or explicit) that are declared as part of one node can be matched to (i.e., fulfilled by) the Capabilities declared by another node.

4.3.5.1.1 Keynames

The Capability Type is a TOSCA type entity and has the common keynames listed in Section 4.2.5.2 Common keynames in type definitions. In addition, the Capability Type has the following recognized keynames:

Keyname

Mandatory

Type

Description

properties

no

map of
property definitions

An optional map of property definitions for the Capability Type.

attributes

no

map of

attribute definitions

An optional map of attribute definitions for the Capability Type.

valid_source_types

no

list of string

An optional list of one or more valid names of Node Types that are supported as valid sources of any relationship established to the declared Capability Type. If undefined, all Node Types are valid sources.

4.3.5.1.2 Grammar

Capability Types have following grammar:

<capability_type_name>:

  derived_from: <parent_capability_type_name>

  version: <version_number>

  description: <capability_description>

  properties:

    <property_definitions>

  attributes:

    <attribute_definitions>

  valid_source_types: [ <node type_names> ]

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         capability_type_name: represents the mandatory name of the Capability Type being declared as a string.

·         parent_capability_type_name: represents the name of the Capability Type this Capability Type definition derives from (i.e., its “parent” type).

·         version_number: represents the optional TOSCA version number for the Capability Type.

·         capability_description: represents the optional description string for the Capability Type.

·         property_definitions: represents the optional map of property definitions for the Capability Type.

·         attribute_definitions: represents the optional map of attribute definitions for the Capability Type.

·         node_type_names: represents the optional list of one or more names of Node Types that the Capability Type supports as valid sources for a successful relationship to be established to itself; if undefined, the valid source types are not restricted at all (i.e. all Node Types are valid).

4.3.5.1.3 Derivation rules

During Capability Type derivation the keyname definitions follow these rules:

·         properties: existing property definitions may be refined; new property definitions may be added.

·         attributes: existing attribute definitions may be refined; new attribute definitions may be added.

·         valid_source_types: if valid_source_types is defined in the parent type, each element in this list must either be in the parent type list or derived from an element in the parent type list; if valid_source_types is not defined in the parent type then no restrictions are applied.

 

4.3.5.1.4 Example

mycompany.mytypes.myapplication.MyFeature:

  derived_from: tosca.capabilities.Root

  description: a custom feature of my company’s application

  properties:

    my_feature_setting:

      type: string

    my_feature_value:

      type: integer

 

4.3.5.2 Capability definition

A Capability definition defines a typed set of data that a node can expose and is used to describe a relevant feature of the component described by the node. A Capability is defined part of a Node Type definition and may be refined during Node Type derivation.

4.3.5.2.1 Keynames

The following is the list of recognized keynames for a TOSCA capability definition:

Keyname

Mandatory

Type

Description

type

yes

string

The mandatory name of the Capability Type this capability definition is based upon.

description

no

string

The optional description of the Capability definition.

properties

no

map of

property refinements

An optional map of property refinements for the Capability definition. The referred properties must have been defined in the Capability Type definition referred by the type keyword. New properties may not be add

attributes

no

map of

attribute refinements

An optional map of attribute refinements for the Capability definition. The referred attributes must have been defined in the Capability Type definition referred by the type keyword. New attributes may not be added

valid_source_types

no

list of string

An optional list of one or more valid names of Node Types that are supported as valid sources of any relationship established to the declared Capability Type. If undefined, all node types are valid sources.

If valid_source_types is defined in the Capability Type, each element in this list must either be in or derived from an element in the list defined in the type

occurrences

no

range of integer

The optional minimum and maximum of occurrences for the capability. The occurrence represents the maximum number of relationships that are allowed by the Capability. If not defined the implied default is [1,UNBOUNDED] (which means that an exported Capability should allow at least one relationship to be formed with it and maximum a UNBOUNDED number of relationships).

 

4.3.5.2.2 Grammar

Capability definitions have one of the following grammars:

4.3.5.2.2.1     Short notation

The following single-line grammar may be used when only the capability type needs to be declared, without further refinement of the definitions in the capability type:

4.3.5.2.2.2     Extended notation

The following multi-line grammar may be used when additional information on the capability definition is needed:

<capability_definition_name>:

  type: <capability_type>

  description: <capability_description>

  properties:

    <property_refinements>

  attributes:

    <attribute_refinements>

  valid_source_types: [ <node type_names> ]

  occurrences: <range_of_occurrences>

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         capability_definition_name: represents the symbolic name of the capability as a string.

·         capability_type: represents the mandatory name of a capability type the capability definition is based upon.

·         capability_description: represents the optional description of the capability definition.

·         property_refinements: represents the optional map of property definitions refinements for properties already defined in the capability type; new properties may not be added.

·         attribute_refinements: represents the optional map of attribute definitions refinements for attributes already defined in the capability type; new attributes may not be added.

·         node_type_names: represents the optional list of one or more names of Node Types that the Capability definition supports as valid sources for a successful relationship to be established to itself

·         if valid_source_types is defined in the capability type, each element in this list MUST either be in the capability type list or derived from an element in the capability type list; if valid_source_types is not defined in the capability type then no restrictions are applied.

·         range_of_occurrences: represents he optional minimum and maximum occurrences for the capability

·         the occurrence represents the maximum number of relationships that are allowed by the capability; however, it does not restrict a lower number of relationships than the occurrence to be established.

·         in a node template, the occurrences keyname may be assigned to any number within the range_of_occurrences defined here.

·         if the occurrences is not assigned in the node template the TOSCA orchestrator may automatically set the occurrences to a number in the defined range (e.g. the maximum in the range).

·         the minimum in the range prevents the occurrences (during subsequent refinements or during assignment) to be set below this minimum.

·         by default (i.e. if occurrences is undefined here), a capability should allow at least one (1), and at most an unrestricted number (UNBOUNDED) of relationships to be formed to it.

4.3.5.2.3 Refinement rules

A capability definition within a node type uses the following definition refinement rules when the containing node type is derived:

·         type: must be derived from (or the same as) the type in the capability definition in the parent node type definition.

·         description: a new definition is unrestricted and will overwrite the one inherited from the capability definition in the parent node type definition.

·         occurrences: the new range MUST be within the range defined in the capability definition in the parent node type definition.

 

·         properties: not applicable to the definitions in the parent node type but to the definitions in the capability type referred by the type keyname (see grammar above for the rules).

·         attributes: not applicable to the definitions in the parent node type but to the definitions in the capability type referred by the type keyname (see grammar above for the rules).

·         valid_source_types: not applicable to the definitions in the parent node type but to the definitions in the capability type referred by the type keyname (see grammar above for the rules).

4.3.5.2.4 Examples

The following examples show capability definitions in both simple and full forms:

4.3.5.2.4.1     Simple notation example

# Simple notation, no properties need to be refined

some_capability: mytypes.mycapabilities.MyCapabilityTypeName

4.3.5.2.4.2     Full notation example

# Full notation, refining properties

some_capability:

  type: mytypes.mycapabilities.MyCapabilityTypeName

  properties:

    limit:

      default: 100

4.3.5.2.5 Additional requirements

·         Capability symbolic names SHALL be unique; it is an error if a capability name is found to occur more than once.

·         If the occurrences keyname is not present, then a default declaration as follows will be assumed: occurrences: [1, UNBOUNDED]

 

4.3.5.3 Capability assignment

A capability assignment allows node template authors to assign values to properties and attributes for a capability definition that is part of the node templates’ respective type definition, and also to set the capability occurrences.

4.3.5.3.1 Keynames

The following is the list of recognized keynames for a TOSCA capability assignment:

Keyname

Mandatory

Type

Description

properties

no

map of

property assignments

An optional map of property assignments for the Capability definition.

attributes

no

map of

attribute assignments

An optional map of attribute assignments for the Capability definition.

occurrences

no

integer

An optional integer that sets the number of occurrences. It defines the maximum number of allowed relationships to this capability. Must be within the range specified in the corresponding capability definition. If not defined, the orchestrator uses a suitable value from the range defined in the corresponding capability definition (e.g. the maximum in the range).

4.3.5.3.2 Grammar

Capability assignments have one of the following grammars:

<capability_definition_name>:

  properties:

    <property_assignments>

  attributes:

    <attribute_assignments>

  occurrences: <occurrences_value>

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         capability_definition_name: represents the symbolic name of the capability as a string.

·         property_assignments: represents the optional map of property assignments that provide values for properties defined in the Capability definition.

·         attribute_assignments: represents the optional map of attribute assignments that provide values for attributes defined in the Capability definition.

·         occurrences_value: represents the optional integer that sets the number of occurrences

·         it represents the maximum number of relationships that are allowed by the capability; note that it does not restrict a lower number of relationships to be established.

·         must be within the range specified in the corresponding capability definition.

·         if not defined, the orchestrator uses a suitable value from the range defined in the corresponding capability definition (e.g. the maximum in the range).

4.3.5.3.3 Example

The following example shows a capability assignment:

4.3.5.3.3.1     Notation example

node_templates:

  some_node_template:

    capabilities:

      some_capability:

        properties:

          limit: 100

 

4.3.5.4 Requirement Type

Requirement types are not defined in TOSCA. TOSCA seeks to simplify the modeling by not declaring specific Requirement Types with nodes declaring their features sets using TOSCA Capability Types. So, it suffices that capabilities are advertised a-priory by Capability Types, while requirement definitions can be directly created during Node Type design.

 

4.3.5.5 Requirement definition

The Requirement definition describes a requirement (dependency) of a TOSCA node which needs to be fulfilled by a matching Capability definition declared by another TOSCA node. A Requirement is defined as part of a Node Type definition and may be refined during Node Type derivation.

4.3.5.5.1 Keynames

The following is the list of recognized keynames for a TOSCA requirement definition:

Keyname

Mandatory

Type

Description

description

no

string

The optional description of the Requirement definition.

capability

yes

string

The mandatory keyname used to provide either the:

·         symbolic name of a Capability definition within a target Node Type that can fulfill the requirement.

·         name of a Capability Type that the TOSCA orchestrator will use to select a type-compatible target node to fulfill the requirement at runtime.

node

conditional

string

The optional keyname used to provide the name of a valid Node Type that contains the capability definition that can be used to fulfill the requirement.

If a symbolic name of a Capability definition has been used for the capability keyname, then the node keyname is mandatory.

relationship

no

string

The optional keyname used to provide the name of a valid Relationship Type to construct a relationship when fulfilling the requirement.

node_filter

no

node filter

The optional filter definition that TOSCA orchestrators will use to select a type-compatible target node that can fulfill the associated abstract requirement at runtime.

occurrences

no

range of integer

The optional minimum and maximum occurrences for the requirement. If this key is not specified, the implied default of [1,1] will be used.

Note: the keyword UNBOUNDED is also supported to represent any positive integer.

4.3.5.5.1.1     Additional Keynames for multi-line relationship grammar

The Requirement definition contains the Relationship Type information needed by TOSCA Orchestrators to construct relationships to other TOSCA nodes with matching capabilities; however, it is sometimes recognized that additional parameters may need to be passed to the relationship (perhaps for configuration). In these cases, additional grammar is provided so that the requirement definition may declare interface refinements  (e.g. changing the implementation definition or declaring additional parameter definitions to be used as inputs/outputs). 

Keyname

Mandatory

Type

Description

type

yes

string

The optional keyname used to provide the name of the Relationship Type as part of the relationship keyname definition.

interfaces

no

map of interface refinements

The optional keyname used to reference declared interface definitions on the corresponding Relationship Type for refinement.

4.3.5.5.2 Grammar

Requirement definitions have one of the following grammars:

4.3.5.5.2.1     Simple grammar (Capability Type only)
4.3.5.5.2.2     Extended grammar (with Node and Relationship Types)

<requirement_definition_name>:

  description: <requirement_description>

  capability: <capability_symbolic_name> | <capability_type_name>

  node: <node_type_name>

  relationship: <relationship_type_name>

  node_filter: <node_filter_definition>

  occurrences: [ <min_occurrences>, <max_occurrences> ]

4.3.5.5.2.3     Extended grammar for declaring Parameter Definitions on the relationship’s Interfaces

The following additional multi-line grammar is provided for the relationship keyname in order to declare new parameter definitions for inputs/outputs of known Interface definitions of the declared Relationship Type. 

<requirement_definition_name>:

  # Other keynames omitted for brevity

  relationship:

    type: <relationship_type_name>

    interfaces: <interface_refinements>

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         requirement_definition_name: represents the mandatory symbolic name of the requirement definition as a string.

·         requirement_description: represents the optional description of the requirement definition.

·         capability_symbolic_name: represents the mandatory symbolic name of the Capability definition within the target Node Type.

·         capability_type_name: represents the mandatory name of a Capability Type that can be used to fulfill the requirement.

·         node_type_name: represents the name of a Node Type that contains either the Capability Type or the Capability definition the requirement can be fulfilled by; the node_type_name is mandatory if the capability_symbolic_name was used, and is optional if the capability_type_name was used.

·         relationship_type_name: represents the optional name of a Relationship Type to be used to construct a relationship between this requirement definition (i.e. in the source node) to a matching capability definition (in a target node).

·         node_filter_definition: represents the optional node filter TOSCA orchestrators will use to fulfill the requirement when selecting a target node, or to verify that the specified node template fulfills the requirement (if a node template was specified during requirement assignment).

·         min_occurrences, max_occurrences: represents the optional minimum and maximum range for the occurrences of the requirement (i.e. its cardinality)

·         the requirement occurrences define how many relationships are created from this requirement towards target capabilities, and its value is set during requirement assignment time to an integer in the range specified here.

·         by default (i.e. if occurrences is undefined here), a requirement shall form exactly one relationship (i.e. at least one, and at most one).

·         interface_refinements: represents refinements for one or more already declared interface definitions in the Relationship Type (as declared on the type keyname)

·         allowing for the declaration of new parameter definitions for these interfaces or for specific operation or notification definitions of these interfaces or for the change of the description or implementation definitions.

4.3.5.5.3 Refinement rules

A requirement definition within a node type uses the following definition refinement rules when the containing node type is derived:

·         description: a new definition is unrestricted and will overwrite the one inherited from the requirement definition in the parent node type definition.

·         capability: the type of the capability must be derived from (or the same as) the capability type in the requirement definition in the parent node type definition.

·         if the capability was specified using the symbolic name of a capability definition in the target node type, then the capability keyname definition MUST remain unchanged in any subsequent refinements or during assignment.

·         node: must be derived from (or the same as) the node type in the requirement definition in the parent node type definition; if node is not defined in the parent type then no restrictions are applied;

·         the node type specified by the node keyname must also contain a capability definition that fulfills the requirement set via the capability keyname above.

·         relationship: must be derived from (or the same as) the relationship type in the requirement definition in the parent node type definition; if relationship is not defined in the parent type then no restrictions are applied.

·         node_filter: a new definition is unrestricted and will be considered in addition (i.e. logical and) to the node_filter definition in the parent node type definition; further refinements may add further node filters.

·         occurrences: the new range MUST be within the range defined in the requirement definition in the parent node type definition.

4.3.5.5.4 Additional requirements

·         Requirement symbolic names SHALL be unique; it is an error if a requirement name is found to occur more than once.

·         If the occurrences keyname is not present, then a default declaration as follows will be assumed: 

- occurrences: [1,1]

4.3.5.5.5 Notes

·         The requirement symbolic name is used for identification of the requirement definition only and not relied upon for establishing any relationships in the topology.

4.3.5.5.6 Requirement definition is a tuple with a filter

A requirement definition allows type designers to govern which types are allowed (valid) for fulfillment using three levels of specificity with only the Capability definition or Capability Type being mandatory.

1.     Node Type (mandatory/optional)

2.     Relationship Type (optional)

3.     Capability definition or Capability Type (mandatory)

The first level allows selection, as shown in both the simple or complex grammar, simply providing the node’s type using the node keyname. The second level allows specification of the relationship type to use when connecting the requirement to the capability using the relationship keyname.  Finally, the specific Capability definition or Capability Type on the target node is provided using the capability keyname. Note that if a Capability definition is used, the Node Type definition is mandatory (as it refers to a Capability definition in that Node Type).

In addition to the node, relationship and capability types, a filter, with the keyname node_filter, may be provided to constrain the allowed set of potential target nodes based upon their properties and their capabilities’ properties.  This allows TOSCA orchestrators to help find the “best fit” when selecting among multiple potential target nodes for the expressed requirements. Also, if a Node Template was specified during requirement assignment it allows TOSCA orchestrators to verify that the specified node template fulfills the requirement.

 

4.3.5.6 Requirement assignment

A Requirement assignment allows Node Template authors to provide assignments for individual and/or subsets of occurrences of the corresponding Requirement definition (i.e. having the same symbolic name) in the Node Type definition.

A Requirement assignment provides either names of Node Templates or selection criteria for TOSCA orchestrators to find matching TOSCA nodes that are used to fulfill the requirement’s declared Capability Type and/or Node Type. A Requirement assignment also provides either names of Relationship Templates (to use) or the name of Relationship Types (to create relationships) for relating the source node (containing the Requirement) to the target node (containing the Capability).

Note that several Requirement assignments in the Node Template definition can have the same symbolic name, each referring to different occurrences of the Requirement definition. To how many occurrences a particular assignment refers to is set via the occurrences keyname. Nevertheless, the sum of the occurrences’ values for all of the Requirement assignments with the same symbolic name MUST be within the range of occurrences specified by the corresponding Requirement definition.

4.3.5.6.1 Keynames

The following is the list of recognized keynames for a TOSCA requirement assignment:

Keyname

Mandatory

Type

Description

capability

no

string

The optional keyname used to provide either the:

·         symbolic name of a Capability definition within a target node that can fulfill the requirement.

·         name of a Capability Type that the TOSCA orchestrator will use to select a type-compatible target node to fulfill the requirement at runtime.

node

no

string

The optional keyname used to identify the target node of a relationship; specifically, it is used to provide either the:

·         name of a Node Template that can fulfill the target node requirement.

·         name of a Node Type that the TOSCA orchestrator will use to select a type-compatible target node to fulfill the requirement at runtime.

relationship

no

string

The optional keyname used to provide either the:

·         name of a Relationship Template to use to relate this node to the target node when fulfilling the requirement.

·         name of a Relationship Type that the TOSCA orchestrator will use to create a relationship to relate this node to the target node when fulfilling the requirement.

node_filter

no

node filter

The optional filter definition that TOSCA orchestrators will use to select a type-compatible target node that can fulfill the requirement at runtime.

occurrences

no

integer

An optional keyname that sets the occurrences for this requirement. The sum of all occurrences’ values for all Requirement assignments with the same symbolic name must be within the range specified in the corresponding Requirement definition. If not defined, the assumed occurrences for an assignment is one (1).

The following is the list of recognized keynames for a TOSCA requirement assignment’s relationship keyname which is used when property assignments or interface assignments (for e.g. changing the implementation keyname or declare additional parameter definitions to be used as inputs/outputs) need to be provided: 

Keyname

Mandatory

Type

Description

type

no

string

The optional keyname used to provide the name of the Relationship Type for the Requirement assignment’s relationship.

properties

no

map of

property assignments

An optional keyname providing property assignments for the relationship.

interfaces

no

map of

interface assignments

The optional keyname providing Interface assignments for the corresponding Interface definitions in the Relationship Type.

4.3.5.6.2 Grammar

Requirement assignments have one of the following grammars:

4.3.5.6.2.1     Short notation:

The following single-line grammar may be used if only a concrete Node Template for the target node needs to be declared in the requirement:

4.3.5.6.2.2     Extended notation:

The following grammar should be used if the requirement assignment needs to provide more information than just the Node Template name:

4.3.5.6.2.3     Extended grammar with Property Assignments and Interface Assignments for the relationship

The following additional multi-line grammar is provided for the relationship keyname in order to provide new Property assignments and Interface assignments for the created relationship of the declared Relationship.    

<requirement_name>:

  # Other keynames omitted for brevity

  relationship:

    type: <relationship_template_name> | <relationship_type_name>

    properties: <property_assignments>

    interfaces: <interface_assignments>

 

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         requirement_name: represents the symbolic name of a requirement assignment as a string.

·         capability_symbolic_name: represents the optional name of the Capability definition within the target Node Type or Node Template;

·         if the capability in the Requirement definition was specified using the symbolic name of a capability definition in a target node type, then the capability keyname definition MUST remain unchanged in any subsequent refinements or during assignment.

·         if the capability in the Requirement definition was specified using the name of a Capability Type, then the Capability definition referred here by the capability_symbolic_name must be of a type that is the same as or derived from the said Capability Type in the Requirement definition.

·         capability_type_name: represents the optional name of a Capability Type definition within the target Node Type or Node Template this requirement needs to form a relationship with;

·         may not be used if the capability in the Requirement definition was specified using the symbolic name of a capability definition in a target node type.

·         otherwise the capability_type_name must be of a type that is the same as or derived from the type defined by the capability keyname in the Requirement definition.

·         node_template_name: represents the optional name of a Node Template that contains the capability this requirement will be fulfilled by;

·         in addition, the Node Type of the Node Template must be of a type that is the same as or derived from the type defined by the node keyname (if the node keyname is defined) in the Requirement definition,

·         in addition, the Node Template must fulfill the node filter requirements of the node_filter (if a node_filter is defined) in the Requirement definition.

·         node_type_name: represents the optional name of a Node Type that contains the capability this Requirement will be fulfilled by;

·         in addition, the node_type_name must be of a type that is the same as or derived from the type defined by the node keyname (if the node keyname is defined) in the Requirement definition.

·         relationship_template_name: represents the optional name of a Relationship Template to be used when relating the Requirement to the Capability in the target node.

·         in addition, the Relationship Type of the Relationship Template must be of a type that is the same as or derived from the type defined by the relationship keyname (if the relationship keyname is defined) in the Requirement definition.

·         relationship_type_name: represents the optional name of a Relationship Type that is compatible with the Capability Type in the target node; the TOSCA orchestrator will create a relationship of the  Relationship Type when relating the Requirement to the Capability in the target node.

·         in addition, the relationship_type_name must be of a type that is the same as or derived from the type defined by the relationship keyname (if the relationship keyname is defined) in the Requirement definition.

·         property_assignments: represents the optional map of property assignments for the declared relationship.

·         interface_assignments: represents the optional map of interface assignments for the declared relationship used to provide parameter assignments on inputs and outputs of interfaces, operations and notifications or changing the implementation definition.

·         node_filter_definition: represents the optional node filter TOSCA orchestrators will use to fulfill the requirement for selecting a target node; if a node template was specified during requirement assignment, the TOSCA orchestrator verifies that the specified node template fulfills the node filter.

·         this node_filter does not replace the node_filter definition in the Requirement definition, it is applied in addition to that.

·         occurrences_value: represents the optional occurrences number that specifies to how many occurrences within the Requirement definition this particular assignment refers to.

·         in addition, the sum of all occurrences_value for all Requirement assignments with the same symbolic name must be within the range specified in the Requirement definition.

·         if not defined, the assumed occurrences_value for an assignment is one; i.e. the following default declaration will be assumed:

- occurrences: 1

4.3.5.6.3 Examples

Examples of uses for the extended requirement assignment grammar include:

·         The need to allow runtime selection of the target node a Node Type rather than a Node Template.  This may include use of the node_filter keyname to provide node and capability filtering information to find the “best match” of a node at runtime.

·         The need to further specify the Relationship Template or Relationship Type to use when relating the source node’s requirement to the target node’s capability.

·         The need to further specify the capability (symbolic) name or Capability Type in the target node to form a relationship between.

·         The need to specify the number of occurrences the requirement assigns (when greater than 1).

4.3.5.6.3.1     Example 1 – Hosting requirement on a Node Type

A web application node template named ‘my_application_node_template’ of type WebApplication declares a requirement named ‘host’ that needs to be fulfilled by any node that derives from the node type WebServer. 

# Example of a requirement fulfilled by a specific web server node template

node_templates:

  my_application_node_template:

    type: tosca.nodes.WebApplication

    ...

    requirements:

      - host:

          node: tosca.nodes.WebServer

In this case, the node template’s type is WebApplication which already declares the Relationship Type HostedOn to use to relate to the target node and the Capability Type of Container to be the specific target of the requirement in the target node.

4.3.5.6.3.2     Example 2 - Requirement with Node Template and a custom Relationship Type

This example is similar to the previous example; however, the requirement named ‘database’ describes a requirement for a connection to a database endpoint (Endpoint.Database) Capability Type in a node template (my_database). However, the connection requires a custom Relationship Type (my.types.CustomDbConnection’) declared on the keyname ‘relationship’.

# Example of a (database) requirement that is fulfilled by a node template named

# “my_database”, but also requires a custom database connection relationship

my_application_node_template:

  requirements:

    - database:

        node: my_database

        capability: Endpoint.Database

        relationship: my.types.CustomDbConnection

4.3.5.6.3.3     Example 3 - Requirement for a Compute node with additional selection criteria (filter)

This example shows how to extend an abstract ‘host’ requirement for a Compute node with a filter definition that further constrains TOSCA orchestrators to include additional properties and capabilities on the target node when fulfilling the requirement.

node_templates:

  mysql:

   type: tosca.nodes.DBMS.MySQL

    properties:

      # omitted here for brevity

    requirements:

      - host:

          node: tosca.nodes.Compute

          node_filter:

            capabilities:

              - host:

                  properties:

                    - num_cpus: { in_range: [ 1, 4 ] }

                    - mem_size: { greater_or_equal: 512 MB }

              - os:

                  properties:

                    - architecture: { equal: x86_64 }

                    - type: { equal: linux }

                    - distribution: { equal: ubuntu }

              - mytypes.capabilities.compute.encryption:

                  properties:

                    - algorithm: { equal: aes }

                    - keylength: { valid_values: [ 128, 256 ] }

4.3.5.6.3.4     Example 4 - Requirement assignment for definition with occurrences: [2,2]

This example shows how the assignments can look if the Requirement definition has the occurrences range different from the default [1,1]. In this case the redundant_database requirement has occurrences: [2,2]. The Requirement definition is not presented here for brevity. In the Requirement assignment we use the short notation. Note that the occurrences keyname for each assignment is not declared (i.e. the default value of 1 is used) and that the sum of the occurrences values of both assignments is 2 which is in the range of [2,2] as specified in the Requirement definition.

# Example of a (redundant_database) requirement that is fulfilled by

# two node templates named “database1” and “database1

my_critical_application_node_template:

  requirements:

    - redundant_database: database1

    - redundant_database: database2

 

4.3.5.7 Node Filter definition

A node filter defines criteria for selection of a target node based upon its property values, capabilities and capability properties.

4.3.5.7.1 Keynames

The following is the list of recognized keynames for a TOSCA node filter definition:

Keyname

Mandatory

Type

Description

properties

no

list of

property filter definition

An optional list of property filters that will be used to select (filter) matching TOSCA entities (e.g., Node Template, Node Type, Capability Types, etc.) based upon their property definitions’ values.

capabilities

no

list of capability names or capability type names

An optional list of capability names or types that will be used to select (filter) matching TOSCA entities based upon their existence.

4.3.5.7.2 Additional filtering on capability properties

Capabilities used as filters often have their own sets of properties which also can be used to construct a filter.

Keyname

Mandatory

Type

Description

  properties

 

(within a capability   name or type name)

no

list of

property filter definitions

An optional list of property filters that will be used to select (filter) matching TOSCA entities (e.g., Node Template, Node Type, Capability Types, etc.) based upon their capabilities’ property definitions’ values.

4.3.5.7.3 Grammar

Node filter definitions have following grammar:

node_filter:

  properties:

    - <property_filter_def_1>

    - ...

    - <property_filter_def_n>

  capabilities:

    - <capability_name_or_type_1>:

        properties:

          - <cap_1_property_filter_def_1>

          - ...

          - <cap_1_property_filter_def_n>

    -  ...

    - <capability_name_or_type_m>:

        properties:

          - <cap_m_property_filter_def_1>

          - ...

          - <cap_m_property_filter_def_n>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         property_filter_def_*: represents a property filter definition that will be used to select (filter) matching TOSCA entities (e.g., Node Template, Node Type, Capability Types, etc.) based upon their property definitions’ values. 

·         capability_name_or_type_*: represents the type or name of a capability that will be used to select (filter) matching TOSCA entities based upon their existence.

·         cap_*_property_def_*: represents a property filter definition that will be used to select (filter) matching TOSCA entities (e.g., Node Template, Node Type, Capability Types, etc.) based upon their capabilities’ property definitions’ values.

4.3.5.7.4 Additional requirements

·         TOSCA orchestrators SHALL search for matching capabilities listed on a target filter by assuming the capability name is first a symbolic name and secondly it is a type name (in order to avoid namespace collisions).

4.3.5.7.5 Example

The following example is a filter that will be used to select a Compute node based upon the values of its defined capabilities. Specifically, this filter will select Compute nodes that support a specific range of CPUs (i.e., num_cpus value between 1 and 4) and memory size (i.e., mem_size of 2 or greater) from its declared “host” capability. 

                                                                                                     

my_node_template:

  # other details omitted for brevity

  requirements:

    - host:

        node_filter:

          capabilities:

            # My “host” Compute node needs these properties:     

            - host:

                properties:

                  - num_cpus: { in_range: [ 1, 4 ] }

                  - mem_size: { greater_or_equal: 512 MB }

 

4.3.5.8 Property Filter definition

A property filter definition defines criteria, using constraint clauses, for selection of a TOSCA entity based on its property values. Constraint clauses are further defined in Section Error! Reference source not found. Error! Reference source not found..

4.3.5.8.1 Grammar

Property filter definitions have one of the following grammars:

4.3.5.8.1.1     Short notation:

The following single-line grammar may be used when only a single constraint is needed on a property:

<property_name>: <property_constraint_clause>

4.3.5.8.1.2     Extended notation:

The following multi-line grammar may be used when multiple constraints are needed on a property:

<property_name>:

  - <property_constraint_clause_1>

  - ...

  - <property_constraint_clause_n>

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         property_name: represents the name of property that will be used to select a property definition with the same name (property_name) on a TOSCA entity (e.g., a Node Type, Node Template, Capability Type, etc.). 

·         property_constraint_clause_*: represents constraint clause(s) that will be used to filter entities based upon the named property’s value(s).

4.3.5.8.2 Additional Requirements

·         Property constraint clauses must be type compatible with the property definitions (of the same name) as defined on the target TOSCA entity that the clause will be applied against.

 

4.3.6 Interfaces

4.3.6.1 Interface Type

An Interface Type is a reusable entity that describes a set of operations that can be used to interact with or to manage a node or relationship in a TOSCA topology.

4.3.6.1.1 Keynames

The Interface Type is a TOSCA type entity and has the common keynames listed in Section 4.2.5.2 Common keynames in type definitions. In addition, the Interface Type has the following recognized keynames:

Keyname

Mandatory

Type

Description

inputs

no

map of parameter definitions

The optional map of input parameter definitions available to all operations defined for this interface.

operations

no

map of operation definitions

The optional map of operations defined for this interface.

notifications

no

map of notification definitions

The optional map of notifications defined for this interface.

4.3.6.1.2 Grammar

Interface Types have following grammar:

<interface_type_name>:

  derived_from: <parent_interface_type_name>

  version: <version_number>

  metadata:

    <map of string>

  description: <interface_description>

  inputs:

    <parameter_definitions>

  operations:

    <operation_definitions>

  notifications:

    <Error! Reference source not found.Error! Reference source not found.notification_definitions>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         interface_type_name: represents the mandatory name of the interface as a string.

·         parent_interface_type_name: represents the name of the Interface Type this Interface Type definition derives from (i.e. its “parent” type).

·         version_number: represents the optional TOSCA version number for the Interface Type.

·         interface_description: represents the optional description for the Interface Type.

·         parameter_definitions: represents the optional map of parameter definitions which the TOSCA orchestrator will make available (i.e., or pass) to all implementation artifacts for operations declared on the interface during their execution.

·         operation_definitions: represents the optional map of one or more operation definitions.

·         notification_definitions: represents the optional map of one or more notification definitions.

4.3.6.1.3 Derivation rules

During Interface Type derivation the keyname definitions follow these rules:

·         inputs: existing parameter definitions may be refined; new parameter definitions may be added.

·         operations: existing operation definitions may be refined; new operation definitions may be added.

·         notifications: existing notification definitions may be refined; new notification definitions may be added.

4.3.6.1.4 Example

The following example shows a custom interface used to define multiple configure operations.

mycompany.mytypes.myinterfaces.MyConfigure:

  derived_from: tosca.interfaces.relationship.Root

  description: My custom configure Interface Type

  inputs:

    mode:

      type: string

  operations:

    pre_configure_service:

      description: pre-configure operation for my service

    post_configure_service:

      description: post-configure operation for my service

4.3.6.1.5 Additional Requirements

·         Interface Types MUST NOT include any implementations for defined operations or notifications; that is, the implementation keyname is invalid in this context.

 

4.3.6.2 Interface definition

An Interface definition defines an interface (containing operations and notifications definitions) that can be associated with (i.e. defined within) a Node or Relationship Type definition (including Interface definitions in Requirements definitions). An Interface definition may be refined in subsequent Node or Relationship Type derivations.

4.3.6.2.1 Keynames

The following is the list of recognized keynames for a TOSCA interface definition:

Keyname

Mandatory

Type

Description

type

yes

string

The mandatory name of the Interface Type this interface definition is based upon.

description

no

string

The optional description for this interface definition.

inputs

no

map of

parameter definitions and refinements

The optional map of input parameter refinements and new input parameter definitions available to all operations defined for this interface (the input parameters to be refined have been defined in the Interface Type definition).

operations

no

map of operation refinements

The optional map of operations refinements for this interface. The referred operations must have been defined in the Interface Type definition.

notifications

no

map of notification refinements

The optional map of notifications refinements for this interface. The referred operations must have been defined in the Interface Type definition.

4.3.6.2.2 Grammar

Interface definitions in Node or Relationship Type definitions have the following grammar:

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         interface_definition_name: represents the mandatory symbolic name of the interface as a string.

·         interface_type_name: represents the mandatory name of the Interface Type for the interface definition.

·         interface_description: represents the optional description string for the interface.

·         parameter_definitions_and_refinements: represents the optional map of input parameters which the TOSCA orchestrator will make available (i.e. pass) to all defined operations. This means these parameters and their values will be accessible to the implementation artifacts (e.g., scripts) associated to each operation during their execution

·         the map represents a mix of parameter refinements (for parameters already defined in the Interface Type) and new parameter definitions.

·         with the new parameter definitions, we can flexibly add new parameters when changing the implementation of operations and notifications during refinements or assignments.

·         operation_refinements: represents the optional map of operation definition refinements for this interface; the referred operations must have been previously defined in the Interface Type.

·         notification_refinements: represents the optional map of notification definition refinements for this interface; the referred notifications must have been previously defined in the Interface Type.

4.3.6.2.3 Refinement rules

An interface definition within a node or relationship type (including interface definitions in requirements definitions) uses the following definition refinement rules when the containing entity type is derived:

·         type: must be derived from (or the same as) the type in the interface definition in the parent entity type definition.

·         description: a new definition is unrestricted and will overwrite the one inherited from the interface definition in the parent entity type definition.

 

·         inputs: not applicable to the definitions in the parent entity type but to the definitions in the interface type referred by the type keyname (see grammar above for the rules).

·         operations: not applicable to the definitions in the parent entity type but to the definitions in the interface type referred by the type keyname (see grammar above for the rules).

·         notifications: not applicable to the definitions in the parent entity type but to the definitions in the interface type referred by the type keyname (see grammar above for the rules).

 

4.3.6.3 Interface assignment

An Interface assignment is used to specify assignments for the inputs, operations and notifications defined in the Interface. Interface assignments may be used within a Node or Relationship Template definition (including when Interface assignments are referenced as part of a Requirement assignment in a Node Template).

4.3.6.3.1 Keynames

The following is the list of recognized keynames for a TOSCA interface definition:

Keyname

Mandatory

Type

Description

inputs

no

map of parameter value assignments

The optional map of input parameter assignments. Template authors MAY provide parameter assignments for interface inputs that are not defined in their corresponding Interface Type.

operations

no

map of operation assignments

The optional map of operations assignments specified for this interface.

notifications

no

map of notification assignments

The optional map of notifications assignments specified for this interface.

4.3.6.3.2 Grammar

Interface assignments have the following grammar:

<interface_definition_name>:

  inputs:

    <parameter_value_assignments>

  operations:

    <operation_assignments>

  notifications:

    <notification_assignments>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         interface_definition_name: represents the mandatory symbolic name of the interface as a string.

·         parameter_value_assignments: represents the optional map of parameter value assignments for passing input parameter values to all interface operations

·         template authors MAY provide new parameter assignments for interface inputs that are not defined in the Interface definition.

·         operation_assignments: represents the optional map of operation assignments for operations defined in the Interface definition.

·         notification_assignments: represents the optional map of notification assignments for notifications defined in the Interface definition.

 

4.3.6.4 Operation definition

An operation definition defines a function or procedure to which an operation implementation can be bound.

A new operation definition may be declared only inside interface type definitions (this is the only place where new operations can be defined). In interface type, node type, or relationship type definitions (including operation definitions as part of a requirement definition) we may further refine operations already defined in an interface type.

An operation definition or refinement inside an interface type definition may not contain an operation implementation definition and it may not contain an attribute mapping as part of its output definition (as both these keynames are node/relationship specific).

4.3.6.4.1 Keynames

The following is the list of recognized keynames for a TOSCA operation definition (including definition refinement)

Keyname

Mandatory

Type

Description

description

no

string

The optional description string for the associated operation.

implementation

no

operation implementation definition

The optional definition of the operation implementation. May not be used in an interface type definition (i.e. where an operation is initially defined), but only during refinements.

inputs

no

map of

parameter definitions

The optional map of parameter definitions for operation input values.

outputs

no

map of

parameter definitions

The optional map of parameter definitions for operation output values.

Only as part of node and relationship type definitions, the output definitions may include mappings onto attributes of the node or relationship type that contains the definition.

4.3.6.4.2 Grammar

Operation definitions have the following grammar:

4.3.6.4.2.1     Short notation

The following single-line grammar may be used when the operation’s implementation definition is the only keyname that is needed, and when the operation implementation definition itself can be specified using a single line grammar:

4.3.6.4.2.2     Extended notation

The following multi-line grammar may be used when additional information about the operation is needed:

<operation_name>:

   description: <operation_description>

   implementation: <operation_implementation_definition>

   inputs:

     <parameter_definitions>

   outputs:

     <parameter_definitions>

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         operation_name: represents the mandatory symbolic name of the operation as a string.

·         operation_description: represents the optional description string for the operation.

·         operation_implementation_definition: represents the optional specification of the operation’s implementation).

·         parameter_definitions: represents the optional map of parameter definitions which the TOSCA orchestrator will make available as inputs to or receive as outputs from the corresponding implementation artifact during its execution.

4.3.6.4.3 Refinement rules

An operation definition within an interface, node, or relationship type (including interface definitions in requirements definitions) uses the following refinement rules when the containing entity type is derived:

·         description: a new definition is unrestricted and will overwrite the one inherited from the operation definition in the parent entity type definition.

·         implementation: a new definition is unrestricted and will overwrite the one inherited from the operation definition in the parent entity type definition.

·         inputs: parameter definitions inherited from the parent entity type may be refined; new parameter definitions may be added.

·         outputs: parameter definitions inherited from the parent entity type may be refined; new parameter definitions may be added.

4.3.6.4.4 Additional requirements

·         The definition of implementation is not allowed in interface type definitions (as a node or node type context is missing at that point). Thus, it can be part only of an operation refinement and not of the original operation definition.

·         The default refinement behavior for implementations SHALL be overwrite. That is, implementation definitions in a derived type overwrite any defined in its parent type.

·         Defining a fixed value for an input parameter (as part of its definition) may only use a parameter_value_expression that is meaningful in the scope of the context. For example, within the context of an Interface Type definition functions such as get_propery or get_attribute cannot be used. Within the context of Node or Relationship Type definitions, these functions may only reference properties and attributes of the same node (i.e. SELF), respectively same relationship or its target (i.e. SELF or TARGET). For example, value: { get_property: [SELF, property1] }

·         Defining attribute mapping as part of the output parameter definition is not allowed in interface type definitions (i.e. as part of operation definitions). It is allowed only in node and relationship type definitions (as part of operation refinements) and has to be meaningful in the scope of the context (i.e. SELF in node types and SELF or TARGET in relationship types).

·         Implementation artifact file names (e.g., script filenames) may include file directory path names that are relative to the TOSCA service template file itself when packaged within a TOSCA Cloud Service Archive (CSAR) file.

4.3.6.4.5 Examples
4.3.6.4.5.1     Single-line example

interfaces:

  Standard:

    start: scripts/start_server.sh

4.3.6.4.5.2     Multi-line example with shorthand implementation definitions

interfaces:

  Configure:

    pre_configure_source:

      implementation:

        primary: scripts/pre_configure_source.sh

        dependencies:

          - scripts/setup.sh

          - binaries/library.rpm

          - scripts/register.py

4.3.6.4.5.3     Multi-line example with extended implementation definitions

interfaces:

  Configure:

    pre_configure_source:

      implementation:

        primary:

          file: scripts/pre_configure_source.sh

          type: tosca.artifacts.Implementation.Bash

          repository: my_service_catalog

        dependencies:

           - file : scripts/setup.sh

             type : tosca.artifacts.Implementation.Bash

             repository : my_service_catalog

 

4.3.6.5 Operation assignment

An operation assignment may be used to assign values for input parameters, specify attribute mappings for output parameters, and define/redefine the implementation definition of an already defined operation in the interface definition. An operation assignment may be used inside interface assignments inside node template or relationship template definitions (this includes when operation assignments are part of a requirement assignment in a node template).

An operation assignment may add or change the implementation and description definition of the operation. Assigning a value to an input parameter that had a fixed value specified during operation definition or refinement is not allowed. Providing an attribute mapping for an output parameter that was mapped during an operation refinement is also not allowed.

Note also that in the operation assignment we can use inputs and outputs that have not been previously defined in the operation definition. This is equivalent to an ad-hoc definition of a parameter, where the type is inferred from the assigned value (for input parameters) or from the attribute to map to (for output parameters).

4.3.6.5.1 Keynames

The following is the list of recognized keynames for an operation assignment:

Keyname

Mandatory

Type

Description

implementation

no

operation implementation definition

The optional definition of the operation implementation. Overrides implementation provided at operation definition.

inputs

no

map of parameter value assignments

The optional map of parameter value assignments for assigning values to operation inputs.

outputs

no

map of parameter

mapping assignments

The optional map of parameter mapping assignments that specify how operation outputs are mapped onto attributes of the node or relationship that contains the operation definition.

4.3.6.5.2 Grammar

Operation assignments have the following grammar:

4.3.6.5.2.1     Short notation

The following single-line grammar may be used when the operation’s implementation definition is the only keyname that is needed, and when the operation implementation definition itself can be specified using a single line grammar:

4.3.6.5.2.2     Extended notation

The following multi-line grammar may be used in Node or Relationship Template definitions when additional information about the operation is needed:

<operation_name>:

   implementation: <operation_implementation_definition>

   inputs:

     <parameter_value_assignments>

   outputs:

     <parameter_mapping_assignments>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         operation_name: represents the mandatory symbolic name of the operation as a string.

·         operation_implementation_definition: represents the optional specification of the operation’s implementation

·         the implementation declared here overrides the implementation provided at operation definition.

·         parameter_value_assignments: represents the optional map of parameter value assignments for passing input parameter values to operations.

·         assignments for operation inputs that are not defined in the operation definition may be provided

·         parameter_mapping_assignments: represents the optional map of parameter mapping assignments that consists of named output values returned by operation implementations (i.e. artifacts) and associated attributes into which this output value must be stored

·         assignments for operation outputs that are not defined in the operation definition may be provided.

4.3.6.5.3 Additional requirements

·         The behavior for implementation of operations SHALL be override. That is, implementation definitions assigned in an operation assignment override any defined in the operation definition.

·         Template authors MAY provide parameter assignments for operation inputs that are not defined in the operation definition.

·         Template authors MAY provide attribute mappings for operation outputs that are not defined in the operation definition.

·         Implementation artifact file names (e.g., script filenames) may include file directory path names that are relative to the TOSCA service template file itself when packaged within a TOSCA Cloud Service Archive (CSAR) file.

4.3.6.5.4 Examples

TBD

 

4.3.6.6 Notification definition

A notification definition defines an asynchronous notification or incoming message that can be associated with an interface. The notification is a way for an external event to be transmitted to the TOSCA orchestrator. Values can be sent with a notification as notification outputs and we can map them to node/relationship attributes similarly to the way operation outputs are mapped to attributes. The artifact that the orchestrator is registering with in order to receive the notification is specified using the implementation keyname in a similar way to operations. As opposed to an operation definition, a notification definition does not include an inputs keyname since notifications are not invoked from the orchestrator.

When the notification is received an event is generated within the orchestrator that can be associated to triggers in policies to call other internal operations and workflows. The notification name (using the <interface_name>.<notification_name> notation) itself identifies the event type that is generated and can be textually used when defining the associated triggers.

A notification definition may be used only inside interface type definitions (this is the only place where new notifications can be defined). Inside interface type, node type, or relationship type definitions (including notifications definitions as part of a requirement definition) we may further refine a notification already defined in the interface type.

A notification definition or refinement inside an interface type definition may not contain a notification implementation definition and it may not contain an attribute mapping as part of its output definition (as both these keynames are node/relationship specific).

4.3.6.6.1 Keynames

The following is the list of recognized keynames for a TOSCA notification definition:

Keyname

Mandatory

Type

Description

description

no

string

The optional description string for the associated notification.

implementation

no

notification implementation definition

The optional definition of the notification implementation.

outputs

no

map of parameter definitions

The optional map of parameter definitions that specify notification output values.

Only as part of node and relationship type definitions, the output definitions may include their mappings onto attributes of the node type or relationship type that contains the definition.

4.3.6.6.2 Grammar

Notification definitions have the following grammar:

4.3.6.6.2.1     Short notation

The following single-line grammar may be used when the notification’s implementation definition is the only keyname that is needed and when the notification implementation definition itself can be specified using a single line grammar:

4.3.6.6.2.2     Extended notation

The following multi-line grammar may be used when additional information about the notification is needed:

<notification_name>:

  description: <notification_description>

  implementation: <notification_implementation_definition>

  outputs:

    <parameter_definitions>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         notification_name: represents the mandatory symbolic name of the notification as a string.

·         notification_description: represents the optional description string for the notification.

·         notification_implementation_definition: represents the optional specification of the notification implementation (i.e. the external artifact that may send notifications)

·         parameter_definitions: represents the optional map of parameter definitions for parameters that the orchestrator will receive as outputs from the corresponding implementation artifact during its execution.

4.3.6.6.3 Refinement rules

A notification definition within an interface, node, or relationship type (including interface definitions in requirements definitions) uses the following refinement rules when the containing entity type is derived:

·         description: a new definition is unrestricted and will overwrite the one inherited from the notification definition in the parent entity type definition.

·         implementation: a new definition is unrestricted and will overwrite the one inherited from the notification definition in the parent entity type definition.

·         outputs: parameter definitions inherited from the parent entity type may be refined; new parameter definitions may be added.

4.3.6.6.4 Additional requirements

·         The definition of implementation is not allowed in interface type definitions (as a node or node type context is missing at that point). Thus, it can be part only of a notification refinement and not of the original notification definition.

·         The default sub-classing (i.e. refinement) behavior for implementations of notifications SHALL be overwrite.  That is, implementation artifacts definitions in a derived type overwrite any defined in its parent type.

·         Defining attribute mapping as part of the output parameter definition is not allowed in interface type definitions (i.e. as part of operation definitions). It is allowed only in node and relationship type definitions (as part of operation refinements).

·         Defining a mapping in an output parameter definition may use an attribute target that is meaningful in the scope of the context. Within the context of Node Type definitions these functions may only reference attributes of the same node (i.e. SELF). Within the context of Relationship Type definitions, they may reference attributes of the relationship itself or its target node (i.e. SELF or TARGET).

·         Implementation artifact file names (e.g., script filenames) may include file directory path names that are relative to the TOSCA service template file itself when packaged within a TOSCA Cloud Service Archive (CSAR) file.

4.3.6.6.5 Examples

TBD

4.3.6.7 Notification assignment

A notification assignment may be used to specify attribute mappings for output parameters and to define/redefine the implementation definition and description definition of an already defined notification in the interface definition. A notification assignment may be used inside interface assignments inside node or relationship template definitions (this includes when notification assignments are part of a requirement assignment in a node template).

Providing an attribute mapping for an output parameter that was mapped during a previous refinement is not allowed. Note also that in the notification assignment we can use outputs that have not been previously defined in the operation definition. This is equivalent to an ad-hoc definition of an output parameter, where the type is inferred from the attribute to map to.

4.3.6.7.1 Keynames

The following is the list of recognized keynames for a TOSCA notification assignment:

Keyname

Mandatory

Type

Description

implementation

no

notification implementation definition

The optional definition of the notification implementation. Overrides implementation provided at notification definition.

outputs

no

map of parameter

mapping assignments

The optional map of parameter mapping assignments that specify how notification outputs values are mapped onto attributes of the node or relationship type that contains the notification definition.

4.3.6.7.2 Grammar

Notification assignments have the following grammar:

4.3.6.7.2.1     Short notation

The following single-line grammar may be used when the notification’s implementation definition is the only keyname that is needed, and when the notification implementation definition itself can be specified using a single line grammar:

4.3.6.7.2.2     Extended notation

The following multi-line grammar may be used in Node or Relationship Template definitions when additional information about the notification is needed:

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         notification_name: represents the mandatory symbolic name of the notification as a string.

·         notification_implementation_definition: represents the optional specification of the notification implementation (i.e. the external artifact that is may send notifications)

·         the implementation declared here overrides the implementation provided at notification definition.

·         parameter_mapping_assignments: represents the optional map of parameter_mapping_assignments that consists of named output values returned by operation implementations (i.e. artifacts) and associated attributes into which this output value must be stored

·         assignments for notification outputs that are not defined in the operation definition may be provided.

4.3.6.7.3 Additional requirements

·         The behavior for implementation of notifications SHALL be override. That is, implementation definitions assigned in a notification assignment override any defined in the notification definition.

·         Template authors MAY provide attribute mappings for notification outputs that are not defined in the corresponding notification definition.

·         Implementation artifact file names (e.g., script filenames) may include file directory path names that are relative to the TOSCA service template file itself when packaged within a TOSCA Cloud Service Archive (CSAR) file.

4.3.6.7.4 Examples

TBD

4.3.6.8 Operation and notification implementation definition

An operation implementation definition specifies one or more artifacts (e.g. scripts) to be used as the implementation for an operation in an interface.

A notification implementation definition specifies one or more artifacts to be used by the orchestrator to subscribe and receive a particular notification (i.e. the artifact implements the notification).

The operation implementation definition and the notification implementation definition share the same keynames and grammar, with the exception of the timeout keyname that has no meaning in the context of a notification implementation definition and should not be used in such.

4.3.6.8.1 Keynames

The following is the list of recognized keynames for an operation implementation definition or a notification implementation definition:

Keyname

Mandatory

Type

Description

primary

no

artifact definition

The optional implementation artifact (i.e., the primary script file within a TOSCA CSAR file). 

dependencies

no

list of

artifact definition

The optional list of one or more dependent or secondary implementation artifacts which are referenced by the primary implementation artifact (e.g., a library the script installs or a

secondary script). 

timeout

no

integer

Timeout value in seconds. Has no meaning and should not be used within a notification implementation definition.

4.3.6.8.2 Grammar

Operation implementation definitions and notification implementation definitions have the following grammar:

4.3.6.8.2.1     Short notation for use with single artifact

The following single-line grammar may be used when only a primary implementation artifact name is needed:

This notation can be used when the primary artifact name uniquely identifies the artifact, either because it refers to an artifact specified in the artifacts section of a type or template, or because it represents the name of a script in the CSAR file that contains the definition.

4.3.6.8.2.2     Short notation for use with multiple artifacts

The following multi-line short-hand grammar may be used when multiple artifacts are needed, but each of the artifacts can be uniquely identified by name as before:

implementation:

  primary: <primary_artifact_name>

  dependencies:

    - <list_of_dependent_artifact_names>

  timeout: 60

4.3.6.8.2.3     Extended notation for use with single artifact

The following multi-line grammar may be used in Node or Relationship Type or Template definitions when only a single artifact is used but additional information about the primary artifact is needed (e.g. to specify the repository from which to obtain the artifact, or to specify the artifact type when it cannot be derived from the artifact file extension):

implementation:

  primary:

    <primary_artifact_definition>

  timeout: 100

4.3.6.8.2.4     Extended notation for use with multiple artifacts

The following multi-line grammar may be used in Node or Relationship Type or Template definitions when there are multiple artifacts that may be needed for the operation to be implemented and additional information about each of the artifacts is required:

implementation:

  primary:

    <primary_artifact_definition>  

  dependencies:

    - <list_of_dependent_artifact definitions>

  timeout: 120

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         primary_artifact_name: represents the optional name (string) of an implementation artifact definition (defined elsewhere), or the direct name of an implementation artifact’s relative filename (e.g., a service template-relative, path-inclusive filename or absolute file location using a URL).

·         primary_artifact_definition: represents a full inline definition of an implementation artifact.

·         list_of_dependent_artifact_names: represents the optional ordered list of one or more dependent or secondary implementation artifact names (as strings) which are referenced by the primary implementation artifact.  TOSCA orchestrators will copy these files to the same location as the primary artifact on the target node so as to make them accessible to the primary implementation artifact when it is executed.

·         list_of_dependent_artifact_definitions: represents the ordered list of one or more inline definitions of dependent or secondary implementation artifacts. TOSCA orchestrators will copy these artifacts to the same location as the primary artifact on the target node so as to make them accessible to the primary implementation artifact when it is executed.

 

4.3.7 Artifacts

4.3.7.1 Artifact Type

An Artifact Type 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.

4.3.7.1.1 Keynames

The Artifact Type is a TOSCA type entity and has the common keynames listed in Section 4.2.5.2 Common keynames in type definitions. In addition, the Artifact Type has the following recognized keynames:

Keyname

Mandatory

Type

Description

mime_type

no

string

The optional mime type property for the Artifact Type.

file_ext

no

list of string

The optional file extension property for the Artifact Type.

properties

no

map of

property definitions

An optional map of property definitions for the Artifact Type.

4.3.7.1.2 Grammar

Artifact Types have following grammar:

<artifact_type_name>:

  derived_from: <parent_artifact_type_name>

  version: <version_number>

  metadata:

    <map of string>

  description: <artifact_description>

  mime_type: <mime_type_string>

  file_ext: [ <file_extensions> ]

  properties:    

    <property_definitions>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         artifact_type_name: represents the name of the Artifact Type being declared as a string.

·         parent_artifact_type_name: represents the name of the Artifact Type this Artifact Type definition derives from (i.e., its “parent” type).

·         version_number: represents the optional TOSCA version number for the Artifact Type.

·         artifact_description: represents the optional description string for the Artifact Type.

·         mime_type_string: represents the optional Multipurpose Internet Mail Extensions (MIME) standard string value that describes the file contents for this type of Artifact Type as a string.

·         file_extensions: represents the optional list of one or more recognized file extensions for this type of artifact type as strings.

·         property_definitions: represents the optional map of property definitions for the artifact type.

4.3.7.1.3 Derivation rules

During Artifact Type derivation the keyname definitions follow these rules:

·         mime_type: a new definition is unrestricted and will overwrite the one inherited from the parent type.

·         file_ext: a new definition is unrestricted and will overwrite the one inherited from the parent type.

·         properties: existing property definitions may be refined; new property definitions may be added.

4.3.7.1.4 Examples

my_artifact_type:

  description: Java Archive artifact type

  derived_from: tosca.artifact.Root

  mime_type: application/java-archive

  file_ext: [ jar ]

  properties:

    id:

      description: Identifier of the jar

      type: string

      required: true

    creator:

      description: Vendor of the java implementation on which the jar is based

      type: string

      required: false

4.3.7.1.5 Additional Requirements

·         The ‘mime_type’ keyname  is meant to have values that are Apache mime types such as those defined here: http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types

4.3.7.1.6 Notes

Information about artifacts can be broadly classified in two categories that serve different purposes:

·         Selection of artifact processor. This category includes informational elements such as artifact version, checksum, checksum algorithm etc. and s used by TOSCA Orchestrator to select the correct artifact processor for the artifact. These informational elements are captured in TOSCA as keywords for the artifact.

·         Properties processed by artifact processor. Some properties are not processed by the Orchestrator but passed on to the artifact processor to assist with proper processing of the artifact. These informational elements are described through artifact properties.

 

4.3.7.2 Artifact definition

An artifact definition 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.

4.3.7.2.1 Keynames

The following is the list of recognized keynames for a TOSCA artifact definition when using the extended notation:

Keyname

Mandatory

Type

Description

type

yes

string

The mandatory artifact type for the artifact definition.

file

yes

string

The mandatory URI string (relative or absolute) which can be used to locate the artifact’s file.

repository

no

string

The optional name of the repository definition which contains the location of the external repository that contains the artifact.  The artifact is expected to be referenceable by its file URI within the repository.

description

no

string

The optional description for the artifact definition.

deploy_path

no

string

The file path the associated file will be deployed on within the target node’s container.

artifact_version

no

string

The version of this artifact. One use of this artifact_version is to declare the particular version of this artifact type, in addition to its mime_type (that is declared in the artifact type definition). Together with the mime_type it may be used to select a particular artifact processor for this artifact. For example, a python interpreter that can interpret python version 2.7.0.

checksum

no

string

The checksum used to validate the integrity of the artifact.

checksum_algorithm

no

string

Algorithm used to calculate the artifact checksum (e.g. MD5, SHA [Ref]). Shall be specified if checksum is specified for an artifact.

 

properties

no

map of

property

assignments

The optional map of property assignments associated with the artifact.

4.3.7.2.2 Grammar

Artifact definitions have one of the following grammars:

4.3.7.2.2.1     Short notation

The following single-line grammar may be used when the artifact’s type and mime type can be inferred from the file URI:

4.3.7.2.2.2     Extended notation:

The following multi-line grammar may be used when the artifact’s definition’s type and mime type need to be explicitly declared:

<artifact_name>:

  description: <artifact_description>

  type: <artifact_type_name>

  file: <artifact_file_URI>

  repository: <artifact_repository_name>

  deploy_path: <file_deployment_path>

  version: <artifact _version>

  checksum: <artifact_checksum>

  checksum_algorithm: <artifact_checksum_algorithm>

  properties: <property assignments>

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         artifact_name: represents the mandatory symbolic name of the artifact as a string.

·         artifact_description: represents the optional description for the artifact.

·         artifact_type_name: represents the mandatory artifact type the artifact definition is based upon.

·         artifact_file_URI: represents the mandatory URI string (relative or absolute) which can be used to locate the artifact’s file.

·         artifact_repository_name: represents the optional name of the repository definition to use to retrieve the associated artifact (file) from.

·         file_deployement_path: represents the optional path the artifact_file_URI will be copied into within the target node’s container.

·         artifact_version: represents the version of artifact

·         artifact_checksum: represents the checksum of the Artifact

·         artifact_checksum_algorithm:represents the algorithm for verifying the checksum. Shall be specified if checksum is specified

·         properties: represents an optional map of property assignments associated with the artifact

4.3.7.2.3 Refinement rules

Artifact definitions represent specific external entities. If a certain artifact definition cannot be reused as is, then it may be completely redefined.

·         If an artifact is redefined, the symbolic name from the definition in the parent node type is reused, but no keyname definitions are inherited from the definition in the parent node type, and the new definition completely overwrites the definition in the parent.

·         If the artifact is not redefined the complete definition is inherited from the parent node type.

4.3.7.2.4 Examples

The following represents an artifact definition:

my_file_artifact: ../my_apps_files/operation_artifact.txt

The following example represents an artifact definition with property assignments:

artifacts:

  sw_image:

    description: Image for virtual machine

    type: tosca.artifacts.Deployment.Image.VM

    file: http://10.10.86.141/images/Juniper_vSRX_15.1x49_D80_preconfigured.qcow2

    checksum: ba411cafee2f0f702572369da0b765e2

    version: 3.2

    checksum_algorithm: MD5

    properties:

      name: vSRX

      container_format: BARE

      disk_format: QCOW2

      min_disk: 1 GB

      size: 649 MB

 

4.4 Properties, Attributes, and Parameters

This section presents handling data in TOSCA via properties, attributes, and parameters.

The type of the values they contain can be divided into built-in primitive types, special types that are extensions of the primitive types, and collection types, as well as user-defined refinements of these and complex data types that can themselves be defined in TOSCA profiles and the TOSCA service template.

Values can also be evaluated from expressions based on TOSCA functions. [See XXX]

The following table summarizes the built-in types. All of these type names are reserved and cannot be used for custom data types. Note, however, that it is possible to derive a custom data type from a primitive type in order to add constraints.

Primitive Types: (section 4.4.1)

·         string

·         integer

·         float

·         boolean

·         bytes

·         nil

Special Types: (section 4.4.2)

·         range

·         timestamp

·         scalar-unit.size

·         scalar-unit.time

·         scalar-unit.frequency

·         scalar-unit.bitrate

Collection Types: (section 4.4.3)

·         list

·         map

4.4.1 Primitive Types

The TOSCA primitive types have been specified to allow for the broadest possible support for implementations.

Guiding principles:

1.     Because TOSCA service templates are written in YAML they must support all the literal primitives in YAML. However, it is important to also allow for consistency of representation of external data, e.g. service template inputs and outputs, property and attribute values stored in a database, etc.

2.     Adherence to 64-bit precision to ensure portability of numeric data.

3.     TOSCA parsers shall not automatically convert between primitive types. Thus, care should be taken to use the correct YAML notation for that type. Details will be provided below.

4.4.1.1 string

An array of Unicode runes. (For storing an arbitrary array of bytes see the “bytes” type, below.)

Because we adhere to 64-bit precision, the minimum length of strings is 0 and the maximum length of strings is 4,294,967,295.

TOSCA does not specify a character encoding. For example, a string could be encoded as UTF-8 or UTF-16. The exact encoding used depends on the implementation.

Be aware that YAML parsers will attempt to parse unquoted character sequences as other types (booleans, integers, floats, etc.) before falling back to the !!string type. For example, the unquoted sequence “0.1” would be interpreted as a YAML !!float. Likewise, the unquoted sequence “nan” would become the !!float value of not-a-number. However, in TOSCA a string value must be specified in YAML as a !!string.

A TOSCA parser shall not attempt to convert other primitive types to strings if a string type is required. This requirement is necessary for ensuring portability, because there is no single, standard representation for the other types, e.g. scientific notations for decimals, the words “true” vs. “True” for booleans, etc. In YAML users should thus add quotation marks around literal strings that YAML would otherwise interpret as other types.

This following example would be invalid if there were no quotation marks around “0.1”:

node_types:

  Node:

  properties:

    name:

    type: string

 

topology_template:

  node_templates:

    node:

      type: Node

      properties:

        name: "0.1"

 

4.4.1.1.1 Notes:

4.     There are various ways to specify literal !!string data in YAML for handling indentation, newlines, as well as convenient support for line folding for multiline strings. All may be used in TOSCA. A TOSCA parser shall not modify the YAML string in any way, e.g. no trimming of whitespace or newlines. [YAML 1.2 chapter 6]

5.     The TOSCA functions “concat”, “join”, and “token” and the TOSCA constraints “length”, “min_length”, “max_length”, and “pattern” are all Unicode-aware. Specifically, the length of a string is a count of its runes, not the length of the byte array, which may differ according to the encoding. [See XXX]

6.     The TOSCA constraints that check for equality, “equal” and “valid_values”, should work regardless of the Unicode encoding. For example, comparing two strings that are “!”, one of which is in UTF-8 and is encoded as “0x21”, the other which is in UTF-16 and is encoded as “0x0021”, would result in equality.  For simplicity, implementations may standardize on a single encoding, e.g. UTF-8, and convert all other encodings to it. [See XXX]

7.     Relatedly, although in YAML 1.2 a !!string is already defined as a Unicode sequence [YAML 1.2 section 10.1.1.3], this sequence can be variously encoded according to the character set and encoding of the YAML stream [YAML 1.2 chapter 5]. The consequence is that a TOSCA string specified in literal YAML may inherit the encoding of the YAML document. Again, implementations may prefer to convert all strings to a single encoding.

8.     TOSCA strings cannot be the null value but can be empty strings (a string with length zero). [See “nil”, below]

9.     YAML is a streaming format, but TOSCA strings are explicitly not streams and thus do have a size limit. Thus, TOSCA implementations should check against the size limit.

[Tal’s comment: for functions and constraints we should specify their exact behavior for various primitive types. Some won’t work on all types, e.g. “length” should not work on integers.]

4.4.1.2 integer

A 64-bit signed integer.

For simplicity, TOSCA does not have integers of other bit widths, nor does it have an unsigned integer type. However, it is possible to enforce most of these variations using data type constraints [see XXX].

For example, this would be a custom data type for unsigned 16-bit integers:

data_types:

  UInt16:

    derived_from: integer

    constraints:

      - in_range: [ 0, 0xFFFF ]

 

4.4.1.2.1 Notes

YAML allows for the standard decimal notation as well as hexadecimal and octal notations [YAML 1.2 example 2.19]. In the above example we indeed used the hexadecimal notation.

1.     The JSON schema for YAML 1.2 [YAML 1.2 chapter 10.2] allows for compatibility with JSON, such that YAML would be a superset of JSON. However, note that the JSON format does not distinguish between integers and floats, and thus many JSON implementations use floats instead of integers.

2.     TOSCA does not specify the endianness of integers and indeed makes no requirements for data representation.

4.4.1.3 float

A 64-bit (double-precision) floating-point number [IEEE 754], including the standard values for negative infinity, positive infinity, and not-a-number.

Be aware that YAML parsers will parse numbers with a decimal point as !!float even if they could be represented as !!int, and likewise numbers without a decimal point would always be parsed as !!int.

A TOSCA parser shall not attempt to convert a YAML !!int to a float. This requirement is necessary for avoiding rounding errors and ensuring portability. Users should thus add a “.0” suffix to literal integers that must be floats. Note that this even includes zero, i.e. users must specify “0” for a zero integer and “0.0” for a zero float.

This following example would be invalid if there were no “.0” suffix added to “10”:

node_types:

  Node:

    properties:

      velocity:

        type: float

 

topology_template:

  node_templates:

    node:

      type: Node

      properties:

        velocity: 10.0

 

4.4.1.3.1 Notes

3.     In addition to decimal, YAML also allows for specifying floats using scientific notation as well as special unquoted words for negative infinity, positive infinity, and not-a-number [YAML 1.2 example 2.20].

4.     TOSCA does not specify how to convert to other precisions nor to other formats, e.g. Bfloat16 and TensorFloat-32.

5.     TOSCA does not specify the endianness of floats and indeed makes no requirements for data representation.

4.4.1.4 boolean

A single bit.

Note that in YAML literal booleans can be only either the unquoted all-lowercase words “true” or “false”.

A TOSCA parser shall not attempt to convert these values, nor variations such as “yes” or “True”, as quoted strings to booleans, nor shall it attempt to convert integer values (such as 1 and 0) to booleans. This requirement is necessary for ensuring portability as well as clarity.

4.4.1.5 bytes

An array of arbitrary bytes. Because we adhere to 64-bit precision, the minimum length of bytes is 0 and the maximum length of bytes is 4,294,967,295.

To specify literal bytes in YAML you must use a Base64-encoded !!string [RFC 2045 section 6.8]. There exist many free tools to help you convert arbitrary data to Base64.

Example:

node_types:

  Node:

    properties:

      preamble:

        type: bytes

 

topology_template:

  node_templates:

    node:

      type: Node

        properties:

          preamble: "\

R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\

OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\

+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\

AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs="

 

4.4.1.5.1 Notes

6.     There is no standard way to represent literal bytes in YAML 1.2. Though some YAML implementations may support the !!binary type working draft, to ensure portability TOSCA implementations shall not accept this YAML type.

7.     The TOSCA constraints “length”, “min_length”, and “max_length” work differently for the bytes type vs. the string type. For the latter the length is the count of Unicode runes, not the count of bytes.

8.     TOSCA bytes values cannot be the null value but can be empty arrays (a bytes value with length zero). [See “nil”, below]

4.4.1.6 nil

The nil type always has the same singleton value. No other type can have this value.

This value is provided literally in YAML via the unquoted all-lowercase word “null”.

Example:

node_types:

  Node:

    properties:

      nothing:

        type: nil

        required: true

 

topology_template:

  node_templates:

    node:

      type: Node

      properties:

        nothing: null

 

Note that a nil-typed value is distinct from an unassigned value. For consistency TOSCA requires you to assign nil values even though their value is obvious. Thus, the above example would be invalid if we did not specify the null value for the property at the node template.

Following is a valid example of not assigning a value:

node_types:

  Node:

    properties:

      nothing:

        type: nil

        required: false

 

topology_template:

  node_templates:

    node:

      type: Node

4.4.2 Special Types

4.4.2.1 TOSCA version

A TOSCA version string.

TOSCA supports the concept of “reuse” of type definitions, as well as template definitions which could be versioned and change over time.  It is important to provide a reliable, normative means to represent a version string which enables the comparison and management of types and templates over time.

4.4.2.1.1 Grammar

TOSCA version strings have the following grammar:

<major_version>.<minor_version>[.<fix_version>[.<qualifier>[-<build_version] ] ]

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         major_version: is a mandatory integer value greater than or equal to 0 (zero)

·         minor_version: is a mandatory integer value greater than or equal to 0 (zero).

·         fix_version: is an optional integer value greater than or equal to 0 (zero).

·         qualifier: is an optional string that indicates a named, pre-release version of the associated code that has been derived from the version of the code identified by the combination major_version, minor_version and fix_version numbers.

·         build_version: is an optional integer value greater than or equal to 0 (zero) that can be used to further qualify different build versions of the code that has the same qualifer_string.

4.4.2.1.2 Version Comparison

·         When specifying a version string that contains just a major and a minor version number, the version string must be enclosed in quotes to prevent the YAML parser from treating the version as a floating point value.

·         When comparing TOSCA versions, all component versions (i.e., major, minor and fix) are compared in sequence from left to right.

·         TOSCA versions that include the optional qualifier are considered older than those without a qualifier.

·         TOSCA versions with the same major, minor, and fix versions and have the same qualifier string, but with different build versions can be compared based upon the build version.

·         Qualifier strings are considered domain-specific. Therefore, this specification makes no recommendation on how to compare TOSCA versions with the same major, minor and fix versions, but with different qualifiers strings and simply considers them different branches derived from the same code.

4.4.2.1.3 Examples

Examples of valid TOSCA version strings:

# basic version strings

‘6.1’

2.0.1

 

# version string with optional qualifier

3.1.0.beta

 

# version string with optional qualifier and build version

1.0.0.alpha-10

4.4.2.1.4 Notes

·         [Maven-Version] The TOSCA version type is compatible with the Apache Maven versioning policy.

4.4.2.1.5 Additional Requirements

·         A version value of zero (i.e., ‘0.0’, or ‘0.0.0’) SHALL indicate there no version provided.

·         A version value of zero used with any qualifiers SHALL NOT be valid.

4.4.2.2 TOSCA range type

The range type can be used to define numeric ranges with a lower and upper boundary. For example, this allows for specifying a range of ports to be opened in a firewall.

4.4.2.2.1 Grammar

TOSCA range values have the following grammar:

[<lower_bound>, <upper_bound>]  

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         lower_bound: is a mandatory integer value that denotes the lower boundary of the range.

·         upper_bound: is a mandatory integer value that denotes the upper boundary of the range. This value MUST be greater than or equal to lower_bound.

4.4.2.2.2 Keywords

The following Keywords may be used in the TOSCA range type:

Keyword

Applicable Types

Description

UNBOUNDED

scalar

Used to represent an unbounded upper bounds (positive) value in a set for a scalar type.

4.4.2.2.3 Examples

Example of a node template property with a range value:

# numeric range between 1 and 100

a_range_property: [ 1, 100 ]

 

# a property that has allows any number 0 or greater

num_connections: [ 0, UNBOUNDED ]

4.4.2.3 TOSCA timestamp type

A local instant in time containing two elements: the local notation plus the time zone offset.

TOSCA timestamps are represented as strings following [RFC 3339], which in turn uses a simplified profile of [ISO 8601]. TOSCA adds an exception to RFC 3339: though RFC 3339 supports timestamps with unknown local offsets, represented as the "-0" timezone, TOSCA does not support this feature and will treat the unknown timezone as UTC. There are two reasons for this exception: the first is that many systems do not support this distinction and TOSCA aims for interoperability, and the second is that timestamps with unknown timezones cannot be converted to UTC, making it impossible to apply comparison constraints. If this feature is required it can be supported via a custom data type (see XXX).

4.4.2.3.1 Notes

·         It is strongly recommended that all literal YAML timestamps be enclosed in quotation marks to ensure that they are parsed as strings. Otherwise, some YAML parsers might interpret them as the YAML !!timestamp type, which is rejected by TOSCA (see below).

·         The TOSCA constraints "equal", "greater_than", "greater_or_equal", "less_than", and "less_or_equal" all use the universal instant, i.e. as the local instant is converted to UTC by applying the timezone offset.

·         Some YAML implementations may support the !!timestamp type working draft, but to ensure portability TOSCA implementations shall not accept this YAML type. Also note that the YAML !!timestamp supports a relaxed notation with whitespace, which does not conform to RFC 3339.

·         RFC 3339 is based on the Gregorian calendar, including leap years and leap seconds, and is thus explicitly culturally biased. It cannot be used for non-Gregorian locales. Other calendar representations can be supported via custom data types (see XXX).

·         Time zone information is expressed and stored numerically as an offset from UTC, thus daylight savings and other local changes are not included.

·         TOSCA does not specify a canonical representation for timestamps. The only requirement is that representations adhere to RFC 3339.

4.4.2.4 TOSCA scalar-unit type

The scalar-unit type can be used to define scalar values along with a unit from the list of recognized units provided below.

4.4.2.4.1 Grammar

TOSCA scalar-unit typed values have the following grammar:

<scalar> <unit>  

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

·         scalar: is a mandatory scalar value.

·         unit: is a mandatory unit value. The unit value MUST be type-compatible with the scalar.

4.4.2.4.2 Additional requirements

·         Whitespace: any number of spaces (including zero or none) SHALL be allowed between the scalar value and the unit value.

·         It SHALL be considered an error if either the scalar or unit portion is missing on a property or attribute declaration derived from any scalar-unit type.

·         When performing constraint clause evaluation on values of the scalar-unit type, both the scalar value portion and unit value portion SHALL be compared together (i.e., both are treated as a single value). For example, if we have a property called storage_size (which is of type scalar-unit) a valid range constraint would appear as follows:

      storage_size: in_range [ 4 GB, 20 GB ]

where storage_size’s range will be evaluated using both the numeric and unit values (combined together), in this case ‘4 GB’ and ’20 GB’.

4.4.2.4.3 Concrete Types

The scalar-unit type grammar is abstract and has four recognized concrete types in TOSCA:

·         scalar-unit.size – used to define properties that have scalar values measured in size units.

·         scalar-unit.time – used to define properties that have scalar values measured in size units.

·         scalar-unit.frequency – used to define properties that have scalar values measured in units per second.

·         scalar-unit.bitrate – used to define properties that have scalar values measured in bits or bytes per second

These types and their allowed unit values are defined below.

4.4.2.4.4 scalar-unit.size
4.4.2.4.4.1     Recognized Units

Unit

Usage

Description

B

size

byte

kB

size

kilobyte (1000 bytes)

KiB

size

kibibytes (1024 bytes)

MB

size

megabyte (1000000 bytes)

MiB

size

mebibyte (1048576 bytes)

GB

size

gigabyte (1000000000 bytes)

GiB

size

gibibytes (1073741824 bytes)

TB

size

terabyte (1000000000000 bytes)

TiB

size

tebibyte (1099511627776 bytes)

4.4.2.4.4.2     Examples

# Storage size in Gigabytes

properties:

  storage_size: 10 GB

4.4.2.4.4.3     Notes

·         The unit values recognized by TOSCA for size-type units are based upon a subset of those defined by GNU at http://www.gnu.org/software/parted/manual/html_node/unit.html, which is a non-normative reference to this specification.

·         TOSCA treats these unit values as case-insensitive (e.g., a value of ‘kB’, ‘KB’ or ‘kb’ is equivalent), but it is considered best practice to use the case of these units as prescribed by GNU.

·         Some cloud providers may not support byte-level granularity for storage size allocations. In those cases, these values could be treated as desired sizes and actual allocations will be based upon individual provider capabilities.

4.4.2.4.5 scalar-unit.time
4.4.2.4.5.1     Recognized Units

Unit

Usage

Description

d

time

days

h

time

hours

m

time

minutes

s

time

seconds

ms

time

milliseconds

us

time

microseconds

ns

time

nanoseconds

4.4.2.4.5.2     Examples

# Response time in milliseconds

properties:

  respone_time: 10 ms

4.4.2.4.5.3     Notes

·         The unit values recognized by TOSCA for time-type units are based upon a subset of those defined by International System of Units whose recognized abbreviations are defined within the following reference: 

      http://www.ewh.ieee.org/soc/ias/pub-dept/abbreviation.pdf

      This document is a non-normative reference to this specification and intended for publications or grammars enabled for Latin characters which are not accessible in typical programming languages

4.4.2.4.6 scalar-unit.frequency
4.4.2.4.6.1     Recognized Units

Unit

Usage

Description

Hz

frequency

Hertz, or Hz. equals one cycle per second.

kHz

frequency

Kilohertz, or kHz, equals to 1,000 Hertz

MHz

frequency

Megahertz, or MHz, equals to 1,000,000 Hertz or 1,000 kHz

GHz

frequency

Gigahertz, or GHz, equals to 1,000,000,000 Hertz, or 1,000,000 kHz, or 1,000 MHz.

4.4.2.4.6.2     Examples

# Processor raw clock rate

properties:

  clock_rate: 2.4 GHz

4.4.2.4.6.3     Notes

·         The value for Hertz (Hz) is the International Standard Unit (ISU) as described by the Bureau International des Poids et Mesures (BIPM) in the “SI Brochure: The International System of Units (SI) [8th edition, 2006; updated in 2014]”, http://www.bipm.org/en/publications/si-brochure/

4.4.2.4.7 scalar-unit.bitrate
4.4.2.4.7.1     Recognized Units

Unit

Usage

Description

bps

bitrate

bit per second

Kbps

bitrate

kilobit (1000 bits) per second

Kibps

bitrate

kibibits (1024 bits) per second

Mbps

bitrate

megabit (1000000 bits) per second

Mibps

bitrate

mebibit (1048576 bits) per second

Gbps

bitrate

gigabit (1000000000 bits) per second

Gibps

bitrate

gibibits (1073741824 bits) per second

Tbps

bitrate

terabit (1000000000000 bits) per second

Tibps

bitrate

tebibits (1099511627776 bits) per second

4.4.2.4.7.2     Examples

# Somewhere in a node template definition

requirements:

  - link:

      node_filter:

        capabilities:

          - myLinkable

              properties:

                bitrate:

                 - greater_or_equal: 10 Kbps # 10 * 1000 bits per second at least

4.4.3 Collection Types

4.4.3.1 TOSCA list type

The list type allows for specifying multiple values for a parameter of property. For example, if an application allows for being configured to listen on multiple ports, a list of ports could be configured using the list data type.

Note that entries in a list for one property or parameter must be of the same type. The type (for simple entries) or schema (for complex entries) is defined by the mandatory entry_schema attribute of the respective property definition, attribute definitions, or input or output parameter definitions.

4.4.3.1.1 Grammar

TOSCA lists are essentially normal YAML lists with the following grammars:

4.4.3.1.1.1      Square bracket notation

 [ <list_entry_1>, <list_entry_2>, ... ]

4.4.3.1.1.2     Bulleted list notation

- <list_entry_1>

- ...

- <list_entry_n>

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         <list_entry_*>: represents one entry of the list.

4.4.3.1.2 Declaration Examples
4.4.3.1.2.1     List declaration using a simple type

The following example shows a list declaration with an entry schema based upon a simple integer type (which has additional constraints):

<some_entity>:

  ...

  properties: 

    listen_ports:

      type: list

      entry_schema:

        description: listen port entry (simple integer type)

        type: integer

        constraints:

          - max_length: 128

4.4.3.1.2.2     List declaration using a complex type

The following example shows a list declaration with an entry schema based upon a complex type:

<some_entity>:

  ...

  properties: 

    products:

      type: list

      entry_schema:

        description: Product information entry (complex type) defined elsewhere

        type: ProductInfo

4.4.3.1.3 Definition Examples

These examples show two notation options for defining lists:

·         A single-line option which is useful for only short lists with simple entries.

·         A multi-line option where each list entry is on a separate line; this option is typically useful or more readable if there is a large number of entries, or if the entries are complex.

4.4.3.1.3.1     Square bracket notation

listen_ports: [ 80, 8080 ]

4.4.3.1.3.2     Bulleted list notation

listen_ports:

  - 80

  - 8080

4.4.3.2 TOSCA map type

The map type allows for specifying multiple values for a parameter of property as a map. In contrast to the list type, where each entry can only be addressed by its index in the list, entries in a map are named elements that can be addressed by their keys.

Note that entries in a map for one property or parameter must be of the same type. The type (for simple entries) or schema (for complex entries) is defined by the entry_schema attribute of the respective property definition, attribute definition, or input or output parameter definition. In addition, the keys that identify entries in a map must be of the same type as well. The type of these keys is defined by the key_schema attribute of the respective property_definition, attribute_definition, or input or output parameter_definition. If the key_schema is not specified, keys are assumed to be of type string.

4.4.3.2.1 Grammar

TOSCA maps are normal YAML dictionaries with following grammar:

4.4.3.2.1.1     Single-line grammar

{ <entry_key_1>: <entry_value_1>, ..., <entry_key_n>: <entry_value_n> }

4.4.3.2.1.2     Multi-line grammar

<entry_key_1>: <entry_value_1>

...

<entry_key_n>: <entry_value_n>

In the above grammars, the pseudo values that appear in angle brackets have the following meaning:

·         entry_key_*: is the mandatory key for an entry in the map

·         entry_value_*: is the value of the respective entry in