예제 #1
0
파일: contacts.py 프로젝트: ueg1990/surveil
    def put(self, data):
        """Create a new contact.

        :param data: a contact within the request body.
        """
        handler = contact_handler.ContactHandler(pecan.request)
        handler.create(data)
예제 #2
0
파일: contacts.py 프로젝트: ueg1990/surveil
 def get(self):
     """Returns a specific contact."""
     handler = contact_handler.ContactHandler(pecan.request)
     contact = handler.get({"contact_name": self._id})
     return contact
예제 #3
0
파일: contacts.py 프로젝트: ueg1990/surveil
 def put(self, contact):
     """Returns a specific contact."""
     handler = contact_handler.ContactHandler(pecan.request)
     handler.update({"contact_name": self._id}, contact)
예제 #4
0
파일: contacts.py 프로젝트: ueg1990/surveil
 def delete(self):
     """Returns a specific contact."""
     handler = contact_handler.ContactHandler(pecan.request)
     handler.delete({"contact_name": self._id})
예제 #5
0
파일: contacts.py 프로젝트: ueg1990/surveil
 def post(self, data):
     """Returns all contacts."""
     handler = contact_handler.ContactHandler(pecan.request)
     hosts = handler.get_all(data)
     return hosts
예제 #6
0
 def delete(self, contact_name):
     """Returns a specific contact."""
     handler = contact_handler.ContactHandler(pecan.request)
     handler.delete(contact_name)
예제 #7
0
 def get_one(self, contact_name):
     """Returns a specific contact."""
     handler = contact_handler.ContactHandler(pecan.request)
     contact = handler.get(contact_name)
     return contact
예제 #8
0
 def get_all(self):
     """Returns all hosts."""
     handler = contact_handler.ContactHandler(pecan.request)
     hosts = handler.get_all()
     return hosts