Merge branch 'master' of github.com:open-cloud/xos
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index 70a0f6a..0ee69a0 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -13,6 +13,7 @@
                 type: boolean
                 default: false
                 description: do not allow Tosca to create this object)
+# Service
 define(xos_base_service_caps,
             scalable:
                 type: tosca.capabilities.Scalable
@@ -40,6 +41,17 @@
             versionNumber:
                 type: string
                 required: false)
+# Subscriber
+define(xos_base_subscriber_caps,
+            subscriber:
+                type: tosca.capabilities.xos.Subscriber)
+define(xos_base_subscriber_props,
+            kind:
+                type: string
+                default: generic
+            subscriber_specific_id:
+                type: string
+                required: false)
 
 # end m4 macros
 #
@@ -80,6 +92,32 @@
         properties:
             xos_base_service_props
 
+    tosca.nodes.Subscriber:
+        derived_from: tosca.nodes.Root
+        capabilities:
+            xos_base_subscriber_caps
+        properties:
+            xos_base_subscriber_props
+
+    tosca.nodes.CORDSubscriber:
+        derived_from: tosca.nodes.Root
+        capabilities:
+            xos_base_subscriber_caps
+        properties:
+            xos_base_subscriber_props
+            firewall_enable:
+                type: boolean
+                default: false
+            url_filter_enable:
+                type: boolean
+                default: false
+            url_filter_level:
+                type: string
+                default: PG
+            cdn_enable:
+                type: boolean
+                default: true
+
     tosca.nodes.User:
         derived_from: tosca.nodes.Root
 
@@ -407,3 +445,7 @@
     tosca.capabilities.xos.User:
         derived_from: tosca.capabilities.Root
         description: An XOS user
+
+    tosca.capabilities.xos.Subscriber:
+        derived_from: tosca.capabilities.Root
+        description: An XOS Subscriber
diff --git a/xos/tosca/resources/CORDSubscriber.py b/xos/tosca/resources/CORDSubscriber.py
new file mode 100644
index 0000000..951b1f4
--- /dev/null
+++ b/xos/tosca/resources/CORDSubscriber.py
@@ -0,0 +1,24 @@
+import os
+import pdb
+import sys
+import tempfile
+sys.path.append("/opt/tosca")
+from translator.toscalib.tosca_template import ToscaTemplate
+import pdb
+
+from core.models import User
+from cord.models import CordSubscriberRoot
+
+from xosresource import XOSResource
+
+class XOSCORDSubscriber(XOSResource):
+    provides = "tosca.nodes.CORDSubscriber"
+    xos_model = CordSubscriberRoot
+    copyin_props = ["subscriber_specific_id", "firewall_enable", "url_filter_enable", "cdn_enable", "url_filter_level"]
+
+    def postprocess(self, obj):
+        pass
+
+    def can_delete(self, obj):
+        return super(XOSService, self).can_delete(obj)
+
diff --git a/xos/tosca/resources/subscriber.py b/xos/tosca/resources/subscriber.py
new file mode 100644
index 0000000..f247caa
--- /dev/null
+++ b/xos/tosca/resources/subscriber.py
@@ -0,0 +1,23 @@
+import os
+import pdb
+import sys
+import tempfile
+sys.path.append("/opt/tosca")
+from translator.toscalib.tosca_template import ToscaTemplate
+import pdb
+
+from core.models import Subscriber,User
+
+from xosresource import XOSResource
+
+class XOSSubscriber(XOSResource):
+    provides = "tosca.nodes.Subscriber"
+    xos_model = Subscriber
+    copyin_props = ["subscriber_specific_id"]
+
+    def postprocess(self, obj):
+        pass
+
+    def can_delete(self, obj):
+        return super(XOSService, self).can_delete(obj)
+
diff --git a/xos/tosca/samples/cord.yaml b/xos/tosca/samples/cord.yaml
index 885435d..5a11e5f 100644
--- a/xos/tosca/samples/cord.yaml
+++ b/xos/tosca/samples/cord.yaml
@@ -18,6 +18,25 @@
           view_url: /admin/cord/voltservice/$id$/
           kind: vOLT
 
+    Private:
+      type: tosca.nodes.NetworkTemplate
+
+    # networks required by vCPE
+    lan_network:

+      type: tosca.nodes.network.Network

+      properties:

+          ip_version: 4

+      requirements:

+          - network_template:

+              node: Private

+              relationship: tosca.relationships.UsesNetworkTemplate

+          - owner:

+              node: mysite_vcpe

+              relationship: tosca.relationships.MemberOfSlice

+          - connection:

+              node: mysite_vcpe

+              relationship: tosca.relationships.ConnectsToSlice
+
     service_vcpe:
       type: tosca.nodes.VCPEService
       requirements:
@@ -51,4 +70,13 @@
               node: mysite
               relationship: tosca.relationships.MemberOfSite
 
+    # Now let's add a subscriber
+
+    The Baker Household:
+       type: tosca.nodes.CORDSubscriber
+       properties:
+           firewall_enable: true
+           cdn_enable: true
+           url_filter_enable: true
+           url_filter_level: R