def put(self, id):
        """**Update an EventType**

        **Example Request:**

        .. sourcecode:: http

            PUT /api/v1/eventtypes/1/ HTTP/1.1
            Host: localhost
            Content-Type: application/json

            {
                "description": "New description",
            }

        **Example response:**

        .. sourcecode:: http

            HTTP/1.1 200 OK
            Content-Type: application/json

            {
                "status": "ok",
                "id": 1,
                "href": "/api/v1/eventtypes/1",
                "category": "system-reboot",
                "state": "required",
                "description": "New description",
            }

        :param id: id of the EventType that should be updated.
        :type id: string

        :reqjson string description: The new description of the EventType.

        :reqheader Content-Type: The server expects a json body specified with
                                 this header.

        :statuscode 200: The request was successful.
        :statuscode 400: The request was malformed.
        :statuscode 401: The request was made without being logged in.
        :statuscode 403: The request was made with insufficient permissions.
        :statuscode 404: The EventType was not found.
        :statuscode 409: There was a conflict with another resource.
        """

        log.info("EVENTTYPE: Updating {}".format(id))

        event_type = (
            self.session.query(EventType).filter_by(id=id).scalar()
        )
        if not event_type:
            raise exc.NotFound("No such EventType {} found".format(id))

        try:
            description = self.jbody["description"]
        except __HOLE__ as err:
            raise exc.BadRequest(
                "Missing Required Argument: {}".format(err.message)
            )

        try:
            event_type.update(
                description=description,
            )
        except IntegrityError as err:
            raise exc.Conflict(str(err.orig))

        json = event_type.to_dict(self.href_prefix)

        self.success(json)

        log.info("EVENTTYPE: Updated {} with desc {}".format(id, description))
dataset/ETHPy150Open dropbox/hermes/hermes/handlers/api.py/EventTypeHandler.put