blob: 1c4065fde1197dff498bbb7503180c27f6d09418 [file] [log] [blame]
Siobhan Tully4bc09f22013-04-10 21:15:21 -04001import os
2from django.db import models
3from plstackapi.core.models import PlCoreBase
4from plstackapi.core.models import Flavor
5from plstackapi.core.models import Image
6from plstackapi.core.models import Key
7from plstackapi.core.models import Slice
8from plstackapi.core.models import Node
9from plstackapi.core.models import Site
10from plstackapi.core.models import DeploymentNetwork
11from plstackapi.openstack.driver import OpenStackDriver
12
13# Create your models here.
14class Sliver(PlCoreBase):
15 instance_id = models.CharField(max_length=200, help_text="Nova instance id")
16 name = models.CharField(max_length=200, help_text="Sliver name")
Tony Mack771f4b92013-04-12 01:49:57 -040017 flavor = models.ForeignKey(Flavor, related_name='slivers')
18 image = models.ForeignKey(Image, related_name='slivers')
19 key = models.ForeignKey(Key, related_name='slivers')
20 slice = models.ForeignKey(Slice, related_name='slivers')
21 node = models.ForeignKey(Node, related_name='slivers')
22 site = models.ForeignKey(Site, related_name='slivers')
Siobhan Tully4bc09f22013-04-10 21:15:21 -040023 deploymentNetwork = models.ForeignKey(DeploymentNetwork, related_name='sliver_deploymentNetwork')
24
Tony Mack29c287f2013-04-11 21:07:16 -040025 def __unicode__(self): return u'%s::%s' % (self.slice, self.deploymentNetwork)
Siobhan Tully4bc09f22013-04-10 21:15:21 -040026