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)
def get(self): """Returns a specific contact.""" handler = contact_handler.ContactHandler(pecan.request) contact = handler.get({"contact_name": self._id}) return contact
def put(self, contact): """Returns a specific contact.""" handler = contact_handler.ContactHandler(pecan.request) handler.update({"contact_name": self._id}, contact)
def delete(self): """Returns a specific contact.""" handler = contact_handler.ContactHandler(pecan.request) handler.delete({"contact_name": self._id})
def post(self, data): """Returns all contacts.""" handler = contact_handler.ContactHandler(pecan.request) hosts = handler.get_all(data) return hosts
def delete(self, contact_name): """Returns a specific contact.""" handler = contact_handler.ContactHandler(pecan.request) handler.delete(contact_name)
def get_one(self, contact_name): """Returns a specific contact.""" handler = contact_handler.ContactHandler(pecan.request) contact = handler.get(contact_name) return contact
def get_all(self): """Returns all hosts.""" handler = contact_handler.ContactHandler(pecan.request) hosts = handler.get_all() return hosts