Skip to content

Commit

Permalink
Merge pull request #62 from iceiilin/bugfix/odr-314-rv-encl-1.1.0
Browse files Browse the repository at this point in the history
add node relation mapping table
  • Loading branch information
Andrew Hou authored and Andrew Hou committed Jan 11, 2016
2 parents 2c3d646 + d41ca07 commit dc01fe8
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions lib/common/constants.js
Expand Up @@ -199,6 +199,60 @@ function constantsFactory (path) {
type: 'compute'
}
]
},
NodeRelations: {
/* There are two classes about the pair of relations:
* component: one node is a component of the other
* e.g. compute node vs. enclosure node
* expect behavior:
* the "By" in the relationType is used to tell component from its parent
* delete a node as well as its components;
* delete a component and update its parenet node
* link: two nodes are linked to each other
* e.g. compute node vs pdu node (TBD)
* expect behavior:
* delete one node and update the other
*/
encloses: {
mapping: 'enclosedBy',
relationClass: 'component'
},
enclosedBy: {
mapping: 'encloses',
relationClass: 'component'
},
/* Below are an example used to verify function
* currently used in unit test
compute node:
"relations": [
{
"relationType": "poweredBy",
"targets": [
"567b8f478b7444e407bb0729"
]
}
],
pdu node:
"relations": [
{
"relationType": "powers",
"targets": [
"567b8f478b7444e407bb072a"
"567b8f478b7444e407bb072b"
]
}
],
If either of them is removed, the other node will only be updated without deletion
*/
powers: {
mapping: 'poweredBy',
relationClass: 'link'
},
poweredBy: {
mapping: 'powers',
relationClass: 'link'
}
/* end example */
}
});

Expand Down

0 comments on commit dc01fe8

Please sign in to comment.