def on_delete(self, req, res, transform_id):
     helpers.validate_authorization(req, self._default_authorized_roles)
     tenant_id = helpers.get_tenant_id(req)
     self._delete_transform(tenant_id, transform_id)
     transformed_event = message_formats_transforms.transform(transform_id,
                                                              tenant_id,
                                                              [])
     self._send_event(transformed_event)
     res.status = falcon.HTTP_204
 def on_post(self, req, res):
     helpers.validate_json_content_type(req)
     helpers.validate_authorization(req, self._default_authorized_roles)
     transform = helpers.read_http_resource(req)
     self._validate_transform(transform)
     transform_id = uuidutils.generate_uuid()
     tenant_id = helpers.get_tenant_id(req)
     self._create_transform(transform_id, tenant_id, transform)
     transformed_event = message_formats_transforms.transform(
         transform_id, tenant_id, transform)
     self._send_event(transformed_event)
     res.body = self._create_transform_response(transform_id, transform)
     res.status = falcon.HTTP_200