api.py (monasca-log-api-2.7.0) | : | api.py (monasca-log-api-2.9.0) | ||
---|---|---|---|---|
skipping to change at line 74 | skipping to change at line 74 | |||
"""Creates Version application""" | """Creates Version application""" | |||
ctrl = versions.Versions() | ctrl = versions.Versions() | |||
controllers = { | controllers = { | |||
'/': ctrl, # redirect http://host:port/ down to Version app | '/': ctrl, # redirect http://host:port/ down to Version app | |||
# avoid conflicts with actual pipelines and 404 error | # avoid conflicts with actual pipelines and 404 error | |||
'/version': ctrl, # list all the versions | '/version': ctrl, # list all the versions | |||
'/version/{version_id}': ctrl # display details of the version | '/version/{version_id}': ctrl # display details of the version | |||
} | } | |||
wsgi_app = falcon.API() | wsgi_app = falcon.API( | |||
request_type=request.Request | ||||
) | ||||
for route, ctrl in controllers.items(): | for route, ctrl in controllers.items(): | |||
wsgi_app.add_route(route, ctrl) | wsgi_app.add_route(route, ctrl) | |||
return wsgi_app | return wsgi_app | |||
@error_trap('healthcheck') | @error_trap('healthcheck') | |||
def create_healthcheck_app(global_conf, **local_conf): | def create_healthcheck_app(global_conf, **local_conf): | |||
"""Creates Healthcheck application""" | """Creates Healthcheck application""" | |||
ctrl = healthchecks.HealthChecks() | ctrl = healthchecks.HealthChecks() | |||
controllers = { | controllers = { | |||
'/': ctrl | '/': ctrl | |||
} | } | |||
wsgi_app = falcon.API() | wsgi_app = falcon.API( | |||
request_type=request.Request | ||||
) | ||||
for route, ctrl in controllers.items(): | for route, ctrl in controllers.items(): | |||
wsgi_app.add_route(route, ctrl) | wsgi_app.add_route(route, ctrl) | |||
return wsgi_app | return wsgi_app | |||
@error_trap('api') | @error_trap('api') | |||
@singleton_config | @singleton_config | |||
def create_api_app(global_conf, **local_conf): | def create_api_app(global_conf, **local_conf): | |||
"""Creates MainAPI application""" | """Creates MainAPI application""" | |||
controllers = {} | controllers = {} | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 6 lines changed or added |