Example #1
0
 def get(self,environment_name,head_name,tail_name):
   session_id = get_session_id(session, request)
   dao = AssetAssociationDAO(session_id)
   assoc = dao.get_asset_association(environment_name,head_name,tail_name)
   dao.close()
   resp = make_response(json_serialize(assoc, session_id=session_id))
   resp.headers['Content-Type'] = "application/json"
   return resp
Example #2
0
    def get(self):
        session_id = get_session_id(session, request)

        dao = AssetAssociationDAO(session_id)
        assocs = dao.get_asset_associations()
        dao.close()
        resp = make_response(json_serialize(assocs, session_id=session_id))
        resp.headers['Content-Type'] = "application/json"
        return resp
Example #3
0
 def get(self, environment_name, head_name, tail_name):
     session_id = get_session_id(session, request)
     dao = AssetAssociationDAO(session_id)
     assoc = dao.get_asset_association(environment_name, head_name,
                                       tail_name)
     dao.close()
     resp = make_response(json_serialize(assoc, session_id=session_id))
     resp.headers['Content-Type'] = "application/json"
     return resp
Example #4
0
  def get(self):
    session_id = get_session_id(session, request)

    dao = AssetAssociationDAO(session_id)
    assocs = dao.get_asset_associations()
    dao.close()
    resp = make_response(json_serialize(assocs, session_id=session_id))
    resp.headers['Content-Type'] = "application/json"
    return resp
Example #5
0
    def delete(self, environment_name, head_name, tail_name):
        session_id = get_session_id(session, request)
        dao = AssetAssociationDAO(session_id)
        dao.delete_asset_association(environment_name, head_name, tail_name)
        dao.close()

        resp_dict = {"message": "Asset Association successfully deleted"}
        resp = make_response(json_serialize(resp_dict), httplib.OK)
        resp.contenttype = "application/json"
        return resp
Example #6
0
 def put(self, environment_name, head_name, tail_name):
     session_id = get_session_id(session, request)
     dao = AssetAssociationDAO(session_id)
     assoc = dao.from_json(request)
     dao.update_asset_association(environment_name, head_name, tail_name,
                                  assoc)
     dao.close()
     resp_dict = {'message': 'Asset Association successfully updated'}
     resp = make_response(json_serialize(resp_dict), OK)
     resp.contenttype = 'application/json'
     return resp
Example #7
0
    def post(self):
        session_id = get_session_id(session, request)

        dao = AssetAssociationDAO(session_id)
        assoc = dao.from_json(request)
        dao.add_asset_association(assoc)
        dao.close()

        resp_dict = {'message': 'Asset Association successfully added'}
        resp = make_response(json_serialize(resp_dict), OK)
        resp.contenttype = 'application/json'
        return resp
Example #8
0
 def put(self,environment_name,head_name,tail_name):
   session_id = get_session_id(session, request)
   dao = AssetAssociationDAO(session_id)
   assoc = dao.from_json(request)
   dao.update_asset_association(environment_name,head_name,tail_name,assoc)
   dao.close()
   resp_dict = {'message': 'Asset Association successfully updated'}
   resp = make_response(json_serialize(resp_dict), OK)
   resp.contenttype = 'application/json'
   return resp
Example #9
0
    def delete(self, environment_name, head_name, tail_name):
        session_id = get_session_id(session, request)
        dao = AssetAssociationDAO(session_id)
        dao.delete_asset_association(environment_name, head_name, tail_name)
        dao.close()

        resp_dict = {'message': 'Asset Association successfully deleted'}
        resp = make_response(json_serialize(resp_dict), httplib.OK)
        resp.contenttype = 'application/json'
        return resp
Example #10
0
    def put(self):
        session_id = get_session_id(session, request)
        dao = AssetAssociationDAO(session_id)
        assoc = dao.from_json(request)
        dao.update_asset_association(assoc)
        dao.close()

        resp_dict = {"message": "Asset Association successfully updated"}
        resp = make_response(json_serialize(resp_dict), httplib.OK)
        resp.contenttype = "application/json"
        return resp
Example #11
0
  def post(self):
    session_id = get_session_id(session, request)

    dao = AssetAssociationDAO(session_id)
    assoc = dao.from_json(request)
    dao.add_asset_association(assoc)
    dao.close()

    resp_dict = {'message': 'Asset Association successfully added'}
    resp = make_response(json_serialize(resp_dict), OK)
    resp.contenttype = 'application/json'
    return resp