add vtn_kind to NetworkTemplate
Change-Id: I448562e5fbcca32cb6b338d55f16898e8e186a79
diff --git a/xos/core/admin.py b/xos/core/admin.py
index 2124e96..8910d9c 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -2172,7 +2172,7 @@
user_readonly_inlines = []
inlines = [NetworkParameterInline, ]
fieldsets = [
- (None, {'fields': ['name', 'description', 'guaranteed_bandwidth', 'visibility', 'translation', 'access', 'shared_network_name', 'shared_network_id', 'topology_kind', 'controller_kind'],
+ (None, {'fields': ['name', 'description', 'guaranteed_bandwidth', 'visibility', 'translation', 'access', 'shared_network_name', 'shared_network_id', 'topology_kind', 'controller_kind', 'vtn_kind'],
'classes':['suit-tab suit-tab-general']}), ]
suit_form_tabs = (('general', 'Network Template Details'),
('netparams', 'Parameters'))
diff --git a/xos/core/models/network.py b/xos/core/models/network.py
index af3aa0a..d53017f 100644
--- a/xos/core/models/network.py
+++ b/xos/core/models/network.py
@@ -102,6 +102,9 @@
CONTROLLER_CHOICES = ((None, 'None'), ('onos', 'ONOS'), ('custom', 'Custom'))
ACCESS_CHOICES = ((None, 'None'), ('indirect', 'Indirect'), ('direct', 'Direct'))
+ VTN_KIND_CHOICES = (("PRIVATE", "Private"), ("PUBLIC", "Public"), ("MANAGEMENT_LOCAL", "Management Local"),
+ ("MANAGEMENT_HOST", "Management Host"), ("VSG", "VSG"), ("ACCESS_AGENT", "Access Agent"))
+
name = models.CharField(max_length=32)
description = models.CharField(max_length=1024, blank=True, null=True)
guaranteed_bandwidth = models.IntegerField(default=0)
@@ -112,6 +115,7 @@
shared_network_id = models.CharField(null=True, blank=True, max_length=256, help_text="Quantum network")
topology_kind = models.CharField(null=False, blank=False, max_length=30, choices=TOPOLOGY_CHOICES, default="bigswitch")
controller_kind = models.CharField(null=True, blank=True, max_length=30, choices=CONTROLLER_CHOICES, default=None)
+ vtn_kind = models.CharField(null=True, blank=True, max_length=30, choices=VTN_KIND_CHOICES, default="PRIVATE")
def __init__(self, *args, **kwargs):
super(NetworkTemplate, self).__init__(*args, **kwargs)
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index 4105e05..40027c9 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -633,6 +633,10 @@
type: string
required: false
description: The type of access semantics for this network
+ vtn_kind:
+ type: string
+ required: false
+ description: Network kind to pass to VTN
tosca.nodes.network.Network.XOS:
# Due to bug? in implementation, we have to copy everything from
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index a643959..d834fa4 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -1280,6 +1280,10 @@
type: string
required: false
description: The type of access semantics for this network
+ vtn_kind:
+ type: string
+ required: false
+ description: Network kind to pass to VTN
tosca.nodes.network.Network.XOS:
# Due to bug? in implementation, we have to copy everything from
diff --git a/xos/tosca/resources/networktemplate.py b/xos/tosca/resources/networktemplate.py
index 3a5ce59..afd604e 100644
--- a/xos/tosca/resources/networktemplate.py
+++ b/xos/tosca/resources/networktemplate.py
@@ -12,7 +12,7 @@
class XOSNetworkTemplate(XOSResource):
provides = "tosca.nodes.NetworkTemplate"
xos_model = NetworkTemplate
- copyin_props = ["visibility", "translation", "shared_network_name", "shared_network_id", "toplogy_kind", "controller_kind", "access"]
+ copyin_props = ["visibility", "translation", "shared_network_name", "shared_network_id", "toplogy_kind", "controller_kind", "access", "vtn_kind"]
def get_xos_args(self):
args = super(XOSNetworkTemplate, self).get_xos_args()