Enable ordered nodes graph

Registered by Denis Makogon

In order to give an ability to consume TOSCA graph in more advanced way, it is necessary to implement an ability to extract ordered graph from TOSCA graph.

So, here's an example of a template and its graph:

tosca_definitions_version: tosca_simple_yaml_1_0

description: Attempts to authorize to OpenStack

#####################################################################
# Imports
#####################################################################

imports:

  - types.yaml

topology_template:
#####################################################################
# Inputs
#####################################################################

  inputs:

    keystone_username:
      type: string
      default: ''

    keystone_password:
      type: string
      default: ''

    keystone_tenant_name:
      type: string
      default: ''

    keystone_url:
      type: string
      default: ''

    openstack_region:
      type: string
      default: ''

#####################################################################
# Node templates
#####################################################################

  node_templates:

    openstack_auth_2:
      type: tosca.openstack.authorization_form
      properties:
        username: { get_input: keystone_username }
        password: { get_input: keystone_password }
        tenant_name: { get_input: keystone_tenant_name }
        auth_url: { get_input: keystone_url }
        region: { get_input: openstack_region }

    openstack_auth_1:
      type: tosca.openstack.authorization_form
      properties:
        username: { get_input: keystone_username }
        password: { get_input: keystone_password }
        tenant_name: { get_input: keystone_tenant_name }
        auth_url: { get_input: keystone_url }
        region: { get_input: openstack_region }
      requirements:
        - dependency:
            node: openstack_auth_2

    openstack_auth_3:
      type: tosca.openstack.authorization_form
      properties:
        username: { get_input: keystone_username }
        password: { get_input: keystone_password }
        tenant_name: { get_input: keystone_tenant_name }
        auth_url: { get_input: keystone_url }
        region: { get_input: openstack_region }
      requirements:
        - dependency:
            node: openstack_auth_1

    openstack_auth_4:
      type: tosca.openstack.authorization_form
      properties:
        username: { get_input: keystone_username }
        password: { get_input: keystone_password }
        tenant_name: { get_input: keystone_tenant_name }
        auth_url: { get_input: keystone_url }
        region: { get_input: openstack_region }
      requirements:
        - dependency:
            node: openstack_auth_3

and its ordered graph might have next view:

-------------- Parent: 'openstack_auth_2', Child-Of: None
---------------------------- Parent: 'openstack_auth_1', Child-Of: 'openstack_auth_2'
-------------------------------------------------------- Parent: 'openstack_auth_3', Child-Of: 'openstack_auth_1'
----------------------------------------------------------------------------------- Parent: 'openstack_auth_4', Child-Of: 'openstack_auth_3'

Basically, ordered graph is a list of binary trees where the root of each tree is a Node that doesn't have any childs.

It would be useful for developers who building orchestration frameworks around TOSCA and this parser.

From TOSCA standard feature described above does not violate any TOSCA demands

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Denis Makogon
Direction:
Needs approval
Assignee:
Denis Makogon
Definition:
Pending Approval
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(spzala) Denis thanks for creating this BP. Reviewing it.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.