示例#1
0
def _get_param():
    request_message = _get_request_message(GetParam())
    response_message = GetParam.Response()
    parameter = _get_store().get_param(request_message.run_uuid, request_message.param_name)
    response_message.parameter.MergeFrom(parameter.to_proto())
    response = Response(mimetype='application/json')
    response.set_data(_message_to_json(response_message))
    return response
示例#2
0
def _get_param():
    request_message = _get_request_message(GetParam(), from_get=True)
    response_message = GetParam.Response()
    parameter = _get_store().get_param(request_message.run_uuid,
                                       request_message.param_name)
    response_message.parameter.MergeFrom(parameter.to_proto())
    response = Response(mimetype='application/json')
    response.set_data(
        MessageToJson(response_message, preserving_proto_field_name=True))
    return response
    def get_param(self, run_uuid, param_name):
        """
        Returns the value of the specified parameter.

        :param run_uuid: Unique identifier for run
        :param param_name: Parameter name within the run

        :return: Value of the given parameter if logged, else None
        """
        req_body = _message_to_json(GetParam(run_uuid=run_uuid, param_name=param_name))
        response_proto = self._call_endpoint(GetParam, req_body)
        return Param.from_proto(response_proto.parameter)