def adapter_upload_service(service_platform): print(request.is_json) content = request.get_json() print(content) ad = adapter.Adapter(service_platform) print(ad.name) return ad.uploadOSMService(request)
def serviceInstantiationDelete(service_platform): LOG.debug(request.is_json) content = request.get_json() LOG.debug(content) ad = adapter.Adapter(service_platform) #LOG.debug(content['service_uuid']) return ad.instantiationDelete(request)
def get_sp_ip(service_platform): #LOG.debug(request.is_json) #content = request.get_json() #LOG.debug(content) ad = adapter.Adapter(service_platform) #LOG.debug(ad.name) return ad.getSPIp()
def adapterDownloadUploadTest(): LOG.debug(request.is_json) content = request.get_json() sp = content['service_platform'] ad = adapter.Adapter(sp) LOG.debug(content) return ad.DownloadUploadTest(request)
def serviceInstantiation(service_platform): content = request.get_json() LOG.debug("service_uuid : " + content['service_uuid']) service_uuid = content['service_uuid'] instantiate_str = "{\"service_uuid\": \"" + service_uuid + "\"}" ad = adapter.Adapter(service_platform) return ad.instantiation(instantiate_str)
def adapter_upload_function(service_platform): LOG.debug(request.is_json) content = request.get_json() LOG.debug(content) ad = adapter.Adapter(service_platform) LOG.debug(ad.name) return ad.uploadOSMFunction(request)
def adapter_instatiate_service_remote_tests(): LOG.debug(request.is_json) content = request.get_json() sp = content['service_platform'] ad = adapter.Adapter(sp) LOG.debug(content) return ad.instantiateServiceRemoteTest(request)
def adapter_upload_package(service_platform): LOG.debug(request.is_json) content = request.get_json() LOG.debug(content) ad = adapter.Adapter(service_platform) LOG.debug(ad.name) return ad.uploadPackage(content['package'])
def serviceInstantiationStatus(service_platform): print(request.is_json) content = request.get_json() print(content) ad = adapter.Adapter(service_platform) #print (content['service_uuid']) return ad.instantiationStatus(request)
def adapter_instatiate_service(): LOG.debug(request.is_json) content = request.get_json() LOG.debug("Request: {}".format(content)) sp = content['service_platform'] ad = adapter.Adapter(sp) LOG.debug(content) return ad.instantiateService(request)
def getSonataRequest(service_platform, id): ad = adapter.Adapter(service_platform) #return ad.getSonataRequest(id) cosa = ad.getSonataRequest(id) cosa_json = json.loads(cosa) #return cosa_json['error'] cosa_string = '\"error\": \"' + cosa_json['error'] + '\"' return cosa_string
def adapter_download_package(request): print(request.is_json) content = request.get_json() print(content) ad = adapter.Adapter(content['service_platform']) package = ad.downloadPackage() my_type = ad.getDBType() if my_type == 'sonata': return ad.uploadPackage(package)
def getOSMServiceIdTest(): LOG.debug(request.is_json) content = request.get_json() LOG.debug(content) sp = content['service_platform'] ad = adapter.Adapter(sp) #LOG.debug(content) s_id = ad.getOSMServiceId(content['service_name'],content['service_vendor'],content['service_version']) LOG.debug(s_id) return s_id
def adapter_osm_get_token(service_platform): LOG.debug(request.is_json) content = request.get_json() LOG.debug(content) ad = adapter.Adapter(service_platform) my_type = ad.getDBType() if my_type == 'sonata': LOG.debug("this SP is a sonata") return ad.getSonataToken(request) if my_type == 'osm': return ad.getOSMToken(request)
def adapter_instatiate_service(): LOG.info("start /adapters/instantiate_service") LOG.info("request : {}".format(request.get_json())) LOG.debug(request.is_json) content = request.get_json() LOG.debug("Request: {}".format(content)) sp = content['service_platform'] ad = adapter.Adapter(sp) LOG.debug("AdapterStoredVars: {}".format(json.dumps(ad.__dict__))) LOG.debug(content) return ad.instantiateService(request)
def serviceInstantiation(service_platform): LOG.debug(request.is_json) LOG.debug(request) content = request.get_json() LOG.debug(request.get_json()) LOG.debug(content) LOG.debug(content['service_uuid']) service_uuid = content['service_uuid'] LOG.debug(service_uuid) instantiate_str = "{\"service_uuid\": \"" + service_uuid + "\"}" ad = adapter.Adapter(service_platform) return ad.instantiation(instantiate_str)
def serviceterminatetest(service_platform): LOG.debug(request) LOG.debug(type(request)) content = request.get_json() try: LOG.debug(content) LOG.debug(content['instance_uuid']) instance_uuid = content['instance_uuid'] LOG.debug(instance_uuid) package_uploaded = content['package_uploaded'] LOG.debug(package_uploaded) if (package_uploaded == False) or (package_uploaded == "false"): terminate_str = "{\"instance_uuid\": \"" + instance_uuid + "\",\"package_uploaded\": \"False\",\"sla_id\": \"\",\"request_type\":\"TERMINATE_SERVICE\"}" if (package_uploaded == True) or (package_uploaded == "true"): terminate_str = "{\"instance_uuid\": \"" + instance_uuid + "\",\"package_uploaded\": \"True\",\"sla_id\": \"\",\"request_type\":\"TERMINATE_SERVICE\"}" LOG.debug(terminate_str) ad = adapter.Adapter(service_platform) return ad.instantiationDeleteTest(terminate_str) except: error = "{\"error\": \"error launching the terminate\"}" return error
def getVimInfo(service_platform, vim_name): ad = adapter.Adapter(service_platform) return ad.getVim(vim_name)
def adapter_download_package(package_id): ad = adapter.Adapter("service_platform") return ad.downloadPackageTGO(package_id)
def serviceInstantiationsGetStatus(service_platform): ad = adapter.Adapter(service_platform) return ad.instantiationsStatus()
def serviceInstantiationGetStatus(service_platform, id): ad = adapter.Adapter(service_platform) return ad.instantiationStatus(id)
def serviceInstantiationInfoMonitoringTest(service_platform, id): ad = adapter.Adapter(service_platform) return ad.instantiationInfoMonitoringTest(id)
def monitoring(service_platform): LOG.debug(request.is_json) content = request.get_json() LOG.debug(content) ad = adapter.Adapter(service_platform) return ad.monitoringTests(content['metric'])
def monitoring_tests(service_platform): ad = adapter.Adapter(service_platform) return ad.monitoringTests("cpu_utilization")
def adapter_delete_service(service_platform, id_to_delete): ad = adapter.Adapter(service_platform) return ad.deleteOSMService(id_to_delete)
def adapter_delete_function(service_platform, id_to_delete): ad = adapter.Adapter(service_platform) return ad.deleteOSMFunction(id_to_delete)
def serviceInstantiationInfoCurator(service_platform, id): ad = adapter.Adapter(service_platform) return ad.instantiationInfoCurator(id)
def OSMInstantiationGetIPs(service_platform, id): ad = adapter.Adapter(service_platform) return ad.osmInstantiationIPs(id)
def getWimInfo(service_platform, wim_name): ad = adapter.Adapter(service_platform) return ad.getWim(wim_name)
def getWims(service_platform): ad = adapter.Adapter(service_platform) return ad.getWims()