ariatosca-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (ARIA-254) Support multiple nodes of a node template at service creation time
Date Tue, 06 Jun 2017 19:22:18 GMT


ASF GitHub Bot commented on ARIA-254:

Github user tliron commented on a diff in the pull request:
    --- Diff: aria/modeling/ ---
    @@ -613,6 +597,56 @@ def dump(self):
                 utils.dump_dict_values(self.capability_templates, 'Capability templates')
                 utils.dump_list_values(self.requirement_templates, 'Requirement templates')
    +    @property
    +    def next_index(self):
    +        """
    +        Next available node index.
    +        :returns: node index
    +        :rtype: int
    +        """
    +        max_index = 0
    +        if self.nodes:
    +            max_index = max(int('_', 1)[-1]) for n in self.nodes)
    +        return max_index + 1
    +    @property
    +    def next_name(self):
    +        """
    +        Next available node name.
    +        :returns: node name
    +        :rtype: basestring
    +        """
    +        return '{name}_{index}'.format(, index=self.next_index)
    +    @property
    +    def default_instances(self):
    +        # TODO: currently finds the first matching policy; but we should emit a validation
    +        # if more than one policy applies to the same node
    +        for policy_template in self.service_template.policy_templates.itervalues():
    +            if policy_template.type.role == 'scaling':
    +                if policy_template.is_for_node_template(
    +                    default_instances ='default_instances')
    +                    if (default_instances is not None) \
    +                        and (default_instances.type_name == 'integer'):
    --- End diff --
    We cannot expect anybody be to using the ARIA profile as is -- all we are relying here
is that there is an attribute with that name. I am adding that extra validation of type to
make sure that we don't cause breakage by somebody messing with the parameters. Note that
we also do this validation in setting "default" attributes, like `tosca_name` and `tosca_id`.

> Support multiple nodes of a node template at service creation time
> ------------------------------------------------------------------
>                 Key: ARIA-254
>                 URL:
>             Project: AriaTosca
>          Issue Type: Story
>            Reporter: Ran Ziv
>            Assignee: Tal Liron
>            Priority: Critical
> Currently each node template can only have a single node.
> We need to support having multiple nodes of a given node-template at service creation
time. The mechanism for this should take into consideration future stories which would require
allowing scaling the number of nodes of a node-template up or down.
> Note: the term {{default_instances}} appears in several places in the code ([1|],
- we could perhaps use this or an extension based on this idea to support this issue.
> One other thing that should be taken into consideration (but perhaps be moved to a separate
JIRA issue) is the implicit declaration of multiple instances via the capabilities&requirements
mechanism in TOSCA - We need to decide if to support this as well or not, and if we do, how
does this play together with the primary method of declaring multiple nodes (or perhaps would
this be the only method of doing so?)

This message was sent by Atlassian JIRA

View raw message