Skip to content
Snippets Groups Projects
computationhost_model.py 656 B
Newer Older
# Import libraries
from neomodel import StructuredNode, StringProperty, IntegerProperty, UniqueIdProperty, RelationshipTo
root's avatar
root committed
from uuid import uuid4

class ComputationHost(StructuredNode):
	ip=StringProperty()
	uuid=StringProperty(unique_index=True, default=uuid4)
	hostName=StringProperty()
root's avatar
root committed
	friendlyName=StringProperty()
	workingDirectory=StringProperty()
root's avatar
root committed

	@property
	def serialize(self):

		"""
		Serializer for node properties
		"""
		
		return {
			'computationhost_node_properties': {
root's avatar
root committed
				'ip': self.ip,
				'uuid': self.uuid,
				'hostName': self.hostName,
				'friendlyName': self.friendlyName,
				'workingDirectory': self.workingDirectory,
			},
		}