This document describes how to use SCF to back up task callbacks generated by MPS to COS. SCF is mainly used to process callback information, MPS is mainly used for video processing tasks, and COS mainly provides persistent storage capabilities.
- Log in to the SCF console and select Function Service on the left sidebar.
- At the top of the Function Service page, select the Beijing region and click Create to enter the function creation page and configure the following parameters:
- Function name: enter "MPSToCOS".
- Runtime environment: select "Python 2.7".
- Creation method: select Function Template.
- Fuzzy search: enter "MPS_SCF_COS" and search.
Click Learn More in the template to view or download relevant information in the Template Details pop-up window.
- After configuring the basic information, click Next to enter the function configuration page.
- Keep the default function configuration and click Complete.
Configuring MPS trigger
- After completing the Creating function step above, you will be redirected to the function management page by default.
- On the left sidebar, select Trigger Management to enter the Trigger Management page.
- Click Create a Trigger and add the created MPS trigger in the Create a Trigger pop-up window.
The main parameter information is as follows. Keep the remaining configuration items as default:
- Event type: an MPS trigger pushes events in the account-level event type. Currently, two event types are supported: workflow task (
WorkflowTask) and video editing task (
- When creating an MPS trigger for the first time, you need to click SCF_QcsRole and MPS_QcsRole to authorize the relevant service role.
- An MPS trigger uses events generated at the service level as the event source, regardless of attributes such as region and resources. Only one single function can be bound to each event type for each account. If you need multiple functions to handle a task, please see SDK for Node.js.
- Click Submit.
- Log in to the MPS console and execute a video processing workflow.
- On the Function Service page in the SCF console, click the name of the function created in the Creating function step above to enter the function details page.
- Select the Log Query tab on the function details page to view the printed log information.
- Log in to the COS console to view the data dumping and processing result.
You can write specific data processing methods as needed.