Пример #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()