2015-06-29 01:58:41 -05:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
|
|
|
# Copyright (C) 2013 - 2015, The pgAdmin Development Team
|
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
#
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
"""A blueprint module providing utility functions for the application."""
|
|
|
|
|
2015-10-20 02:03:18 -05:00
|
|
|
import datetime
|
|
|
|
from flask import session, current_app
|
2015-06-29 01:58:41 -05:00
|
|
|
from pgadmin.utils import PgAdminModule
|
2015-10-20 02:03:18 -05:00
|
|
|
import pgadmin.utils.driver as driver
|
|
|
|
|
|
|
|
MODULE_NAME = 'misc'
|
2015-06-29 01:58:41 -05:00
|
|
|
|
|
|
|
# Initialise the module
|
|
|
|
blueprint = PgAdminModule(MODULE_NAME, __name__,
|
|
|
|
url_prefix='')
|
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# A special URL used to "ping" the server
|
|
|
|
##########################################################################
|
2015-10-20 02:03:18 -05:00
|
|
|
|
|
|
|
|
|
|
|
@blueprint.route("/ping", methods=('get', 'post'))
|
2015-06-29 01:58:41 -05:00
|
|
|
def ping():
|
|
|
|
"""Generate a "PING" response to indicate that the server is alive."""
|
2015-10-20 02:03:18 -05:00
|
|
|
driver.ping()
|
|
|
|
|
2015-06-29 01:58:41 -05:00
|
|
|
return "PING"
|