separate vlan_id from service_specific_id
diff --git a/xos/cord/models.py b/xos/cord/models.py
index 7ec4137..66c135e 100644
--- a/xos/cord/models.py
+++ b/xos/cord/models.py
@@ -57,6 +57,8 @@
KIND = "vOLT"
+ default_attributes = {"vlan_id": None, }
+
def __init__(self, *args, **kwargs):
volt_services = VOLTService.get_service_objects().all()
if volt_services:
@@ -64,6 +66,14 @@
super(VOLTTenant, self).__init__(*args, **kwargs)
@property
+ def vlan_id(self):
+ return self.get_attribute("vlan_id", self.default_attributes["vlan_id"])
+
+ @vlan_id.setter
+ def vlan_id(self, value):
+ self.set_attribute("vlan_id", value)
+
+ @property
def vcpe(self):
if getattr(self, "cached_vcpe", None):
return self.cached_vcpe
diff --git a/xos/cord/rest_examples/add_volt_tenant.sh b/xos/cord/rest_examples/add_volt_tenant.sh
index 0b7ad74..a20e214 100755
--- a/xos/cord/rest_examples/add_volt_tenant.sh
+++ b/xos/cord/rest_examples/add_volt_tenant.sh
@@ -2,6 +2,7 @@
HOST=198.0.0.44:8000
AUTH=scott@onlab.us:letmein
+SERVICE_SPECIFIC_ID=5678
VLAN_ID=1234
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X POST -d "{\"service_specific_id\": \"$VLAN_ID\"}" $HOST/xoslib/volttenant/
\ No newline at end of file
+curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X POST -d "{\"service_specific_id\": \"$SERVICE_SPECIFIC_ID\", \"vlan_id\": \"$VLAN_ID\"}" $HOST/xoslib/volttenant/
diff --git a/xos/core/xoslib/methods/cordsubscriber.py b/xos/core/xoslib/methods/cordsubscriber.py
index 3414fb8..2337b21 100644
--- a/xos/core/xoslib/methods/cordsubscriber.py
+++ b/xos/core/xoslib/methods/cordsubscriber.py
@@ -19,6 +19,7 @@
class CordSubscriberIdSerializer(serializers.ModelSerializer, PlusSerializerMixin):
id = ReadOnlyField()
+ service_specific_id = ReadOnlyField()
vlan_id = ReadOnlyField()
vcpe_id = ReadOnlyField()
sliver = ReadOnlyField()
@@ -38,7 +39,7 @@
class Meta:
model = CordSubscriber
fields = ('humanReadableName', 'id',
- 'vlan_id',
+ 'service_specific_id', 'vlan_id',
'vcpe_id', 'sliver', 'sliver_name', 'image', 'image_name', 'firewall_enable', 'firewall_rules', 'url_filter_enable', 'url_filter_rules', 'cdn_enable', 'vbng_id', 'routeable_subnet',)
diff --git a/xos/core/xoslib/objects/cordsubscriber.py b/xos/core/xoslib/objects/cordsubscriber.py
index b0c5c48..4e5b0a9 100644
--- a/xos/core/xoslib/objects/cordsubscriber.py
+++ b/xos/core/xoslib/objects/cordsubscriber.py
@@ -37,7 +37,7 @@
("routeable_subnet", "vcpe.vbng.routeable_subnet"),
("vcpe_id", "vcpe.id"),
("vbng_id", "vcpe.vbng.id"),
- ("vlan_id", "service_specific_id") )
+ )
def __getattr__(self, key):
for (member_name, passthrough_name) in self.passthroughs:
diff --git a/xos/core/xoslib/templates/xosCordSubscriber.html b/xos/core/xoslib/templates/xosCordSubscriber.html
index fe33d69..dbd4cfe 100644
--- a/xos/core/xoslib/templates/xosCordSubscriber.html
+++ b/xos/core/xoslib/templates/xosCordSubscriber.html
@@ -6,6 +6,7 @@
<h3>vOLT</h3>
<table class="xos-detail-table">
<tr><td class="xos-label-cell xos-cord-label">Id:</td><td><%= model.attributes.id %></td></tr>
+ <tr><td class="xos-label-cell xos-cord-label">Service Specific Id:</td><td><%= model.attributes.service_specific_id %></td></tr>
<tr><td class="xos-label-cell xos-cord-label">VLAN Id:</td><td><%= model.attributes.vlan_id %></td></tr>
</table>
</div>