def get(self, type_name, environment_name, object_name): session_id = get_session_id(session, request) dao = ValueTypeDAO(session_id) found_vt = dao.get_value_type(type_name, environment_name, object_name) dao.close() resp = make_response(json_serialize(found_vt, session_id=session_id)) resp.headers["Content-Type"] = "application/json" return resp
def get(self, type_name, environment_name, object_name): session_id = get_session_id(session, request) dao = ValueTypeDAO(session_id) found_vt = dao.get_value_type(type_name, environment_name, object_name) dao.close() resp = make_response(json_serialize(found_vt, session_id=session_id)) resp.headers['Content-Type'] = "application/json" return resp
def delete(self, type_name, environment_name, object_name): session_id = get_session_id(session, request) dao = ValueTypeDAO(session_id) dao.delete_value_type(type_name, environment_name, object_name) dao.close() resp_dict = {"message": "Value Type successfully deleted"} resp = make_response(json_serialize(resp_dict), httplib.OK) resp.contenttype = "application/json" return resp
def get(self, type_name, environment_name): session_id = get_session_id(session, request) dao = ValueTypeDAO(session_id) if environment_name == "all": environment_name = "" vts = dao.get_value_types(type_name, environment_name) dao.close() resp = make_response(json_serialize(vts, session_id=session_id)) resp.headers["Content-Type"] = "application/json" return resp
def get(self, type_name, environment_name): session_id = get_session_id(session, request) dao = ValueTypeDAO(session_id) if environment_name == 'all': environment_name = '' vts = dao.get_value_types(type_name, environment_name) dao.close() resp = make_response(json_serialize(vts, session_id=session_id)) resp.headers['Content-Type'] = "application/json" return resp
def put(self, type_name, environment_name, object_name): session_id = get_session_id(session, request) dao = ValueTypeDAO(session_id) upd_vt = dao.from_json(request) dao.update_value_type(upd_vt, type_name, environment_name, object_name) dao.close() resp_dict = {'message': 'Value Type successfully updated'} resp = make_response(json_serialize(resp_dict), OK) resp.contenttype = 'application/json' return resp
def post(self): session_id = get_session_id(session, request) dao = ValueTypeDAO(session_id) new_vt = dao.from_json(request) dao.add_value_type(new_vt) dao.close() resp_dict = {'message': 'Value Type successfully added'} resp = make_response(json_serialize(resp_dict, session_id=session_id), OK) resp.contenttype = 'application/json' return resp
def delete(self, type_name, environment_name, object_name): session_id = get_session_id(session, request) dao = ValueTypeDAO(session_id) dao.delete_value_type(type_name, environment_name, object_name) dao.close() resp_dict = {'message': 'Value Type successfully deleted'} resp = make_response(json_serialize(resp_dict), httplib.OK) resp.contenttype = 'application/json' return resp
def post(self): session_id = get_session_id(session, request) dao = ValueTypeDAO(session_id) new_vt = dao.from_json(request) dao.add_value_type(new_vt) dao.close() resp_dict = {"message": "Value Type successfully added"} resp = make_response(json_serialize(resp_dict, session_id=session_id), httplib.OK) resp.contenttype = "application/json" return resp