- def unpack_service_package(self, service_uuid):
- # TODO implement method
- # 1. unzip *.son file and store contents in CATALOG_FOLDER/services/<service_uuid>/
- pass
+ def register_service_package(self, service_uuid, service):
+ """
+ register new service package
+ :param service_uuid
+ :param service object
+ """
+ self.services[service_uuid] = service
+ # lets perform all steps needed to onboard the service
+ service.onboard()
+
+
+class Service(object):
+ """
+ This class represents a NS uploaded as a *.son package to the
+ dummy gatekeeper.
+ Can have multiple running instances of this service.
+ """
+
+ def __init__(self,
+ service_uuid,
+ package_file_hash,
+ package_file_path):
+ self.uuid = service_uuid
+ self.package_file_hash = package_file_hash
+ self.package_file_path = package_file_path
+ self.package_content_path = os.path.join(CATALOG_FOLDER, "services/%s" % self.uuid)
+ self.instances = dict()
+ LOG.info("Created service: %r" % self.uuid)