1) Yes, the two capability names are in the same node type, the name distinguishes them. (This is a YAML issue.) 2) Yes, the two are unrelated and can be the same or different.
On Thu, Oct 26, 2017 at 1:58 PM, Steve Baillargeon < [email protected]> wrote: > Let me use a concrete example by modifying the compute node type a little. > See below. > Assume this is for a single node type > > .... > requirements: > - <requirement definition name 1>: > capability: tosca.capabilities.Attachment > node: tosca.nodes.BlockStorage > relationship: tosca.relationships.AttachesTo > occurrences: [0, UNBOUNDED] > capabilities: > <capability definition name 1> : > type: tosca.capabilities.Container > valid_source_types: [tosca.nodes.SoftwareComponent] > <capability definition name 2>: > type: tosca.capabilities.Endpoint.Admin > > > 1) I am assuming capability definition name 1 and capability definition > name 2 must be different. Do you agree? > > 2) I am assuming requirement definition name 1 and capability definition > name 1 can be the same. Do you agree? > > -Steve > > -----Original Message----- > From: Tal Liron [mailto:[email protected]] > Sent: Thursday, October 26, 2017 2:37 PM > To: [email protected] > Subject: Re: Definition names > > I'm not entirely sure what you mean... here's a reply according to what I > understand. > > In most cases there is no ambiguity because the language is YAML-based. A > dict in YAML has unique keys, so it follows that definitions would be > unique. (We discussed the issue of importing in a previous thread, and > opened a JIRA for it.) > > There is one curious exception: sequenced lists. In node templates, you > define requirements as a sequenced list, meaning that you are allowed to > specify the same requirement name multiple times. This makes perfect sense, > and matches the "occurrences" field in the the node type. > > However ... at the node type the requirement definition is *also* a > sequenced list. There is no technical reason for this: I believe TOSCA > defined it this to make it match the node template style, though in my > personal opinion this was a wrong choice because by definition the > requirement is unique per node type. ARIA treats the requirements sequenced > list in the node type the same way the YAML parser treats keys in a dict: > if there is a key of the same name, it will overwrite a previous key of > that name. > > On Thu, Oct 26, 2017 at 1:04 PM, Steve Baillargeon < > [email protected]> wrote: > > > Hi > > The TOSCA YAML Profile is not 100% clear about duplicate definitions > names. > > What are the guidelines for ARIA? > > > > Should all definitions names be unique across definitions "classes" > > (attributes, properties, requirements, capabilities,...) within a > > given node type definition? > > Or is it OK to only have unique definitions names within a given > > definition "class"? > > > > Regards > > Steve B > > > > >
