add dns_servers to data model and tosca for VSGService
diff --git a/xos/configurations/vtn/cord-vtn-vsg.yaml b/xos/configurations/vtn/cord-vtn-vsg.yaml
index f08a1b9..1b26bba 100644
--- a/xos/configurations/vtn/cord-vtn-vsg.yaml
+++ b/xos/configurations/vtn/cord-vtn-vsg.yaml
@@ -37,6 +37,7 @@
wan_container_gateway_ip: 10.123.0.1
wan_container_gateway_mac: 00:8c:fa:5b:09:d8
wan_container_netbits: 24
+ dns_servers: 8.8.8.8, 8.8.4.4
artifacts:
pubkey: /opt/xos/synchronizers/vcpe/vcpe_public_key
diff --git a/xos/services/cord/admin.py b/xos/services/cord/admin.py
index 40e0f29..76b505c 100644
--- a/xos/services/cord/admin.py
+++ b/xos/services/cord/admin.py
@@ -107,6 +107,7 @@
wan_container_gateway_ip = forms.CharField(required=False)
wan_container_gateway_mac = forms.CharField(required=False)
wan_container_netbits = forms.CharField(required=False)
+ dns_servers = forms.CharField(required=False)
def __init__(self,*args,**kwargs):
super (VSGServiceForm,self ).__init__(*args,**kwargs)
@@ -119,6 +120,7 @@
self.fields['wan_container_gateway_ip'].initial = self.instance.wan_container_gateway_ip
self.fields['wan_container_gateway_mac'].initial = self.instance.wan_container_gateway_mac
self.fields['wan_container_netbits'].initial = self.instance.wan_container_netbits
+ self.fields['dns_servers'].initial = self.instance.dns_servers
def save(self, commit=True):
self.instance.bbs_api_hostname = self.cleaned_data.get("bbs_api_hostname")
@@ -129,6 +131,7 @@
self.instance.wan_container_gateway_ip = self.cleaned_data.get("wan_container_gateway_ip")
self.instance.wan_container_gateway_mac = self.cleaned_data.get("wan_container_gateway_mac")
self.instance.wan_container_netbits = self.cleaned_data.get("wan_container_netbits")
+ self.instance.dns_servers = self.cleaned_data.get("dns_servers")
return super(VSGServiceForm, self).save(commit=commit)
class Meta:
@@ -136,14 +139,16 @@
class VSGServiceAdmin(ReadOnlyAwareAdmin):
model = VSGService
- verbose_name = "vCPE Service"
- verbose_name_plural = "vCPE Service"
+ verbose_name = "vSG Service"
+ verbose_name_plural = "vSG Service"
list_display = ("backend_status_icon", "name", "enabled")
list_display_links = ('backend_status_icon', 'name', )
fieldsets = [(None, {'fields': ['backend_status_text', 'name','enabled','versionNumber', 'description', "view_url", "icon_url", "service_specific_attribute",],
'classes':['suit-tab suit-tab-general']}),
- ("backend config", {'fields': [ "backend_network_label", "bbs_api_hostname", "bbs_api_port", "bbs_server", "bbs_slice", "wan_container_gateway_ip", "wan_container_gateway_mac", "wan_container_netbits"],
- 'classes':['suit-tab suit-tab-backend']}) ]
+ ("backend config", {'fields': [ "backend_network_label", "bbs_api_hostname", "bbs_api_port", "bbs_server", "bbs_slice"],
+ 'classes':['suit-tab suit-tab-backend']}),
+ ("vSG config", {'fields': [ "wan_container_gateway_ip", "wan_container_gateway_mac", "wan_container_netbits", "dns_servers"],
+ 'classes':['suit-tab suit-tab-vsg']}) ]
readonly_fields = ('backend_status_text', "service_specific_attribute")
inlines = [SliceInline,ServiceAttrAsTabInline,ServicePrivilegeInline]
form = VSGServiceForm
@@ -154,6 +159,7 @@
suit_form_tabs =(('general', 'Service Details'),
('backend', 'Backend Config'),
+ ('vsg', 'vSG Config'),
('administration', 'Administration'),
#('tools', 'Tools'),
('slices','Slices'),
diff --git a/xos/services/cord/models.py b/xos/services/cord/models.py
index 959bf19..37ee78e 100644
--- a/xos/services/cord/models.py
+++ b/xos/services/cord/models.py
@@ -402,7 +402,8 @@
("backend_network_label", "hpc_client"),
("wan_container_gateway_ip", ""),
("wan_container_gateway_mac", ""),
- ("wan_container_netbits", "24") )
+ ("wan_container_netbits", "24"),
+ ("dns_servers", "8.8.8.8") )
def __init__(self, *args, **kwargs):
super(VSGService, self).__init__(*args, **kwargs)
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index 80c0d91..15e9710 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -227,6 +227,9 @@
wan_container_netbits:
type: string
required: false
+ dns_servers:
+ type: string
+ required: false
tosca.nodes.VBNGService:
derived_from: tosca.nodes.Root
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 2f404dc..88b3388 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -329,6 +329,9 @@
wan_container_netbits:
type: string
required: false
+ dns_servers:
+ type: string
+ required: false
tosca.nodes.VBNGService:
derived_from: tosca.nodes.Root
diff --git a/xos/tosca/resources/vcpeservice.py b/xos/tosca/resources/vcpeservice.py
index 1794010..5c7b2a7 100644
--- a/xos/tosca/resources/vcpeservice.py
+++ b/xos/tosca/resources/vcpeservice.py
@@ -12,5 +12,8 @@
class XOSVsgService(XOSService):
provides = "tosca.nodes.VSGService"
xos_model = VSGService
- copyin_props = ["view_url", "icon_url", "enabled", "published", "public_key", "private_key_fn", "versionNumber", "backend_network_label", "wan_container_gateway_ip", "wan_container_gateway_mac", "wan_container_netbits"]
+ copyin_props = ["view_url", "icon_url", "enabled", "published", "public_key",
+ "private_key_fn", "versionNumber", "backend_network_label",
+ "wan_container_gateway_ip", "wan_container_gateway_mac",
+ "wan_container_netbits", "dns_servers"]