refactor vBBU as a separate project
(1) Moved xos/xos/services/mcord/ to xos_services/vBBU
(2) Moved the location of tosca files
from xos/xos/tosca/ to xos_services/vBBU/xos/tosca/
(3) Moved the location of synchronizer files
from xos/xos/synchronizers to xos_services/vBBU/xos/synchronizers
(4) Added make_synchronizer_manifest.sh and manifest
(5) Added vBBU-onboard.yaml
Change-Id: I97c8c234d66ef3121403fb9dd109d7497efe4e2a
diff --git a/xos/tosca/resources/vbbucomponent.py b/xos/tosca/resources/vbbucomponent.py
new file mode 100644
index 0000000..ee60d0c
--- /dev/null
+++ b/xos/tosca/resources/vbbucomponent.py
@@ -0,0 +1,40 @@
+import os
+import pdb
+import sys
+import tempfile
+sys.path.append("/opt/tosca")
+from translator.toscalib.tosca_template import ToscaTemplate
+import pdb
+
+from services.mcord.models import VBBUComponent, MCORDService
+
+from xosresource import XOSResource
+
+class XOSVBBUComponent(XOSResource):
+ provides = "tosca.nodes.VBBUComponent"
+ xos_model = VBBUComponent
+ copyin_props = ["s1u_tag", "s1mme_tag", "rru_tag", "display_message"]
+ name_field = None
+
+ def get_xos_args(self, throw_exception=True):
+ args = super(XOSVBBUComponent, self).get_xos_args()
+
+ provider_name = self.get_requirement("tosca.relationships.MemberOfService", throw_exception=throw_exception)
+ if provider_name:
+ args["provider_service"] = self.get_xos_object(MCORDService, throw_exception=throw_exception, name=provider_name)
+
+ return args
+
+ def get_existing_objs(self):
+ args = self.get_xos_args(throw_exception=False)
+ provider_service = args.get("provider", None)
+ if provider_service:
+ return [ self.get_xos_object(provider_service=provider_service) ]
+ return []
+
+ def postprocess(self, obj):
+ pass
+
+ def can_delete(self, obj):
+ return super(XOSVBBUComponent, self).can_delete(obj)
+