CORD-1172: Brought metronet-local service over to xproto

Change-Id: Idef179d1a92c17c759452ac11cdcefa2bfa2de4c
diff --git a/README.md b/README.md
index d7e8965..36434ee 100644
--- a/README.md
+++ b/README.md
@@ -5,3 +5,4 @@
 Sub-directories
 
 * xos: A service definition for the VNOD Local. This follows the XOS component design for onboarding.
+
diff --git a/xos/attic/header.py b/xos/attic/header.py
new file mode 100644
index 0000000..2e7d94d
--- /dev/null
+++ b/xos/attic/header.py
@@ -0,0 +1,10 @@
+# models.py -  VNOD Local Service
+
+from django.db import models
+from django.db.models import *
+from core.models import Service
+from core.models import PlCoreBase
+
+VNODLOCAL_KIND = "vnodlocal"
+SERVICE_NAME = 'vnodlocal'
+
diff --git a/xos/attic/vnodelocalservice_model.py b/xos/attic/vnodelocalservice_model.py
new file mode 100644
index 0000000..3c7c3d5
--- /dev/null
+++ b/xos/attic/vnodelocalservice_model.py
@@ -0,0 +1 @@
+def __unicode__(self):  return u'%s:%s' % (self.servicehandle, self.portid)
diff --git a/xos/attic/vnodlocalsystem_model.py b/xos/attic/vnodlocalsystem_model.py
new file mode 100644
index 0000000..6077b48
--- /dev/null
+++ b/xos/attic/vnodlocalsystem_model.py
@@ -0,0 +1,15 @@
+def __init__(self, *args, **kwargs):
+    super(VnodLocalSystem, self).__init__(*args, **kwargs)
+
+
+def getAdminstrativeState(self):
+    return self.administrativeState
+
+
+def setAdminstrativeState(self, value):
+    self.administrativeState = value
+
+
+def getRestUrl(self):
+    return self.restUrl
+
diff --git a/xos/header.py b/xos/header.py
new file mode 120000
index 0000000..721b5c0
--- /dev/null
+++ b/xos/header.py
@@ -0,0 +1 @@
+attic/header.py
\ No newline at end of file
diff --git a/xos/metronet-local.xproto b/xos/metronet-local.xproto
new file mode 100644
index 0000000..bcb90a8
--- /dev/null
+++ b/xos/metronet-local.xproto
@@ -0,0 +1,41 @@
+option name = "vnodlocal";
+
+message VnodLocalSystem (PlCoreBase){
+     option verbose_name = "VNOD Local System";
+
+     required string name = 1 [db_index = False, max_length = 256, null = False, blank = False];
+     required string description = 2 [db_index = False, max_length = 1024, null = False, blank = False];
+     required string restUrl = 3 [db_index = False, max_length = 256, null = False, blank = False];
+     required string username = 4 [db_index = False, max_length = 32, null = False, blank = True];
+     required string password = 5 [db_index = False, max_length = 32, null = False, blank = True];
+     required string administrativeState = 6 [default = "enabled", choices = "(('enabled', 'Enabled'), ('disabled', 'Disabled'))", max_length = 16, blank = False, null = False, db_index = False];
+     required string pseudowireprovider = 7 [default = "none", max_length = 256, null = False, db_index = False, blank = False];
+     required string networkControllerUrl = 8 [db_index = False, max_length = 256, null = False, blank = True];
+}
+
+message VnodLocalService (Service){
+     option verbose_name = "Virtual Network On Demand Local Service";
+
+     required string portid = 1 [db_index = False, max_length = 256, null = False, blank = True];
+     required string vlanid = 2 [db_index = False, max_length = 256, null = False, blank = True];
+     required string servicehandle = 3 [db_index = False, max_length = 256, null = False, blank = False];
+     required bool autoattached = 4 [default = False, null = False, db_index = False, blank = True];
+     required string administrativeState = 5 [default = "disabled", choices = "(('disabled', 'Disabled'), ('configurationrequested', 'ConfigurationRequested'), ('configurationfailed', 'ConfigurationFailed'), ('configured', 'Configured'), ('activationrequested', 'ActivationRequested'), ('activationfailed', 'ActivationFailed'), ('enabled', 'Enabled'), ('deactivationrequested', 'DeactivationRequested'))", max_length = 64, blank = False, null = False, db_index = False];
+     required string operstate = 6 [default = "inactive", choices = "(('active', 'Active'), ('inactivereported', 'InactiveReported'), ('inactive', 'Inactive'), ('activereported', 'ActiveReported'))", max_length = 64, blank = False, null = False, db_index = False];
+}
+
+message VnodLocalPseudowireConnectorService (Service){
+     option verbose_name = "Virtual Network On Demand Local Pseudo-wire Connector Service";
+
+     required string servicehandle = 1 [db_index = False, max_length = 256, null = False, blank = False];
+     required string pseudowirehandle = 2 [db_index = False, max_length = 256, null = False, blank = True];
+     required string internalport = 3 [db_index = False, max_length = 256, null = False, blank = False];
+     optional manytoone vnodlocal->VnodLocalService:VnodLocalService = 4 [db_index = True, null = True, blank = False];
+     required string administrativeState = 5 [default = "disabled", choices = "(('disabled', 'Disabled'), ('activationrequested', 'ActivationRequested'), ('enabled', 'Enabled'), ('deactivationrequested', 'DeactivationRequested'))", max_length = 64, blank = False, null = False, db_index = False];
+     required string operstate = 6 [default = "inactive", choices = "(('active', 'Active'), ('inactive', 'Inactive'))", max_length = 64, blank = False, null = False, db_index = False];
+}
+
+
+
+
+
diff --git a/xos/models.py b/xos/models.py
deleted file mode 100644
index 1484129..0000000
--- a/xos/models.py
+++ /dev/null
@@ -1,167 +0,0 @@
-# models.py -  VNOD Local Service
-
-from django.db import models
-from core.models import Service
-from core.models import PlCoreBase
-
-VNODLOCAL_KIND = "vnodlocal"
-SERVICE_NAME = 'vnodlocal'
-
-class VnodLocalSystem(PlCoreBase):
-    class Meta:
-        app_label = VNODLOCAL_KIND
-        verbose_name = "VNOD Local System"
-
-    ADMINISTRATIVE_STATE = (
-        ('enabled', 'Enabled'),
-        ('disabled', 'Disabled')
-    )
-
-    name = models.CharField(unique=True,
-                        verbose_name="Name",
-                        max_length=256,
-                        editable=True)
-
-    description = models.CharField(verbose_name="Description",
-                               max_length=1024,
-                               editable=True)
-
-    restUrl = models.CharField(verbose_name="MetroNetwork Rest URL",
-                           max_length=256,
-                           editable=True)
-
-    username = models.CharField(verbose_name='Username',
-                                max_length=32,
-                                editable=True,
-                                blank=True)
-
-    password = models.CharField(max_length=32,
-                                verbose_name='Password',
-                                editable=True,
-                                blank=True)
-
-    administrativeState = models.CharField(choices=ADMINISTRATIVE_STATE,
-                                       default='enabled',
-                                       verbose_name="AdministrativeState",
-                                       max_length=16,
-                                       editable=True)
-
-    pseudowireprovider = models.CharField(unique=False,
-                            verbose_name="Pseudowire Provider",
-                            default='none',
-                            max_length=256,
-                            editable=True)
-
-    networkControllerUrl = models.CharField(verbose_name="Network Controller URL",
-                                          blank=True,
-                                          max_length=256,
-                                          editable=True)
-
-    def __init__(self, *args, **kwargs):
-        super(VnodLocalSystem, self).__init__(*args, **kwargs)
-
-
-    def getAdminstrativeState(self):
-        return self.administrativeState
-
-
-    def setAdminstrativeState(self, value):
-        self.administrativeState = value
-
-
-    def getRestUrl(self):
-        return self.restUrl
-
-
-class VnodLocalService(Service):
-
-    class Meta:
-        app_label = VNODLOCAL_KIND
-        verbose_name = "Virtual Network On Demand Local Service"
-
-    ADMINISTRATIVE_STATE = (
-        ('disabled', 'Disabled'),
-        ('configurationrequested', 'ConfigurationRequested'),
-        ('configurationfailed', 'ConfigurationFailed'),
-        ('configured', 'Configured'),
-        ('activationrequested', 'ActivationRequested'),
-        ('activationfailed', 'ActivationFailed'),
-        ('enabled', 'Enabled'),
-        ('deactivationrequested', 'DeactivationRequested')
-    )
-
-    OPERATIONALSTATE = (
-        ('active', 'Active'),
-        ('inactivereported', 'InactiveReported'),
-        ('inactive', 'Inactive'),
-        ('activereported', 'ActiveReported')
-    )
-
-    portid = models.CharField(verbose_name="PortId", blank=True, max_length=256, editable=True)
-    vlanid = models.CharField(verbose_name="VlanId", blank=True, max_length=256, editable=True)
-    servicehandle = models.CharField(verbose_name="Service Handle", max_length=256, editable=True)
-    autoattached = models.BooleanField(verbose_name="Auto-Attached", default=False, editable=True)
-
-    administrativeState = models.CharField(choices=ADMINISTRATIVE_STATE,
-                                           default='disabled',
-                                           verbose_name="AdministrativeState",
-                                           max_length=64,
-                                           editable=True)
-
-    operstate = models.CharField(choices=OPERATIONALSTATE,
-                                 default='inactive',
-                                 verbose_name="OperationalState",
-                                 max_length=64,
-                                 editable=True)
-
-
-    def __init__(self, *args, **kwargs):
-        super(VnodLocalService, self).__init__(*args, **kwargs)
-
-    def __unicode__(self):  return u'%s:%s' % (self.servicehandle, self.portid)
-
-
-class VnodLocalPseudowireConnectorService(Service):
-
-    class Meta:
-        app_label = VNODLOCAL_KIND
-        verbose_name = "Virtual Network On Demand Local Pseudo-wire Connector Service"
-
-    ADMINISTRATIVE_STATE = (
-        ('disabled', 'Disabled'),
-        ('activationrequested', 'ActivationRequested'),
-        ('enabled', 'Enabled'),
-        ('deactivationrequested', 'DeactivationRequested')
-    )
-
-    OPERATIONALSTATE = (
-        ('active', 'Active'),
-        ('inactive', 'Inactive')
-    )
-
-    servicehandle = models.CharField(verbose_name="Service Handle", max_length=256, editable=True)
-    pseudowirehandle = models.CharField(verbose_name="Pseudowirehandle", blank=True, max_length=256, editable=True)
-    internalport = models.CharField(verbose_name="Internal Port", max_length=256, editable=True)
-
-    vnodlocal = models.ForeignKey(VnodLocalService,
-                                  related_name='VnodLocalService',
-                                  verbose_name="VnodLocalService",
-                                  null=True,
-                                  editable=True,
-                                  on_delete=models.CASCADE)
-
-    administrativeState = models.CharField(choices=ADMINISTRATIVE_STATE,
-                                           default='disabled',
-                                           verbose_name="AdministrativeState",
-                                           max_length=64,
-                                           editable=True)
-
-    operstate = models.CharField(choices=OPERATIONALSTATE,
-                                 default='inactive',
-                                 verbose_name="OperationalState",
-                                 max_length=64,
-                                 editable=True)
-
-
-    def __init__(self, *args, **kwargs):
-        super(VnodLocalPseudowireConnectorService, self).__init__(*args, **kwargs)
diff --git a/xos/vnodlocal-onboard.yaml b/xos/vnodlocal-onboard.yaml
index c1a7387..6628d7e 100644
--- a/xos/vnodlocal-onboard.yaml
+++ b/xos/vnodlocal-onboard.yaml
@@ -13,7 +13,7 @@
           base_url: file:///opt/xos_services/metronet-local/xos/
           # The following will concatenate with base_url automatically, if
           # base_url is non-null.
-          models: models.py
+          xproto: ./
           admin: admin.py
           rest_service: subdirectory:vnodlocalservice api/service/vnodlocalservice/vnodlocalservice.py
           synchronizer: synchronizer/manifest