Example #1
0
 def get_hn():
     """
     Triggers the creation of a Heuristic net.
     ---
     parameters:
       - name: approach
         in: query
         type: string
         default: ''
         example: 'embedded'
         description: the approach the data used for creating the net
                      should be limited to
       - name: method_type
         in: query
         type: string
         default: ''
         example: 'get_transactions'
         description: the method type the data used for creating the net
                      should be limited to
       - name: error_type
         in: query
         type: string
         default: ''
         example: 'error_service_unavailable'
         description: the error type the data used for creating the net
                      should be limited to
       - name: bank
         in: query
         type: string
         default: ''
         example: 'ADORSYS'
         description: the bank the data used for creating the net
                      should be limited to
       - name: format
         in: query
         type: string
         default: 'svg'
     responses:
       200:
         description: The result will contain a base64 encoded DataURI
                      representing the generated net.
         schema:
           $ref: '#/definitions/RequestResponse'
     """
     approach, bank, error_type, method_type = _get_filter_parameters()
     output_format = _get_unescaped_parameter('format', 'svg')
     ticket = request_manager.submit_ticketed(_create_heuristic_net,
                                              approach, method_type,
                                              error_type, bank,
                                              output_format)
     return get_state_response(ticket)
 def get_approach_count():
     """
     Computes which approach types are present in the available data and how
     many sessions each of them was used in.
     ---
     response:
       200:
         description: The retrieved result will be a JSON object
                      representing the number of sessions each approach was
                      used in.
         application/json:
           schema:
             $ref: '#/definitions/RequestResponse'
     """
     ticket = request_manager.submit_ticketed(_get_approach_type_counts)
     return get_state_response(ticket)
 def get_method_count():
     """
     Triggers calculation of number of method types per approach.
     ---
     response:
       200:
         description: The retrieved result will be a JSON object
                      representing the number of different method types per
                      approach.
         application/json:
           schema:
             $ref: '#/definitions/RequestResponse'
     """
     ticket = request_manager.submit_ticketed(
         _get_method_types_per_approach)
     return get_state_response(ticket)
Example #4
0
 def refresh():
     """
     Triggers the retrieval of logs from Graylog.
     ---
     parameters:
       - name: force
         in: query
         type: boolean
         default: 'False'
         description: force retrieval of logs that were already downloaded
     responses:
       200:
         description: The result will not contain any value after retrieval.
         application/json:
           schema:
             $ref: '#/definitions/RequestResponse'
     """
     force = request.args.get('force', False, strtobool)
     ticket = executor.submit_ticketed(_refresh_logs, force)
     return get_state_response(ticket)