예제 #1
0
def startServer(config='odm2_config_timeseries.cfg',connection=None):
    dao = Odm2Dao(connection)
    app = wof.create_wof_flask_app(dao, config)
    app.config['DEBUG'] = True

    openPort = 8080
    url = "http://127.0.0.1:" + str(openPort)
    print "----------------------------------------------------------------"
    print "Acess Service endpoints at "
    for path in wof.site_map(app):
        print "%s%s" % (url,path)

    print "----------------------------------------------------------------"

    app.run(host='0.0.0.0', port=openPort, threaded=True)
예제 #2
0
def startServer(config=SWIS_CONFIG_FILE,connection=SWIS_DATABASE_URI, openPort=8080):

    swis_dao = SwisDao(SWIS_CONFIG_FILE, database_uri=connection)
    app = wof.create_wof_flask_app(swis_dao, config)
    app.config['DEBUG'] = True


    url = "http://127.0.0.1:" + str(openPort)
    print "----------------------------------------------------------------"
    print "Acess Service endpoints at "
    for path in wof.site_map(app):
        print "%s%s" % (url,path)

    print "----------------------------------------------------------------"

    app.run(host='0.0.0.0', port=openPort, threaded=True)
예제 #3
0
def startServer(config=CSV_CONFIG_FILE,
                sites_file=SITES_FILE,
                values_file=VALUES_FILE):
    dao = CsvDao(sites_file, values_file)
    app = wof.create_wof_flask_app(dao, config)
    app.config['DEBUG'] = True
    site_map = wof.site_map(app)

    openPort = 8080
    url = "http://127.0.0.1:" + str(openPort)
    print "----------------------------------------------------------------"
    print "Acess Service endpoints at "
    for path in wof.site_map(app):
        print "%s%s" % (url,path)

    print "----------------------------------------------------------------"

    app.run(host='0.0.0.0', port=openPort, threaded=True)
예제 #4
0
def startServer(config='LCM_config.cfg',connection='sqlite:///LCM_Data/LCM.db', openPort=8080):

    dao = LCMDao(connection,config)
    app = wof.create_wof_flask_app(dao, config)
    app.config['DEBUG'] = True


    url = "http://127.0.0.1:" + str(openPort)
    print "----------------------------------------------------------------"
    print "Service endpoints"
    for path in wof.core.site_map_flask_wsgi_mount(app):
        print "%s%s" % (url,path)

    print "----------------------------------------------------------------"
    print "----------------------------------------------------------------"
    print "HTML Acess Service endpoints at "
    for path in wof.site_map(app):
        print "%s%s" % (url,path)

    print "----------------------------------------------------------------"
    app.run(host='0.0.0.0', port=openPort, threaded=True)
예제 #5
0
def startServer(config=CBI_CONFIG_FILE,connection=CBI_CACHE_DATABASE_URI):

    cbi_dao = CbiDao(CBI_CONFIG_FILE, database_uri=CBI_CACHE_DATABASE_URI)
    app = wof.create_wof_flask_app(cbi_dao, config)
    app.config['DEBUG'] = True


    openPort = 8080
    url = "http://127.0.0.1:" + str(openPort)
    print "----------------------------------------------------------------"
    print "Service endpoints"
    for path in wof.core.site_map_flask_wsgi_mount(app):
        print "%s%s" % (url,path)

    print "----------------------------------------------------------------"
    print "----------------------------------------------------------------"
    print "HTML Acess Service endpoints at "
    for path in wof.site_map(app):
        print "%s%s" % (url,path)

    print "----------------------------------------------------------------"

    app.run(host='0.0.0.0', port=openPort, threaded=True)
예제 #6
0
def startServer(config='config.cfg',connection=None,openPort=8080):

    dao = OdmDao(connection)
    app = wof.create_wof_flask_app(dao, config)
    app.config['DEBUG'] = True

    configFile = WOFConfig(config)

    url = "http://127.0.0.1:" + str(openPort)
    print "----------------------------------------------------------------"
    print "Service endpoints"
    for path in wof.core.site_map_flask_wsgi_mount(app):
        print "%s%s" % (url,path)

    print "----------------------------------------------------------------"
    print "----------------------------------------------------------------"
    print "HTML Acess Service endpoints at "
    for path in wof.site_map(app):
        print "%s%s" % (url,path)

    print "----------------------------------------------------------------"

    app.run(host='0.0.0.0', port=openPort, threaded=True)
예제 #7
0
import wof

from odm_dao import OdmDao
import private_config

""" Before running this script, create a private_config.py file with the 
    connection string to your ODM database in SQL Server.  For example:
    
    lbr_connection_string = \
    'mssql+pyodbc://username:password@(local)/LittleBear11'
"""

logging.basicConfig(level=logging.DEBUG)

dao = OdmDao(private_config.lbr_connection_string)
app = wof.create_wof_flask_app(dao, 'lbr_config.cfg')
app.config['DEBUG'] = True

if __name__ == '__main__':
    # This must be an available port on your computer.  
    # For example, if 8080 is already being used, try another port such as
    # 5000 or 8081.
    openPort = 8080 

    url = "http://127.0.0.1:" + str(openPort) + "/"

    print "----------------------------------------------------------------"
    print "Access 'REST' endpoints at " + url
    print "Access SOAP WSDL at " + url + "soap/wateroneflow.wsdl"
    print "----------------------------------------------------------------"
예제 #8
0
def create_app():
    test_dao = TestDao()
    app = wof.create_wof_flask_app(test_dao, 'test_config.cfg')
    app.config['DEBUG'] = True