CORD-1954 add s-tag and c-tag to VEEServiceInstance
Change-Id: Id7826263b74fbc14b82346a467d304e731bdd23b
(cherry picked from commit 35e0c8bdf8a0ffc828e2c26958e43479f3e1acb6)
diff --git a/xos/tosca/resources/veeserviceinstance.py b/xos/tosca/resources/veeserviceinstance.py
new file mode 100644
index 0000000..b072bbe
--- /dev/null
+++ b/xos/tosca/resources/veeserviceinstance.py
@@ -0,0 +1,27 @@
+
+# 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 core.models import User, ServiceInstanceLink
+from services.vee.models import VEEServiceInstance
+
+from xosresource import XOSResource
+from serviceinstance import XOSServiceInstance
+
+class XOSVEEServiceInstance(XOSServiceInstance):
+ provides = "tosca.nodes.VEEServiceInstance"
+ xos_model = VEEServiceInstance
+ copyin_props = ["service_specific_id", "s_tag", "c_tag"]
+
diff --git a/xos/vee-onboard.yaml b/xos/vee-onboard.yaml
index af18916..c66fca0 100644
--- a/xos/vee-onboard.yaml
+++ b/xos/vee-onboard.yaml
@@ -32,5 +32,5 @@
xproto: ./
synchronizer: synchronizer/manifest
synchronizer_run: vee-synchronizer.py
- tosca_resource: tosca/resources/veeservice.py
+ tosca_resource: tosca/resources/veeservice.py, tosca/resources/veeserviceinstance.py
tosca_custom_types: vee.yaml
diff --git a/xos/vee.m4 b/xos/vee.m4
index 85c65f8..43dab8c 100644
--- a/xos/vee.m4
+++ b/xos/vee.m4
@@ -43,3 +43,15 @@
type: string
required: false
+ tosca.nodes.VEEServiceInstance:
+ derived_from: tosca.nodes.Root
+ description: >
+ A VEE Tenant.
+ properties:
+ xos_base_tenant_props
+ s_tag:
+ type: integer
+ required: false
+ c_tag:
+ type: integer
+ required: false
diff --git a/xos/vee.xproto b/xos/vee.xproto
index 354949e..6d268b8 100644
--- a/xos/vee.xproto
+++ b/xos/vee.xproto
@@ -6,3 +6,10 @@
optional bool autoconfig = 1 [default = True, help_text="Autoconfigure VEE Service", null=False];
}
+message VEEServiceInstance (ServiceInstance){
+ option kind = "vEE";
+ option verbose_name = "vEE ServiceInstance";
+
+ optional int32 s_tag = 1 [help_text = "s-tag", null = True, db_index = False, blank = True];
+ optional int32 c_tag = 2 [help_text = "c-tag", null = True, db_index = False, blank = True];
+}
\ No newline at end of file
diff --git a/xos/vee.yaml b/xos/vee.yaml
index bbdc748..63d5294 100644
--- a/xos/vee.yaml
+++ b/xos/vee.yaml
@@ -19,6 +19,7 @@
# compile this with "m4 vee.m4 > vee.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
@@ -106,3 +107,22 @@
type: string
required: false
+ tosca.nodes.VEEServiceInstance:
+ derived_from: tosca.nodes.Root
+ description: >
+ A VEE Tenant.
+ properties:
+ 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
+ s_tag:
+ type: integer
+ required: false
+ c_tag:
+ type: integer
+ required: false