@bottle.route(url_base + '/<tenant_id>/instances/<instance_id>', method='GET')
def http_get_instance_id(tenant_id, instance_id):
    '''get instances details, can use both uuid or name'''
    #check valid tenant_id
    if tenant_id != "any" and not nfvo.check_tenant(mydb, tenant_id): 
        print 'httpserver.http_get_instance_id() tenant %s not found' % tenant_id
        bottle.abort(HTTP_Not_Found, 'Tenant %s not found' % tenant_id)
        return
    if tenant_id == "any":
        tenant_id = None
  
    #obtain data (first time is only to check that the instance exists)
    result, data = mydb.get_instance_scenario(instance_id, tenant_id, verbose=True)
    if result < 0:
        print "http_get_instance_id error %d %s" % (-result, data)
        bottle.abort(-result, data)
        return
    
    r,c = nfvo.refresh_instance(mydb, tenant_id, data)
    if r<0:
        print "WARNING: nfvo.refresh_instance couldn't refresh the status of the instance: %s" %c
    #obtain data with results upated
    result, data = mydb.get_instance_scenario(instance_id, tenant_id)
    if result < 0:
        print "http_get_instance_id error %d %s" % (-result, data)
        bottle.abort(-result, data)
        return
    convert_datetime2str(data)
    print json.dumps(data, indent=4)
    return format_out(data)
dataset/ETHPy150Open nfvlabs/openmano/openmano/httpserver.py/http_get_instance_id/original