CORD-1172: Brought Metronet service over to xproto
Change-Id: I4e9d14b0b5cd7a2fe9ce8efdde432566fc5d7f9d
diff --git a/xos/attic/bandwidthprofile_model.py b/xos/attic/bandwidthprofile_model.py
new file mode 100644
index 0000000..3fd623e
--- /dev/null
+++ b/xos/attic/bandwidthprofile_model.py
@@ -0,0 +1 @@
+def __unicode__(self): return u'%s' % (self.name)
diff --git a/xos/attic/header.py b/xos/attic/header.py
new file mode 100644
index 0000000..f4db591
--- /dev/null
+++ b/xos/attic/header.py
@@ -0,0 +1,14 @@
+# models.py - Metro Network Service
+
+from django.db import models
+from django.db.models import *
+from core.models import Service
+from core.models import PlCoreBase
+from core.models import Site
+
+METRONETWORK_KIND = "metronetwork"
+SERVICE_NAME = 'metronetwork'
+SERVICE_NAME_ELINE_VERBOSE = 'E-Line Service'
+SERVICE_NAME_ELAN_VERBOSE = 'E-LAN Service'
+SERVICE_NAME_ETREE_VERBOSE = 'E-Tree Service'
+
diff --git a/xos/attic/metronetworksystem_model.py b/xos/attic/metronetworksystem_model.py
new file mode 100644
index 0000000..358cf8d
--- /dev/null
+++ b/xos/attic/metronetworksystem_model.py
@@ -0,0 +1,15 @@
+def __init__(self, *args, **kwargs):
+ super(MetroNetworkSystem, self).__init__(*args, **kwargs)
+
+def getAdminstrativeState(self):
+ return self.administrativeState
+
+def setAdminstrativeState(self, value):
+ self.administrativeState = value
+
+def getOperationalState(self):
+ return self.operationalState
+
+def getRestUrl(self):
+ return self.restUrl
+
diff --git a/xos/attic/networkedgeport_model.py b/xos/attic/networkedgeport_model.py
new file mode 100644
index 0000000..52f17fe
--- /dev/null
+++ b/xos/attic/networkedgeport_model.py
@@ -0,0 +1,22 @@
+def __unicode__(self):
+ return u'%s' % (self.pid)
+
+def save(self, *args, **kwargs):
+
+ if self.latlng:
+ try:
+ latlng_value = getattr(self, 'latlng').strip()
+ if (latlng_value.startswith('[') and latlng_value.endswith(']') and latlng_value.index(',') > 0):
+ lat = latlng_value[1: latlng_value.index(',')].strip()
+ lng = latlng_value[latlng_value.index(',') + 1: len(latlng_value) - 1].strip()
+
+ #If lat and lng are not floats, the code below should result in an error.
+ lat_validation = float(lat)
+ lng_validation = float(lng)
+ else:
+ raise ValueError("The lat/lng value is not formatted correctly.")
+ except:
+ raise ValueError("The lat/lng value is not formatted correctly.")
+
+ super(NetworkEdgePort, self).save(*args, **kwargs)
+
diff --git a/xos/attic/remoteport_model.py b/xos/attic/remoteport_model.py
new file mode 100644
index 0000000..3fd623e
--- /dev/null
+++ b/xos/attic/remoteport_model.py
@@ -0,0 +1 @@
+def __unicode__(self): return u'%s' % (self.name)
diff --git a/xos/attic/servicespoke_model.py b/xos/attic/servicespoke_model.py
new file mode 100644
index 0000000..3fd623e
--- /dev/null
+++ b/xos/attic/servicespoke_model.py
@@ -0,0 +1 @@
+def __unicode__(self): return u'%s' % (self.name)
diff --git a/xos/attic/usernetworkinterfaces_model.py b/xos/attic/usernetworkinterfaces_model.py
new file mode 100644
index 0000000..92d2700
--- /dev/null
+++ b/xos/attic/usernetworkinterfaces_model.py
@@ -0,0 +1,20 @@
+def __unicode__(self): return u'%s' % (self.name)
+
+def save(self, *args, **kwargs):
+
+ if self.latlng:
+ try:
+ latlng_value = getattr(self, 'latlng').strip()
+ if (latlng_value.startswith('[') and latlng_value.endswith(']') and latlng_value.index(',') > 0):
+ lat = latlng_value[1: latlng_value.index(',')].strip()
+ lng = latlng_value[latlng_value.index(',') + 1: len(latlng_value) - 1].strip()
+
+ # If lat and lng are not floats, the code below should result in an error.
+ lat_validation = float(lat)
+ lng_validation = float(lng)
+ else:
+ raise ValueError("The lat/lng value is not formatted correctly.")
+ except:
+ raise ValueError("The lat/lng value is not formatted correctly.")
+
+ super(UserNetworkInterface, self).save(*args, **kwargs)