示例#1
0
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)
示例#2
0
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)
示例#3
0
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()
示例#4
0
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)
示例#5
0
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)
示例#6
0
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)
示例#7
0
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)
示例#8
0
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'])
示例#9
0
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)
示例#10
0
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)  
示例#11
0
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
示例#12
0
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)
示例#13
0
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
示例#14
0
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)
示例#15
0
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)
示例#16
0
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)
示例#17
0
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
示例#18
0
def getVimInfo(service_platform, vim_name):
    ad = adapter.Adapter(service_platform)
    return ad.getVim(vim_name)
示例#19
0
def adapter_download_package(package_id):
    ad = adapter.Adapter("service_platform")
    return ad.downloadPackageTGO(package_id)
示例#20
0
def serviceInstantiationsGetStatus(service_platform):
    ad = adapter.Adapter(service_platform)
    return ad.instantiationsStatus()
示例#21
0
def serviceInstantiationGetStatus(service_platform, id):
    ad = adapter.Adapter(service_platform)
    return ad.instantiationStatus(id)
示例#22
0
def serviceInstantiationInfoMonitoringTest(service_platform, id):
    ad = adapter.Adapter(service_platform)
    return ad.instantiationInfoMonitoringTest(id)
示例#23
0
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'])
示例#24
0
def monitoring_tests(service_platform):
    ad = adapter.Adapter(service_platform)
    return ad.monitoringTests("cpu_utilization")
示例#25
0
def adapter_delete_service(service_platform, id_to_delete):
    ad = adapter.Adapter(service_platform)
    return ad.deleteOSMService(id_to_delete)
示例#26
0
def adapter_delete_function(service_platform, id_to_delete):
    ad = adapter.Adapter(service_platform)
    return ad.deleteOSMFunction(id_to_delete)
示例#27
0
def serviceInstantiationInfoCurator(service_platform, id):
    ad = adapter.Adapter(service_platform)
    return ad.instantiationInfoCurator(id)
示例#28
0
def OSMInstantiationGetIPs(service_platform, id):
    ad = adapter.Adapter(service_platform)
    return ad.osmInstantiationIPs(id)
示例#29
0
def getWimInfo(service_platform, wim_name):
    ad = adapter.Adapter(service_platform)
    return ad.getWim(wim_name)
示例#30
0
def getWims(service_platform):
    ad = adapter.Adapter(service_platform)
    return ad.getWims()