def get(self, environment_name): session_id = get_session_id(session, request) dao = TraceDAO(session_id) trs = dao.get_traces(environment_name) dao.close() resp = make_response(json_serialize(trs, session_id=session_id)) resp.headers['Content-Type'] = "application/json" return resp
def get(self,environment_name): session_id = get_session_id(session, request) dao = TraceDAO(session_id) trs = dao.get_traces(environment_name) dao.close() resp = make_response(json_serialize(trs, session_id=session_id)) resp.headers['Content-Type'] = "application/json" return resp
def delete(self, from_object,from_name,to_object,to_name): session_id = get_session_id(session, request) dao = TraceDAO(session_id) dao.delete_trace(from_object,from_name,to_object,to_name) dao.close() resp_dict = {'message': 'Trace successfully deleted'} resp = make_response(json_serialize(resp_dict), OK) resp.contenttype = 'application/json' return resp
def get(self, dimension_name,is_from): session_id = get_session_id(session, request) dao = TraceDAO(session_id) if is_from == '1': is_from = True else: is_from = False dims = dao.trace_dimensions(dimension_name,is_from) dao.close() resp = make_response(json_serialize(dims, session_id=session_id), OK) resp.headers['Content-type'] = 'application/json' return resp
def post(self): session_id = get_session_id(session, request) dao = TraceDAO(session_id) new_tr = dao.from_json(request) dao.add_trace(new_tr) dao.close() resp_dict = {'message': 'Trace successfully added'} resp = make_response(json_serialize(resp_dict, session_id=session_id), OK) resp.contenttype = 'application/json' return resp
def delete(self, from_object, from_name, to_object, to_name): session_id = get_session_id(session, request) dao = TraceDAO(session_id) dao.delete_trace(from_object, from_name, to_object, to_name) dao.close() resp_dict = {'message': 'Trace successfully deleted'} resp = make_response(json_serialize(resp_dict), httplib.OK) resp.contenttype = 'application/json' return resp