Download presentation
Presentation is loading. Please wait.
1
Enhancements for Simple YAML Profile v1.2
April 3, 2017 Thinh Nguyenphu, Nokia, Prabakaran Venugopal, Nokia, Moshe Elisha, Nokia,
2
Adding metadata to parameter definition
(see Simple YAML v1.1: section ) Goal – Store arbitrary information on an parameter. Use case - Protect sensitive information (such as passwords) when user keying in GUI or group inputs together in GUI systems. Proposal – Add optional “metadata” keyname to parameter / input definition. Note: TOSCA implementers can decide on some keys to have special unified meaning across implementations inputs: pin_code: type: integer description: 4 digits PIN code constraints: - in_range: [ 1000, 9999 ] metadata: # Arbitrary key value map masked: true group: common
3
Support generic data structures
See Simple YAML v1.1: section 3.2 (Parameter and property types) Goal - Support generic / unknown / complexed data structures for better integration with external systems. Use cases Expose a parameter that is simply passed as is to underlying layers (for example, Heat supports the “json” parameter data type). Allow reading unknown data structures from external systems (for example, using “get_operation_output” from a workflow output). Proposal – Add “json” as a valid data type for input / property / attribute. inputs: fw_server_metadata: type: json Note: This enhancement is already existed in Heat template Heat Orchestration Template - Parameter section
4
See Simple YAML v1.1: section 3.5.12.2 and 3.5.2
Validate JSON values See Simple YAML v1.1: section and 3.5.2 Goal – Enforce a certain schema / structure on JSON type inputs / properties / attributes Use case – Passing a metadata object with certain rules and structure that describes a VM expiration policy. Proposal – Add “schema” as a valid constraint type (applicable for JSON data type). inputs: metadata: type: json constraints: - schema: { "properties": { "expiration": { "type": "integer", "minimum": 0 }, "action": { "enum": [ "stop", "terminate" ] } "required": ["expiration"]
5
Support custom constraints
See Simple YAML v1.1: section (Constraint Clause) Goal – A way for the author to define a custom logic that will validate values Use cases Validate that a value against dynamic valid values Add a constraint logic that does not exist (for example, “prime numbers”) Proposal – Add “custom” as a valid constraint type. The “my_int” value will be passed to prime_constraint.sh as an argument and the script will exit with exit code of zero if the value is a prime number. inputs: my_int: type: integer constraints: - custom: prime_constraint.sh
6
Control operation executions
See Simple YAML v1.1: section (Interface Definition) Goal – An easy mechanism to handle interface operations failures Use case – Loops waiting for resources (Like waiting for SSH on a VM) Proposal – Add “timeout” and “retry” keynames to interface operation. node_templates: my_node: ... interfaces: Standard: create: implementation: change_hostname.sh timeout: 500 # timeout in seconds for each iteration retry: # Retry 5 times with 30 seconds delay delay: 30 count: 5
7
Assigning attributes values after operation execution
See Simple YAML v1.1: section (Interface Definition) Goal – Assign values to attributes after a successful operation execution Use cases Assigning an operation output in an attribute for easy access Creating a Nuage managed network in OpenStack that requires a Nuage subnet and a Neutron network Proposal – Add “assign” clause to allow setting attributes. Read the assign section as follows: “After executing implementation, assign the value <value> into attribute <attribute_name> of entity <destination>” node_templates: my_node: ... interfaces: Standard: start: implementation: start.sh assign: - value: { get_operation_output: [ SELF, Standard, start, pid ] } destination: SELF attribute_name: process_id
8
Define attributes as final
See Simple YAML v1.1: section (Attribute Definition) Goal – Protect system attributes or any attribute that should not be changed after it was assigned once Use case – Prevent from overriding system attributes Proposal – Add “final” keyname to attribute definition. Default false. tosca.nodes.Root: derived_from: tosca.entity.Root description: The TOSCA Node Type all other TOSCA base Node Types derive from attributes: tosca_id: type: string final: true tosca_name: state: ...
9
Enhance concat intrinsic function
See Simple YAML v1.1: section (Intrinsic functions, concat) Goal – Allow concatenation of values of different types with a custom delimiter Use case – Many use cases like generating names. Proposal – Add optional “delimiter” argument to “concat” and support all kind of data types. Alternative – Add a new “join” function and keep “concat”. outputs: example1: value: { concat: [["prefix", 1111, "suffix" ], "_" ] } # prefix_1111_suffix example2: value: { concat: [["prefix", 1111, "suffix" ]] } # prefix1111suffix Note: This enhancement is already existed in Heat template Heat Orchestration Template - Intrinsic functions, list_join
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.