示例#1
0
 def on_post(self, req, res):
     helpers.validate_authorization(req, self._post_events_authorized_roles)
     helpers.validate_json_content_type(req)
     event = helpers.read_http_resource(req)
     self._validate_event(event)
     tenant_id = helpers.get_tenant_id(req)
     transformed_event = message_format_events.transform(event, tenant_id, self._region)
     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