示例#1
0
    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
 def get(self):
     """Returns a specific contact."""
     handler = contact_handler.ContactHandler(pecan.request)
     contact = handler.get({"contact_name": self._id})
     return contact
示例#3
0
 def put(self, contact):
     """Returns a specific contact."""
     handler = contact_handler.ContactHandler(pecan.request)
     handler.update({"contact_name": self._id}, contact)
示例#4
0
 def delete(self):
     """Returns a specific contact."""
     handler = contact_handler.ContactHandler(pecan.request)
     handler.delete({"contact_name": self._id})
示例#5
0
 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