dtolabs / yana2

Yet Another Node Authority ... because you wanted an agile Real-Time Service Model (RTSM)
8 stars 1 forks source link

Include node count in GET NodeType API response #131

Closed ahonor closed 12 years ago

ahonor commented 12 years ago

Include a property that describes how many Nodes exist for the specified NodeType.

For example, assume a NodeType named "Software" has been declared and one Node instance has been created, "Jetty[Software]".


The following XML representation of the Software type shows a new attribute called nodeCount describing the count of Nodes of the Software NodeType.

Example output:

$ curl --request GET http://localhost:8080/api/nodeType/xml/2 --cookie cookies.txt

<nodetypes>
  <nodetype id='2' name='Software' description='This is the software description' image='Package.png' 
    nodeCount="1">
    <templateAttributes>
      <templateAttribute id='15' attributeName='Version' attributeId='15' nodetypeId='2' required='false' />
      <templateAttribute id='16' attributeName='License' attributeId='16' nodetypeId='2' required='false' />
    </templateAttributes>
    <nodetypeRelationships>
      <nodetypeRelationship id='1' parentNodeId='1' parentName='Server' childNodeId='2' childName='Software' roleName='sofwareInstallation' />
    </nodetypeRelationships>
  </nodetype>