Event Notifications
You can configure event notifications before submitting a media processing task. Once the task is executed, you will receive notifications on the event you subscribe to. This function depends on the SMN service. Therefore, SMN charges you based on the number of notification messages. For details about the price, see SMN Pricing Details.
Creating an SMN Topic
- Log in to the SMN console.
- In the navigation pane on the left, choose Topic Management > Topics.
- Click Create Topic in the upper right corner.
The Create Topic dialog box is displayed. Table 1 describes the required parameters.
Table 1 Topic parameters Parameter
Description
Topic Name
Specifies the topic name, which
- Contains only letters, digits, hyphens (-), and underscores (_), and must start with a letter or digit.
- Contains 1 to 255 characters.
- Must be unique and cannot be modified after the topic is created.
Display Name
This parameter is optional. When sending an email:
- If the display name is not specified, the sender is displayed as username@example.com.
- If the display name is specified, the email sender is presented as Display name<username@example.com>.
Enterprise Project
Centrally manages cloud resources and members by project.
Tag
Specifies a key-value pair. Tags identify cloud resources so that you can easily categorize and search for your resources.
- Click OK.
- Click Add Subscription in the Operation column of the new topic. The Add Subscription dialog box is displayed.
Configure the subscription protocol and endpoints based on Table 2.
Table 2 Subscription parameters Parameter
Description
Topic Name
Name of the topic to be subscribed to. Retain the default value.
Protocol
Message notification method. Select a protocol from the drop-down list.
The common protocols used by MPC are SMS, Email, HTTP, and HTTPS.
Endpoint
Specifies the IP address of a subscription endpoint. You can enter up to 10 SMS, email, HTTP, or HTTPS endpoints, one in each line.
- SMS: Enter one or more valid phone numbers.
The format is + country code phone number, for example, +8600000000000.
Subscribers will receive a subscription confirmation message valid for 48 hours and must confirm the subscription to receive messages published to the topic.
- Email: Enter one or more valid email addresses, for example, username@example.com.
Subscribers will receive a subscription confirmation email valid for 48 hours and must confirm the subscription to receive messages published to the topic.
- If you select HTTP or HTTPS, enter a public network address and confirm the subscription, for example, https://example.com/notification/action.
HTTPS is recommended, as it is more secure than HTTP.
- SMS: Enter one or more valid phone numbers.
- Click OK to add a subscription. You can view the subscription on Topic Management > Subscriptions.
After the subscription is added, the configured subscription endpoint will receive a subscription confirmation message. The subscription confirmation link is valid for 48 hours. You need to confirm the subscription within the validity period so that you can receive messages published to the topic.
Configuring a Topic Policy
- Go to the SMN console.
- In the navigation pane on the left, choose Topic Management > Topics.
- Choose More > Configure Topic Policy in the Operation column of the created topic.
On the displayed page, configure a topic policy in basic mode. The basic mode simply specifies which users or cloud services have permissions to publish messages to the topic. For details, see Table 3.
Table 3 Description for configuring topic policies in basic mode Parameter
Settings
Description
Users who can publish messages to this topic
Topic creator
Only users under the same account as the topic creator have the permissions to publish messages to this topic.
All users
All users have the permissions to publish messages to the topic.
Specified user accounts
Only specified users have the permissions to publish messages to the topic.
Users are specified in the format of urn:csp:iam::domainId:root, in which domainId indicates the account ID of a user.
Every two users are separated with a comma (,). SMN does not limit the number of users you can specify, but the total length of a topic policy cannot exceed 30 KB.NOTE:- You only need to enter the account ID of the user and click OK. The system supplements all other required information for you.
- To obtain a user's account ID, log in to the SMN console, hover the mouse cursor over the username in the upper right corner and choose My Credentials from the drop-down list.
Services that can publish messages to this topic
An example is MPC.
The services that can publish messages to a topic vary depending on regions.
Select MPC. MPC has the permissions to access the topic.
Configuring Event Notifications
- Log in to the MPC console.
- In the navigation pane, choose Global Settings > Event Notifications.
Figure 1 Event notifications
- Select one or more events.
Table 4 describes the subscription events.
Table 4 Subscription events Subscription event
Description
Transcoding completed
After a transcoding task is complete on the console or by calling the media transcoding API, an SMN notification message is sent.
Transcoding started
After a transcoding task is started on the console or by calling the media transcoding API, an SMN notification message is sent.
NOTICE:If the audio or video transcoding duration is less than 1 minute, no transcoding start message is sent, and only a transcoding completion message is sent.
Snapshot captured
After a snapshot is captured by calling the snapshot capturing API, an SMN notification message is sent.
Packaging completed
After a packaging task is completed on the console or by calling the packaging API, an SMN notification message is sent.
GIF created
After a GIF is generated on the console or by calling the GIF creation API, an SMN notification message is sent.
Attribute parsing completed
After a video is parsed by calling the video parsing API, an SMN notification message is sent.
Edit completed
After a video is edited by calling the video editing API, an SMN notification message is sent.
This function is available upon request after you submit a service ticket.
- Select one or more message types.
Template Message Body describes a template message body. JSON Message Body describes the fields in a JSON message body.
If both Template message and JSON message are selected, you will:
- Receive template messages via SMS and email.
- Receive Json messages via HTTP and HTTPS.
- Select an SMN topic.
- Click OK.
Template Message Body
Template messages are preset by MPC.
- Template message for transcoding started
Dear user, your video transcoding task (task ID: {task_id}) has been started. Log in to the MPC console or call the transcoding API to obtain transcoding details. - Template message for a successful transcoding, snapshot, packaging, and animated GIF task
Dear user, your video {transcoding/snapshot/packaging/animated GIF} task (task ID: {task_id}) has been completed. Log in to the MPC console or call the transcoding API to obtain details. - Template message for a failed transcoding, snapshot, packaging, and animated GIF task
Dear user, an error occurs when processing your video {transcoding/snapshot/packaging/animated GIF} task (task ID: {task_id}). Error code: {err_code}. Error information: {err_msg}.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot