Exemplo n.º 1
0
    def put(self):
        session_id = get_session_id(session, request)
        dao = RequirementDAO(session_id)
        req = dao.from_json(request)
        dao.update_requirement(req, req_id=req.theId)
        dao.close()

        resp_dict = {'message': 'Requirement successfully updated'}
        resp = make_response(json_serialize(resp_dict), httplib.OK)
        resp.headers['Content-type'] = 'application/json'
        return resp
Exemplo n.º 2
0
    def put(self, name):
        session_id = get_session_id(session, request)
        dao = RequirementDAO(session_id)
        req = dao.from_json(request)
        dao.update_requirement(req, name=name)
        dao.close()

        resp_dict = {'message': 'Requirement successfully updated'}
        resp = make_response(json_serialize(resp_dict), OK)
        resp.headers['Content-type'] = 'application/json'
        return resp
Exemplo n.º 3
0
    def post(self):
        session_id = get_session_id(session, request)
        asset_name = request.args.get('asset', None)
        environment_name = request.args.get('environment', None)

        dao = RequirementDAO(session_id)
        new_req = dao.from_json(request)
        req_id = dao.add_requirement(new_req, asset_name=asset_name, environment_name=environment_name)
        dao.close()

        resp_dict = {'message': 'Requirement successfully added', 'requirement_id': req_id}
        resp = make_response(json_serialize(resp_dict), httplib.OK)
        resp.contenttype = 'application/json'
        return resp
Exemplo n.º 4
0
  def post(self):
    session_id = get_session_id(session, request)
    asset_name = request.args.get('asset', None)
    environment_name = request.args.get('environment', None)

    dao = RequirementDAO(session_id)
    new_req = dao.from_json(request)
    req_id = dao.add_requirement(new_req, asset_name=asset_name, environment_name=environment_name)
    dao.close()

    resp_dict = {'message': 'Requirement successfully added', 'requirement_id': req_id}
    resp = make_response(json_serialize(resp_dict), httplib.OK)
    resp.contenttype = 'application/json'
    return resp
Exemplo n.º 5
0
    def post(self):
        session_id = get_session_id(session, request)
        asset_name = request.args.get('asset', None)
        environment_name = request.args.get('environment', None)
        dao = RequirementDAO(session_id)

        domain_name = asset_name
        if (environment_name != None):
            domain_name = environment_name

        new_req = dao.from_json(request, domain_name)
        dao.add_requirement(new_req,
                            asset_name=asset_name,
                            environment_name=environment_name)
        dao.close()

        resp_dict = {'message': new_req.name() + ' created'}
        resp = make_response(json_serialize(resp_dict), OK)
        resp.contenttype = 'application/json'
        return resp