blob: a18a09e09fc3fe99ac390d140d25758f9b9588ff [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 Site
5from plstackapi.core.models import User
6from plstackapi.core.models import Role
7from plstackapi.core.models import DeploymentNetwork
Siobhan Tully4bc09f22013-04-10 21:15:21 -04008from plstackapi.openstack.driver import OpenStackDriver
9
10# Create your models here.
11
12class Slice(PlCoreBase):
13 tenant_id = models.CharField(max_length=200, help_text="Keystone tenant id")
Tony Mack48952032013-04-12 11:49:34 -040014 name = models.CharField(unique=True, help_text="The Name of the Slice", max_length=80)
Siobhan Tully4bc09f22013-04-10 21:15:21 -040015 enabled = models.BooleanField(default=True, help_text="Status for this Slice")
16 SLICE_CHOICES = (('plc', 'PLC'), ('delegated', 'Delegated'), ('controller','Controller'), ('none','None'))
17 instantiation = models.CharField(help_text="The instantiation type of the slice", max_length=80, choices=SLICE_CHOICES)
18 omf_friendly = models.BooleanField()
19 description=models.TextField(blank=True,help_text="High level description of the slice and expected activities", max_length=1024)
20 slice_url = models.URLField(blank=True, max_length=512)
21 site = models.ForeignKey(Site, related_name='slices', help_text="The Site this Node belongs too")
22 network_id = models.CharField(max_length=256, help_text="Quantum network")
23 router_id = models.CharField(max_length=256, help_text="Quantum router id")
24
25 def __unicode__(self): return u'%s' % (self.name)
26
Siobhan Tully4bc09f22013-04-10 21:15:21 -040027class SliceMembership(PlCoreBase):
28 user = models.ForeignKey('User', related_name='slice_memberships')
29 slice = models.ForeignKey('Slice', related_name='slice_memberships')
30 role = models.ForeignKey('Role')
31
32 def __unicode__(self): return u'%s %s %s' % (self.slice, self.user, self.role)
33