예제 #1
0
 def get(self):
     """
     ---
     summary: List
     description: List all heartbeats.
     tags:
       - Heartbeat
     responses:
       200:
         description: OK
         content:
           application/json:
             schema:
               type: array
               items:
                 type: object
                 description: List of tuples [('Executable', 'Hostname', ...), ...]
       401:
         description: Invalid Auth Token
       406:
         description: Not acceptable
     """
     return Response(json.dumps(
         list_heartbeats(issuer=request.environ.get('issuer'),
                         vo=request.environ.get('vo')),
         cls=APIEncoder),
                     content_type='application/json')
예제 #2
0
    def get(self):
        """
        List all heartbeats.

        .. :quickref: Heartbeat; List heartbeats.

        :resheader Content-Type: application/json
        :status 200: OK.
        :status 401: Invalid Auth Token.
        :status 406: Not Acceptable.
        :returns: List of heartbeats.
        """
        return Response(json.dumps(list_heartbeats(issuer=request.environ.get('issuer'), vo=request.environ.get('vo')), cls=APIEncoder), content_type='application/json')
예제 #3
0
    def GET(self):
        """
        List all heartbeats.

        HTTP Success:
            200 OK

        HTTP Error:
            401 Unauthorized
        """

        header('Content-Type', 'application/json')

        return json.dumps(list_heartbeats(issuer=ctx.env.get('issuer')),
                          cls=APIEncoder)
예제 #4
0
파일: heartbeat.py 프로젝트: ddavila0/rucio
    def get(self):
        """
        List all heartbeats.

        .. :quickref: Heartbeat; List heartbeats.

        :resheader Content-Type: application/json
        :status 200: OK.
        :status 401: Invalid Auth Token.
        :status 406: Not Acceptable.
        :returns: List of heartbeats.
        """
        try:
            return Response(json.dumps(list_heartbeats(
                issuer=request.environ.get('issuer'),
                vo=request.environ.get('vo')),
                                       cls=APIEncoder),
                            content_type='application/json')
        except RucioException as error:
            return generate_http_error_flask(500, error.__class__.__name__,
                                             error.args[0])
        except Exception as error:
            print(format_exc())
            return str(error), 500