Skip to content

Conversation

@iceiilin
Copy link
Member

Add node relation mapping table.
I listed relation and its class ("link" and "component") here. It is used currently only for deleting node and updating its target nodes, but might extent to other actions (CRUD) in the future.

We can classify node relations into two classes: "component" and "link". If the relation is "component", its subordinate nodes will be deleted (like enclosure and compute); if the relation is "link", the target nodes will only be updated (like pdu and compute).

related PR:
RackHD/on-http#80

@heckj
Copy link
Member

heckj commented Jan 4, 2016

@iceiilin Is this meant to be a list of all relationships we use, or the relationships on which we delete related nodes?

For example, based on your comment and the fact that "powered by" is in here, I'd presume that if we deleted a PDU, that all nodes powered-by that PDU would likewise be deleted. Is that the intent, or is this meant to be a catalog of allowed relationships?

Where is definition that the business logic of related elements getting deletion? Is it intended to be defined in this constant, or is it in business logic in on-http, and which just references this map as a list of possible relationships?

@iceiilin
Copy link
Member Author

iceiilin commented Jan 5, 2016

@heckj I listed relation and its class ("link" and "component") here. It is used currently only for deleting node and updating its target nodes, but might extent to other actions (CRUD) in the future.

"relationClass" in this constant defines the business logic of deletion, as I described in the comments in constants.js. After internal discussion, we can classify node relations into two classes: "component" and "link". If the relation is "component", its subordinate nodes will be deleted (like enclosure and compute); if the relation is "link", the target nodes will only be updated (like pdu and compute).

The on-http get this relationClass from on-core constants, and delete/update nodes accordingly.

@yyscamper
Copy link
Contributor

👍

1 similar comment
@anhou
Copy link
Member

anhou commented Jan 7, 2016

👍

anhou pushed a commit that referenced this pull request Jan 7, 2016
@anhou anhou merged commit 39611fe into RackHD:master Jan 7, 2016
jlongever pushed a commit to jlongever/on-core that referenced this pull request Jan 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants