From: Scott Baker Date: Tue, 18 Nov 2014 00:03:49 +0000 (-0800) Subject: check in network migrations X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d6193069bc820288d3f1f4102280d4936d547548;p=plstackapi.git check in network migrations --- diff --git a/planetstack/core/migrations/0005_network_sdn.py b/planetstack/core/migrations/0005_network_sdn.py new file mode 100644 index 0000000..bad6d97 --- /dev/null +++ b/planetstack/core/migrations/0005_network_sdn.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0004_auto_20141006_1719'), + ] + + operations = [ + migrations.AddField( + model_name='network', + name='controllerParameters', + field=models.TextField(null=True, blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='network', + name='topologyParameters', + field=models.TextField(null=True, blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='networktemplate', + name='controllerKind', + field=models.CharField(default=None, max_length=30, null=True, blank=True, choices=[(None, b'None'), (b'onos', b'ONOS'), (b'custom', b'Custom')]), + preserve_default=True, + ), + migrations.AddField( + model_name='networktemplate', + name='topologyKind', + field=models.CharField(default=b'BigSwitch', max_length=30, choices=[(b'bigswitch', b'BigSwitch'), (b'physical', b'Physical'), (b'custom', b'Custom')]), + preserve_default=True, + ), + ] diff --git a/planetstack/core/models/network.py b/planetstack/core/models/network.py index 3c5a19b..1fb629f 100644 --- a/planetstack/core/models/network.py +++ b/planetstack/core/models/network.py @@ -65,6 +65,8 @@ def ValidateNatList(ports): class NetworkTemplate(PlCoreBase): VISIBILITY_CHOICES = (('public', 'public'), ('private', 'private')) TRANSLATION_CHOICES = (('none', 'none'), ('NAT', 'NAT')) + TOPOLOGY_CHOICES = (('bigswitch', 'BigSwitch'), ('physical', 'Physical'), ('custom', 'Custom')) + CONTROLLER_CHOICES = ((None, 'None'), ('onos', 'ONOS'), ('custom', 'Custom')) name = models.CharField(max_length=32) description = models.CharField(max_length=1024, blank=True, null=True) @@ -73,6 +75,8 @@ class NetworkTemplate(PlCoreBase): 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") + topologyKind = models.CharField(null=False, blank=False, max_length=30, choices=TOPOLOGY_CHOICES, default="BigSwitch") + controllerKind = models.CharField(null=True, blank=True, max_length=30, choices=CONTROLLER_CHOICES, default=None) def __unicode__(self): return u'%s' % (self.name) @@ -90,6 +94,9 @@ class Network(PlCoreBase): slices = models.ManyToManyField(Slice, blank=True, related_name="networks", through="NetworkSlice") slivers = models.ManyToManyField(Sliver, blank=True, related_name="networks", through="NetworkSliver") + topologyParameters = models.TextField(null=True, blank=True) + controllerParameters = models.TextField(null=True, blank=True) + # for observer/manager network_id = models.CharField(null=True, blank=True, max_length=256, help_text="Quantum network") router_id = models.CharField(null=True, blank=True, max_length=256, help_text="Quantum router id")