Basic autogeneration of vOLT config
diff --git a/xos/configurations/cord-pod/make-vtn-external-yaml.sh b/xos/configurations/cord-pod/make-vtn-external-yaml.sh
index 6a69783..79feacf 100644
--- a/xos/configurations/cord-pod/make-vtn-external-yaml.sh
+++ b/xos/configurations/cord-pod/make-vtn-external-yaml.sh
@@ -21,21 +21,6 @@
view_url: /admin/onos/onosservice/$id$/
no_container: true
rest_hostname: onos-cord
- rest_onos/v1/network/configuration/: >
- {
- "devices" : {
- "of:1000000000000001" : {
- "accessDevice" : {
- "uplink" : "2",
- "vlan" : "222",
- "defaultVlan" : "0"
- },
- "basic" : {
- "driver" : "pmc-olt"
- }
- }
- }
- }
service_vtn:
type: tosca.nodes.VTNService
@@ -119,4 +104,4 @@
properties:
dependencies: org.onosproject.drivers, org.onosproject.drivers.ovsdb, org.onosproject.openflow-base, org.onosproject.ovsdb-base, org.onosproject.dhcp, org.onosproject.cordvtn, org.onosproject.olt, org.onosproject.igmp, org.onosproject.cordmcast
autogenerate: vtn-network-cfg
-EOF
\ No newline at end of file
+EOF
diff --git a/xos/synchronizers/onos/steps/sync_onosapp.py b/xos/synchronizers/onos/steps/sync_onosapp.py
index 944e7fe..4c70877 100644
--- a/xos/synchronizers/onos/steps/sync_onosapp.py
+++ b/xos/synchronizers/onos/steps/sync_onosapp.py
@@ -242,6 +242,22 @@
return json.dumps(data, indent=4, sort_keys=True)
+ def get_volt_config(self, o, attrs):
+ data = {
+ "devices" : {
+ "of:1000000000000001" : {
+ "accessDevice" : {
+ "uplink" : "2",
+ "vlan" : "222",
+ },
+ "basic" : {
+ "driver" : "pmc-olt"
+ }
+ }
+ }
+ }
+ return json.dumps(data, indent=4, sort_keys=True)
+
def write_configs(self, o):
o.config_fns = []
o.rest_configs = []
@@ -287,9 +303,13 @@
config = None
value = None
if label == "vtn-network-cfg":
- # Generate the VTN config file... where should this live?
+ # Generate the VTN config file... where should this live?
config = "rest_onos/v1/network/configuration/"
value = self.get_vtn_config(o, attrs)
+ elif label == "volt-network-cfg":
+ config = "rest_onos/v1/network/configuration/"
+ value = self.get_volt_config(o, attrs)
+
if config:
tas = TenantAttribute.objects.filter(tenant=o, name=config)
if tas:
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index 32eefa4..bc35442 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -191,6 +191,9 @@
rest_onos/v1/network/configuration/:
type: string
required: false
+ autogenerate:
+ type: string
+ required: false
tosca.nodes.ONOSVTNApp:
derived_from: tosca.nodes.Root
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 8102d1c..5fd801f 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -242,6 +242,9 @@
rest_onos/v1/network/configuration/:
type: string
required: false
+ autogenerate:
+ type: string
+ required: false
tosca.nodes.ONOSVTNApp:
derived_from: tosca.nodes.Root