Update TOSCA requirements for type and template

Registered by Sahdev Zala

The final to be draft of TOSCA spec has drastically changed how TOSCA types should declare requirements and how requirements can be assigned in the node template.
The TOSCA type definition must declare requirement with following keywords as shown in example below for a requirement for Compute node type. The 'capability' is required one where as other keywords are optional and can be used in any combination. However, it is preferred that, all keywords (capability, relationship and node) are mentioned in the type definition.
  requirements:
    - local_storage:
        capability: tosca.capabilities.Attachment
        node: tosca.nodes.BlockStorage
        relationship: tosca.relationships.AttachTo
        occurrences: [0, UNBOUNDED]
The current logic to create relationship between TOSCA types are based on the requirements and needs to be updated accordingly to above changes. The TOSCA definition for base type is defined in the TOSCA_definition.yaml file in the 'toscalib/elements' directory.

On the TOSCA template side, the node template can specify requirement using 'capability, relationship and node' keywords or just by a capability name (as provided in most of the existing tests templates under the tests directory in toscalib)
There is a notion of target_filter or node_filter but that doesn't need to be implemented in this blueprint.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Sahdev Zala
Direction:
Needs approval
Assignee:
srinivas_tadepalli
Definition:
New
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Sahdev Zala
Completed by
Sahdev Zala

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/tosca-requirement-changes,n,z

Addressed by: https://review.openstack.org/175828
    Update TOSCA requirements for template and type

Addressed by: https://review.openstack.org/216107
    Added occurrences of requirements validation

(spzala) one of the above changes were abandoned, as heat-translator project was split into two projects i.e. new one tosca-parser. Changes were implemented under tosca-parser

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.