OCI Functions: scenarios Invoking Function from OCI Events with Incorrect Payload Structure
Can someone help me understand I've been struggling with this for a few days now and could really use some help... Quick question that's been bugging me - I keep running into I've looked through the documentation and I'm still confused about I'm relatively new to this, so bear with me..... I've searched everywhere and can't find a clear answer. I'm working on an Oracle Cloud Infrastructure (OCI) application where I need to trigger a function using OCI Events. However, I'm working with an scenario where the function fails to execute due to a payload structure mismatch. I've set up an event rule that listens for object creation events in an OCI Object Storage bucket, and I'm trying to pass metadata about the newly created object to my function. The function is supposed to receive a JSON payload, but I'm getting a `400 Bad Request` response when the event triggers. Here's the JSON payload that I'm constructing in the event rule: ```json { "data": { "objectName": "example.txt", "bucketName": "my-bucket", "size": 12345 }, "eventType": "com.oraclecloud.objectstorage.create", "time": "2023-10-10T12:00:00Z" } ``` In my function, I'm expecting the payload to look like this: ```json { "objectName": "example.txt", "bucketName": "my-bucket", "size": 12345 } ``` I've validated that the event rule is correctly set up and pointing to the right function. However, the additional `data` layer in the event payload seems to be causing the scenario. I've tried modifying the event rule to use a custom payload transformation, but I need to find any documentation on how to do that properly. Could someone guide me on how to adjust the event payload or the function's expected input format to resolve this scenario? I'm using the OCI SDK for Python version 3.2.0 for my function deployment, and my function is written in Python 3.8. Any insights on this would be greatly appreciated! For context: I'm using Python on macOS. Is there a better approach? The project is a service built with Python. Any ideas what could be causing this? What are your experiences with this? My team is using Python for this service. I'm open to any suggestions.