Пример #1
0
    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
Пример #2
0
    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
Пример #3
0
    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
Пример #4
0
    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
Пример #5
0
    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
Пример #6
0
    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
Пример #7
0
    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
Пример #8
0
  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
Пример #9
0
    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
Пример #10
0
    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