Beispiel #1
0
 def post(self, jobId="000000100000011"):
     """
     SIP post handler.
     :param jobId:
     :return:
     """
     inputs = rest_validation.parse_inputs(request.json)
     print("ScreenipPost")
     if inputs:
         return rest_model_caller.model_run(self.name, jobId, inputs, module=screenip)
     else:
         return rest_model_caller.error(self.name, jobId, inputs)
Beispiel #2
0
    def post(self, jobId="000000100000011"):
        """
        Exponential post handler.
        :param jobId:
        :return:
        """
        inputs = rest_validation.parse_inputs(request.json)

        if inputs:
            return rest_model_caller.model_run(self.name, jobId, inputs, module=exponential)
        else:
            return rest_model_caller.error(self.name, jobId, inputs)
Beispiel #3
0
    def post(self, jobId="000000100000011"):
        """
        Varroapop post handler.
        :param jobId:
        :return:
        """
        inputs = rest_validation.parse_inputs(request.json)

        if inputs:
            data = rest_model_caller.model_run(self.name, jobId, inputs, module=varroapop)
            return jsonify(**data)
        else:
            return rest_model_caller.error(self.name, jobId, inputs)
Beispiel #4
0
    def post(self, jobId="000000100000011"):
        """
        LeslieProbit post handler.
        :param jobId:
        :return:
        """
        inputs = rest_validation.parse_inputs(request.json)

        if inputs:
            return rest_model_caller.model_run(self.name,
                                               jobId,
                                               inputs,
                                               module=leslie_probit)
        else:
            return rest_model_caller.error(self.name, jobId, inputs)
Beispiel #5
0
    def post(self, jobId="000000100000011"):
        """
        SAM post handler.
        :param jobId:
        :return:
        """

        inputs = rest_validation.parse_inputs(request.json)

        if inputs:
            # return rest_model_caller.model_run(self.name, jobId, inputs, module=sam)
            tasks.sam_run(jobId, request.json)
            return
        else:
            return rest_model_caller.error(self.name, jobId, inputs)
Beispiel #6
0
    def post(self, jobId="000000100000011"):
        """
        Agdrift post handler.
        :param jobId:
        :return:
        """

        inputs = rest_validation.parse_inputs(request.json)


        if inputs:
            data = rest_model_caller.model_run(self.name, jobId, inputs, module=agdrift)
            mongo_db_dict = {"jobid": jobId, "inputs": inputs, "outputs": data}
            self.insert_into_db(mongo_db_dict)

            return jsonify(**data)
        else:
            return rest_model_caller.error(self.name, jobId, inputs)