diff options
author | maxbr <maxbr@mi.fu-berlin.de> | 2017-01-05 12:38:00 +0100 |
---|---|---|
committer | maxbr <maxbr@mi.fu-berlin.de> | 2017-01-05 12:38:00 +0100 |
commit | 9a7cf0a9a0f22f0ed7de720e69d560d35b8f0998 (patch) | |
tree | 20eda1152c316875894e1d51306ac0726523770b /tools/pharos-dashboard/src/dashboard/models.py | |
parent | 85623f2e6a4e4bee61ac5c28ce04bf9532980094 (diff) |
Add booking communication reference implementation
JIRA: PHAROS-265
This adds an implementation of a booking communication agent that
listens for booking notifications from the dashboard and updates the pod
status in the dashboard.
Change-Id: I1ea22390a46182a185df9c5e1771c9312d462092
Signed-off-by: maxbr <maxbr@mi.fu-berlin.de>
Diffstat (limited to 'tools/pharos-dashboard/src/dashboard/models.py')
-rw-r--r-- | tools/pharos-dashboard/src/dashboard/models.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/pharos-dashboard/src/dashboard/models.py b/tools/pharos-dashboard/src/dashboard/models.py index ec6fec76..4f3ac95c 100644 --- a/tools/pharos-dashboard/src/dashboard/models.py +++ b/tools/pharos-dashboard/src/dashboard/models.py @@ -64,7 +64,6 @@ class Resource(models.Model): def __str__(self): return self.name - class Server(models.Model): id = models.AutoField(primary_key=True) resource = models.ForeignKey(Resource, on_delete=models.CASCADE) @@ -79,3 +78,17 @@ class Server(models.Model): def __str__(self): return self.name + +class ResourceStatus(models.Model): + id = models.AutoField(primary_key=True) + resource = models.ForeignKey(Resource, on_delete=models.CASCADE) + timestamp = models.DateTimeField(auto_now_add=True) + type = models.CharField(max_length=20) + title = models.CharField(max_length=50) + content = models.CharField(max_length=5000) + + class Meta: + db_table = 'resource_status' + + def __str__(self): + return self.resource.name + ': ' + self.title + ' ' + str(self.timestamp) |