CORD-2476 migrate vrouter service to dynamic load

Change-Id: I773d0a597bc8c2e7001c51d7b2d43d472a7e7716
diff --git a/xos/admin.py b/xos/admin.py
deleted file mode 100644
index 853cd00..0000000
--- a/xos/admin.py
+++ /dev/null
@@ -1,230 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from django.contrib import admin
-
-from services.vrouter.models import *
-from django import forms
-from django.utils.safestring import mark_safe
-from django.contrib.auth.admin import UserAdmin
-from django.contrib.admin.widgets import FilteredSelectMultiple
-from django.contrib.auth.forms import ReadOnlyPasswordHashField
-from django.contrib.auth.signals import user_logged_in
-from django.utils import timezone
-from django.contrib.contenttypes import generic
-from suit.widgets import LinkedSelect
-from core.models import AddressPool
-from core.admin import ServiceAppAdmin, SliceInline, ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, AddressPoolInline, SubscriberLinkInline, ProviderLinkInline, ProviderDependencyInline,SubscriberDependencyInline
-from core.middleware import get_request
-
-from functools import update_wrapper
-from django.contrib.admin.views.main import ChangeList
-from django.core.urlresolvers import reverse
-from django.contrib.admin.utils import quote
-
-
-class VRouterPortInline(XOSTabularInline):
-    model = VRouterPort
-    fields = ['openflow_id']
-    suit_classes = 'suit-tab suit-tab-vrouter_ports'
-    extra = 0
-
-
-class VRouterInterfaceInline(XOSTabularInline):
-    model = VRouterInterface
-    fields = ['name', 'mac', 'vlan']
-    suit_classes = 'suit-tab suit-tab-vrouter_interfaces'
-    extra = 0
-
-
-class VRouterIpInline(XOSTabularInline):
-    model = VRouterIp
-    fields = ['ip']
-    suit_classes = 'suit-tab suit-tab-vrouter_ips'
-    extra = 0
-
-
-class VRouterServiceForm(forms.ModelForm):
-    def __init__(self, *args, **kwargs):
-        super(VRouterServiceForm, self).__init__(*args, **kwargs)
-
-    def save(self, commit=True):
-        return super(VRouterServiceForm, self).save(commit=commit)
-
-    class Meta:
-        model = VRouterService
-        fields = '__all__'
-
-
-class VRouterServiceAdmin(ReadOnlyAwareAdmin):
-    model = VRouterService
-    verbose_name = "vRouter Service"
-    verbose_name_plural = "vRouter Service"
-    list_display = ("backend_status_icon", "name", "enabled")
-    list_display_links = ('backend_status_icon', 'name', )
-    fieldsets = [(None, {
-        'fields': [
-            'backend_status_text',
-            'name',
-            'enabled',
-            'versionNumber',
-            'description',
-            'view_url',
-            'icon_url',
-            'rest_hostname',
-            'rest_port',
-            'rest_user',
-            'rest_pass',
-        ],
-        'classes':['suit-tab suit-tab-general']})]
-
-    # NOTE make rest_* params editable
-    readonly_fields = (
-        'backend_status_text',
-        'rest_hostname',
-        'rest_port',
-        'rest_user',
-        'rest_pass'
-    )
-    inlines = [SliceInline, ServiceAttrAsTabInline, ServicePrivilegeInline, AddressPoolInline, ProviderDependencyInline,SubscriberDependencyInline]
-    form = VRouterServiceForm
-
-    extracontext_registered_admins = True
-
-    user_readonly_fields = ["name", "enabled", "versionNumber", "description"]
-
-    suit_form_tabs = (
-        ('general', 'vRouter Service Details'),
-        ('administration', 'Administration'),
-        ('addresspools', 'Addresses'),
-        # ('tools', 'Tools'),
-        ('slices', 'Slices'),
-        ('serviceattrs', 'Additional Attributes'),
-        ('servicetenants', 'Dependencies'),
-        ('serviceprivileges', 'Privileges'),
-    )
-
-    suit_form_includes = ('vrouteradmin.html', 'top', 'administration')  # ('hpctools.html', 'top', 'tools') )
-
-    def get_queryset(self, request):
-        return VRouterService.select_by_user(request.user)
-
-
-class VRouterTenantForm(forms.ModelForm):
-    gateway_ip = forms.CharField(required=False)
-    gateway_mac = forms.CharField(required=False)
-    cidr = forms.CharField(required=False)
-
-    def __init__(self,*args,**kwargs):
-        super (VRouterTenantForm,self ).__init__(*args,**kwargs)
-        self.fields['owner'].queryset = VRouterService.objects.all()
-        if self.instance:
-            # fields for the attributes
-            self.fields['gateway_ip'].initial = self.instance.gateway_ip
-            self.fields['gateway_mac'].initial = self.instance.gateway_mac
-            self.fields['cidr'].initial = self.instance.cidr
-        if (not self.instance) or (not self.instance.pk):
-            # default fields for an 'add' form
-            if VRouterService.objects.exists():
-               self.fields["owner"].initial = VRouterService.objects.first()
-
-    def save(self, commit=True):
-        return super(VRouterTenantForm, self).save(commit=commit)
-
-    class Meta:
-        model = VRouterTenant
-        fields = '__all__'
-
-
-class VRouterTenantAdmin(ReadOnlyAwareAdmin):
-    list_display = ('backend_status_icon', 'id', 'public_ip')
-    list_display_links = ('backend_status_icon', 'id')
-    fieldsets = [(None, {
-        'fields': [
-            'backend_status_text', 'owner',
-            'address_pool', 'public_ip', 'public_mac', 'gateway_ip', 'gateway_mac', 'cidr'],
-        'classes':['suit-tab suit-tab-general']
-    })]
-    readonly_fields = ('backend_status_text', 'service_specific_attribute', 'gateway_ip', 'gateway_mac', 'cidr')
-    inlines = (ProviderLinkInline, SubscriberLinkInline)
-    form = VRouterTenantForm
-
-    suit_form_tabs = (('general', 'Details'), ('servicelinks','Links'),)
-
-    def get_queryset(self, request):
-        return VRouterTenant.select_by_user(request.user)
-
-
-class VRouterDeviceAdmin(ReadOnlyAwareAdmin):
-    list_display = ('name', 'openflow_id', 'config_key', 'driver')
-    fieldsets = [(None, {
-        'fields': ['name', 'openflow_id', 'vrouter_service', 'config_key', 'driver'],
-        'classes':['suit-tab suit-tab-general']
-    })]
-    inlines = [VRouterPortInline]
-
-    suit_form_tabs = (
-        ('general', 'Device Details'),
-        ('vrouter_ports', 'Ports'),
-    )
-
-
-class VRouterPortAdmin(ReadOnlyAwareAdmin):
-    list_display = ('name', 'openflow_id', 'vrouter_device')
-    fieldsets = [(None, {
-        'fields': ['name', 'openflow_id', 'vrouter_service', 'vrouter_device'],
-        'classes':['suit-tab suit-tab-general']
-    })]
-    inlines = [VRouterInterfaceInline]
-
-    suit_form_tabs = (
-        ('general', 'Ports Details'),
-        ('vrouter_interfaces', 'Interfaces'),
-    )
-
-
-class VRouterInterfaceAdmin(ReadOnlyAwareAdmin):
-    list_display = ('name', 'mac', 'vlan')
-    fieldsets = [(None, {
-        'fields': ['name', 'vrouter_port', 'mac', 'vlan'],
-        'classes':['suit-tab suit-tab-general']
-    })]
-    inlines = [VRouterIpInline]
-
-    suit_form_tabs = (
-        ('general', 'Interfaces Details'),
-        ('vrouter_ips', 'Ips'),
-    )
-
-
-class VRouterIpAdmin(ReadOnlyAwareAdmin):
-    list_display = ('name', 'ip', 'vrouter_interface')
-    fieldsets = [(None, {'fields': ['name', 'ip', 'vrouter_interface']})]
-
-
-class VRouterAppAdmin(ReadOnlyAwareAdmin):
-    list_display = ('name', 'control_plane_connect_point', 'ospf_enabled')
-    fieldsets = [(None, {'fields': ['name', 'vrouter_service', 'control_plane_connect_point', 'ospf_enabled']})]
-
-
-admin.site.register(VRouterService, VRouterServiceAdmin)
-admin.site.register(VRouterTenant, VRouterTenantAdmin)
-admin.site.register(VRouterDevice, VRouterDeviceAdmin)
-admin.site.register(VRouterPort, VRouterPortAdmin)
-admin.site.register(VRouterInterface, VRouterInterfaceAdmin)
-admin.site.register(VRouterIp, VRouterIpAdmin)
-admin.site.register(VRouterApp, VRouterAppAdmin)
-
diff --git a/xos/macros.m4 b/xos/macros.m4
deleted file mode 100644
index 391aafd..0000000
--- a/xos/macros.m4
+++ /dev/null
@@ -1,100 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# Note: Tosca derived_from isn't working the way I think it should, it's not
-#    inheriting from the parent template. Until we get that figured out, use
-#    m4 macros do our inheritance
-
-define(xos_base_props,
-            no-delete:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to delete this object
-            no-create:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to create this object
-            no-update:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to update this object
-            replaces:
-                type: string
-                required: false
-                descrption: Replaces/renames this object)
-# Service
-define(xos_base_service_caps,
-            scalable:
-                type: tosca.capabilities.Scalable
-            service:
-                type: tosca.capabilities.xos.Service)
-define(xos_base_service_props,
-            kind:
-                type: string
-                default: generic
-                description: Type of service.
-            view_url:
-                type: string
-                required: false
-                description: URL to follow when icon is clicked in the Service Directory.
-            icon_url:
-                type: string
-                required: false
-                description: ICON to display in the Service Directory.
-            enabled:
-                type: boolean
-                default: true
-            published:
-                type: boolean
-                default: true
-                description: If True then display this Service in the Service Directory.
-            public_key:
-                type: string
-                required: false
-                description: Public key to install into Instances to allows Services to SSH into them.
-            private_key_fn:
-                type: string
-                required: false
-                description: Location of private key file
-            versionNumber:
-                type: string
-                required: false
-                description: Version number of Service.)
-# Subscriber
-define(xos_base_subscriber_caps,
-            subscriber:
-                type: tosca.capabilities.xos.Subscriber)
-define(xos_base_subscriber_props,
-            kind:
-                type: string
-                default: generic
-                description: Kind of subscriber
-            service_specific_id:
-                type: string
-                required: false
-                description: Service specific ID opaque to XOS but meaningful to service)
-define(xos_base_tenant_props,
-            kind:
-                type: string
-                default: generic
-                description: Kind of tenant
-            service_specific_id:
-                type: string
-                required: false
-                description: Service specific ID opaque to XOS but meaningful to service)
-
-# end m4 macros
-
diff --git a/xos/models.py b/xos/synchronizer/models/models.py
similarity index 100%
rename from xos/models.py
rename to xos/synchronizer/models/models.py
diff --git a/xos/vrouter.xproto b/xos/synchronizer/models/vrouter.xproto
similarity index 100%
rename from xos/vrouter.xproto
rename to xos/synchronizer/models/vrouter.xproto
diff --git a/xos/synchronizer/vrouter_config.yaml b/xos/synchronizer/vrouter_config.yaml
index 050503a..7fe4f18 100644
--- a/xos/synchronizer/vrouter_config.yaml
+++ b/xos/synchronizer/vrouter_config.yaml
@@ -14,10 +14,16 @@
 # limitations under the License.
 
 
-name: vrouter-synchronizer
+name: vrouter
 accessor:
   username: xosadmin@opencord.org
   password: "@/opt/xos/services/vrouter/credentials/xosadmin@opencord.org"
+required_models:
+  - VRouterService
+  - VRouterDevice
+  - VRouterApp
+  - VRouterPort
 dependency_graph: "/opt/xos/synchronizers/vrouter/model-deps"
 steps_dir: "/opt/xos/synchronizers/vrouter/steps"
-sys_dir: "/opt/xos/synchronizers/vrouter/sys"
\ No newline at end of file
+sys_dir: "/opt/xos/synchronizers/vrouter/sys"
+models_dir: "/opt/xos/synchronizers/vrouter/models"
diff --git a/xos/templates/vrouteradmin.html b/xos/templates/vrouteradmin.html
deleted file mode 100644
index fed8bb4..0000000
--- a/xos/templates/vrouteradmin.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-<!--
-Copyright 2017-present Open Networking Foundation
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-
-
-<div class="row">
-  <div class="col-sm-4">
-    <a href="/admin/vrouter/vroutertenant/" class="btn btn-primary">vRouter Tenants</a>
-  </div>
-  <div class="col-sm-4">
-    <a href="/admin/vrouter/vrouterapps/" class="btn btn-primary">vRouter Apps</a>
-  </div>
-  <div class="col-sm-4">
-    <a href="/admin/vrouter/vrouterdevices/" class="btn btn-primary">vRouter Devices</a>
-  </div>
-</div>
-<div class="row">
-  <div class="col-sm-4">
-    <a href="/admin/vrouter/vrouterports/" class="btn btn-primary">vRouter Ports</a>
-  </div>
-  <div class="col-sm-4">
-    <a href="/admin/vrouter/vrouterinterfaces/" class="btn btn-primary">vRouter Interfaces</a>
-  </div>
-  <div class="col-sm-4">
-    <a href="/admin/vrouter/vrouterips/" class="btn btn-primary">vRouter Ips</a>
-  </div>
-</div>
\ No newline at end of file
diff --git a/xos/tosca/resources/vrouterservice.py b/xos/tosca/resources/vrouterservice.py
deleted file mode 100644
index 2d64d00..0000000
--- a/xos/tosca/resources/vrouterservice.py
+++ /dev/null
@@ -1,106 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from service import XOSService
-from services.vrouter.models import *
-
-
-class XOSVRouterService(XOSService):
-    provides = "tosca.nodes.VRouterService"
-    xos_model = VRouterService
-    copyin_props = ["view_url", "icon_url", "enabled", "published", "public_key", "versionNumber",
-                    "rest_hostname", "rest_port", "rest_user", "rest_pass"]
-
-
-class XOSVRouterDevice(XOSService):
-    provides = "tosca.nodes.VRouterDevice"
-    xos_model = VRouterDevice
-    copyin_props = ['openflow_id', 'config_key', 'driver']
-
-    def get_xos_args(self):
-        args = super(XOSVRouterDevice, self).get_xos_args()
-
-        serviceName = self.get_requirement("tosca.relationships.MemberOfService", throw_exception=False)
-        if serviceName:
-            service = self.get_xos_object(Service, name=serviceName)
-            args["vrouter_service_id"] = service.id
-        return args
-
-
-class XOSVRouterPort(XOSService):
-    provides = "tosca.nodes.VRouterPort"
-    xos_model = VRouterPort
-    copyin_props = ['openflow_id']
-
-    def get_xos_args(self):
-        args = super(XOSVRouterPort, self).get_xos_args()
-
-        deviceName = self.get_requirement("tosca.relationships.PortOfDevice", throw_exception=False)
-        if deviceName:
-            device = self.get_xos_object(VRouterDevice, name=deviceName)
-            args["vrouter_device"] = device
-
-        serviceName = self.get_requirement("tosca.relationships.MemberOfService", throw_exception=False)
-        if serviceName:
-            service = self.get_xos_object(Service, name=serviceName)
-            args["vrouter_service_id"] = service.id
-
-        return args
-
-
-class XOSVRouterInterface(XOSService):
-    provides = "tosca.nodes.VRouterInterface"
-    xos_model = VRouterInterface
-    copyin_props = ['name', 'mac', 'vlan']
-
-    def get_xos_args(self):
-        args = super(XOSVRouterInterface, self).get_xos_args()
-
-        portName = self.get_requirement("tosca.relationships.InterfaceOfPort", throw_exception=False)
-        if portName:
-            port = self.get_xos_object(VRouterPort, name=portName)
-            args["vrouter_port"] = port
-        return args
-
-
-class XOSVRouterIp(XOSService):
-    provides = "tosca.nodes.VRouterIp"
-    xos_model = VRouterIp
-    copyin_props = ['ip']
-
-    def get_xos_args(self):
-        args = super(XOSVRouterIp, self).get_xos_args()
-
-        interfaceName = self.get_requirement("tosca.relationships.IpOfInterface", throw_exception=False)
-        if interfaceName:
-            interface = self.get_xos_object(VRouterInterface, name=interfaceName)
-            args["vrouter_interface"] = interface
-        return args
-
-
-class XOSVRouterApp(XOSService):
-    provides = "tosca.nodes.VRouterApp"
-    xos_model = VRouterApp
-    copyin_props = ['name', 'control_plane_connect_point', 'ospf_enabled']
-
-    def get_xos_args(self):
-        args = super(XOSVRouterApp, self).get_xos_args()
-
-        serviceName = self.get_requirement("tosca.relationships.MemberOfService", throw_exception=True)
-        if serviceName:
-            service = self.get_xos_object(Service, name=serviceName)
-            args["vrouter_service_id"] = service.id
-        return args
diff --git a/xos/tosca/sample.yaml b/xos/tosca/sample.yaml
deleted file mode 100644
index a9a8901..0000000
--- a/xos/tosca/sample.yaml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: Just enough Tosca to get the vSG slice running on the CORD POD
-
-imports:
-   - custom_types/xos.yaml
-   - custom_types/vrouter.yaml
-
-topology_template:
-  node_templates:
-
-    service#vRouterSample:
-      type: tosca.nodes.VRouterService
-      properties:
-          view_url: /admin/vrouter/vrouterservice/$id$/
-          rest_hostname: 10.0.2.2
-          rest_port: 8181
-          rest_user: onos
-          rest_pass: rocks
-    
-    device#switch:
-      type: tosca.nodes.VRouterDevice
-      properties:
-        openflow_id: of:000000000001
-        driver: softrouter
-        # config_key: basic
-      requirements:
-        - service#vRouterSample:
-            node: service#vRouterSample
-            relationship: tosca.relationships.MemberOfService
-
-    port#sample_port:
-      type: tosca.nodes.VRouterPort
-      properties:
-        openflow_id: of:000000000001/1
-      requirements:
-        - device#switch:
-            node: device#switch
-            relationship: tosca.relationships.PortOfDevice
-        - service#vRouterSample:
-            node: service#vRouterSample
-            relationship: tosca.relationships.MemberOfService
-
-    interface#b1-1:
-      type: tosca.nodes.VRouterInterface
-      properties:
-        name: b1-1
-        mac: 00:00:00:00:00:01
-        vlan: 100
-      requirements:
-        - port#sample_port:
-            node: port#sample_port
-            relationship: tosca.relationships.InterfaceOfPort
-
-    vrouter_ips:
-      type: tosca.nodes.VRouterIp
-      properties:
-        ip: 10.0.4.2/24
-      requirements:
-        - interface#b1-1:
-            node: interface#b1-1
-            relationship: tosca.relationships.IpOfInterface
-
-    app#vrouterApp:
-      type: tosca.nodes.VRouterApp
-      properties:
-        name: org.onosproject.router
-        # can we use a relation to specify the connect point port?
-        control_plane_connect_point: of:00000000000000b1/5
-        ospf_enabled: true
-      requirements:
-          - service#vRouterSample:
-              node: service#vRouterSample
-              relationship: tosca.relationships.MemberOfService
diff --git a/xos/vrouter-onboard.yaml b/xos/vrouter-onboard.yaml
index 7795600..97f3901 100644
--- a/xos/vrouter-onboard.yaml
+++ b/xos/vrouter-onboard.yaml
@@ -27,13 +27,6 @@
       type: tosca.nodes.ServiceController
       properties:
           base_url: file:///opt/xos_services/vrouter/xos/
-          # The following will concatenate with base_url automatically, if
-          # base_url is non-null.
-          xproto: ./
-          admin: admin.py
-          admin_template: templates/vrouteradmin.html
-          tosca_custom_types: vrouter.yaml
-          tosca_resource: tosca/resources/vrouterservice.py
 
 
 
diff --git a/xos/vrouter.m4 b/xos/vrouter.m4
deleted file mode 100644
index fd4ccf4..0000000
--- a/xos/vrouter.m4
+++ /dev/null
@@ -1,136 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-# compile this with "m4 vrouter.m4 > vrouter.yaml"
-
-# include macros
-include(macros.m4)
-
-node_types:
-    
-    tosca.nodes.VRouterService:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter Service.
-        capabilities:
-            xos_base_service_caps
-        properties:
-            xos_base_props
-            xos_base_service_props
-            rest_hostname:
-                type: string
-                required: false
-            rest_port:
-                type: string
-                required: false
-            rest_user:
-                type: string
-                required: false
-            rest_pass:
-                type: string
-                required: false
-
-    tosca.nodes.VRouterDevice:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter Device.
-        capabilities:
-            xos_base_service_caps
-        properties:
-            xos_base_props
-            openflow_id:
-                type: string
-                required: true
-            config_key:
-                type: string
-                required: false
-            driver:
-                type: string
-                required: true
-
-    tosca.nodes.VRouterPort:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter Port.
-        capabilities:
-            xos_base_service_caps
-        properties:
-            xos_base_props
-            openflow_id:
-                type: string
-                required: true
-
-    tosca.nodes.VRouterInterface:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter Interface.
-        capabilities:
-            xos_base_service_caps
-        properties:
-            xos_base_props
-            name:
-                type: string
-                required: true
-            mac:
-                type: string
-                required: true
-            vlan:
-                type: string
-                required: false
-
-    tosca.nodes.VRouterIp:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter Ip.
-        capabilities:
-            xos_base_service_caps
-        properties:
-            xos_base_props
-            ip:
-                type: string
-                required: true
-
-    tosca.nodes.VRouterApp:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter ONOS App Config.
-        capabilities:
-            xos_base_service_caps
-        properties:
-            xos_base_props
-            name:
-                type: string
-                required: true
-            control_plane_connect_point:
-                type: string
-                required: true
-            ospf_enabled:
-                type: boolean
-                required: true
-
-    tosca.relationships.PortOfDevice:
-            derived_from: tosca.relationships.Root
-            valid_target_types: [ tosca.capabilities.xos.VRouterPort ]
-
-    tosca.relationships.InterfaceOfPort:
-            derived_from: tosca.relationships.Root
-            valid_target_types: [ tosca.capabilities.xos.VRouterInterface ]
-
-    tosca.relationships.IpOfInterface:
-            derived_from: tosca.relationships.Root
-            valid_target_types: [ tosca.capabilities.xos.VRouterIp ]
\ No newline at end of file
diff --git a/xos/vrouter.yaml b/xos/vrouter.yaml
deleted file mode 100644
index 9e38417..0000000
--- a/xos/vrouter.yaml
+++ /dev/null
@@ -1,289 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-# compile this with "m4 vrouter.m4 > vrouter.yaml"
-
-# include macros
-# Note: Tosca derived_from isn't working the way I think it should, it's not
-#    inheriting from the parent template. Until we get that figured out, use
-#    m4 macros do our inheritance
-
-
-# Service
-
-
-# Subscriber
-
-
-
-
-# end m4 macros
-
-
-
-node_types:
-    
-    tosca.nodes.VRouterService:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter Service.
-        capabilities:
-            scalable:
-                type: tosca.capabilities.Scalable
-            service:
-                type: tosca.capabilities.xos.Service
-        properties:
-            no-delete:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to delete this object
-            no-create:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to create this object
-            no-update:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to update this object
-            replaces:
-                type: string
-                required: false
-                descrption: Replaces/renames this object
-            kind:
-                type: string
-                default: generic
-                description: Type of service.
-            view_url:
-                type: string
-                required: false
-                description: URL to follow when icon is clicked in the Service Directory.
-            icon_url:
-                type: string
-                required: false
-                description: ICON to display in the Service Directory.
-            enabled:
-                type: boolean
-                default: true
-            published:
-                type: boolean
-                default: true
-                description: If True then display this Service in the Service Directory.
-            public_key:
-                type: string
-                required: false
-                description: Public key to install into Instances to allows Services to SSH into them.
-            private_key_fn:
-                type: string
-                required: false
-                description: Location of private key file
-            versionNumber:
-                type: string
-                required: false
-                description: Version number of Service.
-            rest_hostname:
-                type: string
-                required: false
-            rest_port:
-                type: string
-                required: false
-            rest_user:
-                type: string
-                required: false
-            rest_pass:
-                type: string
-                required: false
-
-    tosca.nodes.VRouterDevice:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter Device.
-        capabilities:
-            scalable:
-                type: tosca.capabilities.Scalable
-            service:
-                type: tosca.capabilities.xos.Service
-        properties:
-            no-delete:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to delete this object
-            no-create:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to create this object
-            no-update:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to update this object
-            replaces:
-                type: string
-                required: false
-                descrption: Replaces/renames this object
-            openflow_id:
-                type: string
-                required: true
-            config_key:
-                type: string
-                required: false
-            driver:
-                type: string
-                required: true
-
-    tosca.nodes.VRouterPort:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter Port.
-        capabilities:
-            scalable:
-                type: tosca.capabilities.Scalable
-            service:
-                type: tosca.capabilities.xos.Service
-        properties:
-            no-delete:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to delete this object
-            no-create:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to create this object
-            no-update:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to update this object
-            replaces:
-                type: string
-                required: false
-                descrption: Replaces/renames this object
-            openflow_id:
-                type: string
-                required: true
-
-    tosca.nodes.VRouterInterface:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter Interface.
-        capabilities:
-            scalable:
-                type: tosca.capabilities.Scalable
-            service:
-                type: tosca.capabilities.xos.Service
-        properties:
-            no-delete:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to delete this object
-            no-create:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to create this object
-            no-update:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to update this object
-            replaces:
-                type: string
-                required: false
-                descrption: Replaces/renames this object
-            name:
-                type: string
-                required: true
-            mac:
-                type: string
-                required: true
-            vlan:
-                type: string
-                required: false
-
-    tosca.nodes.VRouterIp:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter Ip.
-        capabilities:
-            scalable:
-                type: tosca.capabilities.Scalable
-            service:
-                type: tosca.capabilities.xos.Service
-        properties:
-            no-delete:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to delete this object
-            no-create:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to create this object
-            no-update:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to update this object
-            replaces:
-                type: string
-                required: false
-                descrption: Replaces/renames this object
-            ip:
-                type: string
-                required: true
-
-    tosca.nodes.VRouterApp:
-        derived_from: tosca.nodes.Root
-        description: >
-            CORD: The vRouter ONOS App Config.
-        capabilities:
-            scalable:
-                type: tosca.capabilities.Scalable
-            service:
-                type: tosca.capabilities.xos.Service
-        properties:
-            no-delete:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to delete this object
-            no-create:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to create this object
-            no-update:
-                type: boolean
-                default: false
-                description: Do not allow Tosca to update this object
-            replaces:
-                type: string
-                required: false
-                descrption: Replaces/renames this object
-            name:
-                type: string
-                required: true
-            control_plane_connect_point:
-                type: string
-                required: true
-            ospf_enabled:
-                type: boolean
-                required: true
-
-    tosca.relationships.PortOfDevice:
-            derived_from: tosca.relationships.Root
-            valid_target_types: [ tosca.capabilities.xos.VRouterPort ]
-
-    tosca.relationships.InterfaceOfPort:
-            derived_from: tosca.relationships.Root
-            valid_target_types: [ tosca.capabilities.xos.VRouterInterface ]
-
-    tosca.relationships.IpOfInterface:
-            derived_from: tosca.relationships.Root
-            valid_target_types: [ tosca.capabilities.xos.VRouterIp ]
\ No newline at end of file