File indexing completed on 2026-04-09 07:58:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 from flask import Blueprint
0013
0014
0015 from idds.common.constants import HTTP_STATUS_CODE
0016 from idds.rest.v1.controller import IDDSController
0017
0018
0019 class Ping(IDDSController):
0020 """ Ping the rest service """
0021
0022 def get(self):
0023 """ Ping the rest service.
0024 HTTP Success:
0025 200 OK
0026 HTTP Error:
0027 404 Not Found
0028 500 InternalError
0029 :returns: dictionary of an request.
0030 """
0031
0032 rets = {'Status': 'OK'}
0033 return self.generate_http_response(HTTP_STATUS_CODE.OK, data=rets)
0034
0035 def post_test(self):
0036 import pprint
0037 pprint.pprint(self.get_request())
0038 pprint.pprint(self.get_request().endpoint)
0039 pprint.pprint(self.get_request().url_rule)
0040
0041
0042 """----------------------
0043 Web service url maps
0044 ----------------------"""
0045
0046
0047 def get_blueprint():
0048 bp = Blueprint('ping', __name__)
0049
0050 view = Ping.as_view('ping')
0051 bp.add_url_rule('/ping', view_func=view, methods=['get'])
0052 return bp