After you define a function, you must debug it to verify the correctness of its code. When an Object Storage Service (OSS) event occurs, the function will be automatically triggered. This topic describes how to debug a function by simulating an OSS event in the Function Compute console.
An OSS event source is passed to the function as an input parameter in the form of event. You can pass event to the function to simulate the OSS event to trigger the function and test whether the code of the function is correct.
- Log on to the Function Compute console.
- In the top navigation bar, select a region.
- In the left-side navigation pane, click Service/Function.
- Find the required function in the required service and click the name of the function.
- On the Code tab, click Event.
- Write an event in the code editor based on the corresponding event format. For more information, see Event format.. Then click OK.
- On the Code tab, click Invoke.