create NetworkSliver objects when networks are attached to instances
[plstackapi.git] / planetstack / core / models / network.py
index 44dee76..55711a4 100644 (file)
@@ -11,11 +11,15 @@ NO_OBSERVER=False
 
 class NetworkTemplate(PlCoreBase):
     VISIBILITY_CHOICES = (('public', 'public'), ('private', 'private'))
+    TRANSLATION_CHOICES = (('none', 'none'), ('NAT', 'NAT'))
 
     name = models.CharField(max_length=32)
     description = models.CharField(max_length=1024, blank=True, null=True)
     guaranteedBandwidth = models.IntegerField(default=0)
     visibility = models.CharField(max_length=30, choices=VISIBILITY_CHOICES, default="private")
+    translation = models.CharField(max_length=30, choices=TRANSLATION_CHOICES, default="none")
+    sharedNetworkName = models.CharField(max_length=30, blank=True, null=True)
+    sharedNetworkId = models.CharField(null=True, blank=True, max_length=256, help_text="Quantum network")
 
     def __unicode__(self):  return u'%s' % (self.name)
 
@@ -70,6 +74,7 @@ class NetworkSliver(PlCoreBase):
     network = models.ForeignKey(Network)
     sliver = models.ForeignKey(Sliver)
     ip = models.GenericIPAddressField(help_text="Sliver ip address", blank=True, null=True)
+    port_id = models.CharField(null=True, blank=True, max_length=256, help_text="Quantum port id")
 
     def save(self, *args, **kwds):
         slice = self.sliver.slice