Merge branch 'master' of github.com:open-cloud/xos
diff --git a/xos/configurations/opencloud/cdn-opencloud.yaml b/xos/configurations/opencloud/cdn-opencloud.yaml
index 29d60d5..4a13233 100644
--- a/xos/configurations/opencloud/cdn-opencloud.yaml
+++ b/xos/configurations/opencloud/cdn-opencloud.yaml
@@ -26,6 +26,8 @@
onlab_cmi:
description: CMI Slice
type: tosca.nodes.Slice
+ properties:
+ exposed_ports: tcp 8003, tcp 8004, tcp 8140
requirements:
- cdn_service:
node: HyperCache
@@ -37,6 +39,8 @@
onlab_hpc:
description: HyperCache Slice
type: tosca.nodes.Slice
+ properties:
+ exposed_ports: tcp 2120:2128, tcp 3200:3209, tcp 8006, tcp 8009, tcp 8015
requirements:
- cdn_service:
node: HyperCache
@@ -48,6 +52,8 @@
onlab_dnsredir:
description: HyperCache Slice
type: tosca.nodes.Slice
+ properties:
+ exposed_ports: udp 53541, tcp 8016
requirements:
- cdn_service:
node: HyperCache
@@ -59,6 +65,8 @@
onlab_dnsdemux:
description: HyperCache Slice
type: tosca.nodes.Slice
+ properties:
+ exposed_ports: udp 53, tcp 8017
requirements:
- cdn_service:
node: HyperCache
diff --git a/xos/core/models/slice.py b/xos/core/models/slice.py
index 2679eb7..12c1ea2 100644
--- a/xos/core/models/slice.py
+++ b/xos/core/models/slice.py
@@ -32,6 +32,7 @@
max_instances = models.IntegerField(default=10)
service = models.ForeignKey(Service, related_name='slices', null=True, blank=True)
network = models.CharField(null=True, blank=True, max_length=256, choices=NETWORK_CHOICES)
+ exposed_ports = models.CharField(null=True, blank=True, max_length=256)
tags = generic.GenericRelation(Tag)
serviceClass = models.ForeignKey(ServiceClass, related_name = "slices", null=True, default=get_default_serviceclass)
creator = models.ForeignKey(User, related_name='slices', blank=True, null=True)
diff --git a/xos/synchronizers/openstack/model_policies/model_policy_Slice.py b/xos/synchronizers/openstack/model_policies/model_policy_Slice.py
index bb95b54..088d583 100644
--- a/xos/synchronizers/openstack/model_policies/model_policy_Slice.py
+++ b/xos/synchronizers/openstack/model_policies/model_policy_Slice.py
@@ -64,6 +64,8 @@
template = NetworkTemplate.objects.get(name='Public shared IPv4'),
owner = slice
)
+ if slice.exposed_ports:
+ nat_net.ports = slice.exposed_ports
nat_net.save()
public_nets.append(nat_net)
print "MODEL POLICY: slice", slice, "made nat-net"
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index 0c817c9..20a537a 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -663,6 +663,10 @@
type: string
required: false
description: type of networking to use for this slice
+ exposed_ports:
+ type: string
+ required: false
+ description: comma-separated list of protocol _space_ port that represent ports the slice should expose
tosca.nodes.Node:
derived_from: tosca.nodes.Root
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index a4f5d97..1b5db39 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -920,6 +920,10 @@
type: string
required: false
description: type of networking to use for this slice
+ exposed_ports:
+ type: string
+ required: false
+ description: comma-separated list of protocol _space_ port that represent ports the slice should expose
tosca.nodes.Node:
derived_from: tosca.nodes.Root
diff --git a/xos/tosca/resources/slice.py b/xos/tosca/resources/slice.py
index ca11b77..7dcbd59 100644
--- a/xos/tosca/resources/slice.py
+++ b/xos/tosca/resources/slice.py
@@ -12,7 +12,7 @@
class XOSSlice(XOSResource):
provides = "tosca.nodes.Slice"
xos_model = Slice
- copyin_props = ["enabled", "description", "slice_url", "max_instances", "default_isolation", "network"]
+ copyin_props = ["enabled", "description", "slice_url", "max_instances", "default_isolation", "network", "exposed_ports"]
def get_xos_args(self):
args = super(XOSSlice, self).get_xos_args()