Configure event subscriptions for service usage requests and approvals
Compute Nest integrates with CloudMonitor to notify you when users submit service usage requests or when requests are approved or rejected. This topic explains how to create a subscription policy, set up notification channels, understand the event payload structure, and process notifications in your downstream systems.
Prerequisites
Before you begin, ensure that you have:
A Compute Nest service published and available for usage requests
Access to the CloudMonitor console
How it works
Two events are available for subscription:
| Event | Triggered when | Additional fields in payload |
|---|---|---|
UserCreateServiceUsageRequest | A user submits a service usage request | — |
| Service usage request approval | An admin approves or rejects a request | status, comments |
Both events include serviceId, serviceName, and userId in the payload. When an event fires, CloudMonitor delivers a notification to the channels you configure — SMS, email, Webhook, and others.
Create a subscription policy
Log on to the CloudMonitor console.
In the left navigation pane, choose Event Hub > Event Subscription.
Click Create Subscription Policy.
Enter the basic information:
Name: Enter a descriptive name, such as
Compute Nest Service Usage Request Event.Description: (Optional) Enter a description for the policy.
Configure the event subscription:
Subscription Type: Select System Event.
Product: Select Compute Nest.
Event Type: Select Business.
Event Name: Select the events to monitor, such as
UserCreateServiceUsageRequest.
(Optional) Configure noise reduction to avoid duplicate notifications:
Merge content: Merge notifications by service ID or user ID to group related events.
Mode: Select Trigger immediately and suppress subsequent notifications to prevent duplicate alerts for the same event.
Set up notification channels
After creating the subscription policy, configure how CloudMonitor delivers notifications.
In the notification area, click Create Notification Configuration.
Enter a notification configuration name, and set Notification Settings to Directly Set Notification Group.
Select an existing contact group or create one.
Choose one or more notification channels:
Channel Description SMS Notification Sends a text message to the contact's mobile phone number Email Notification Sends a message to the contact's email address Phone Notification Makes a voice call to the contact DingTalk Robot Sends a message to a DingTalk group Webhook Sends an HTTP POST request to your endpoint Message Queue Pushes a message to a Message Service (MNS) queue (Optional) Customize the notification content by selecting a notification template. CloudMonitor templates use Go template syntax, which lets you insert event content variables. For details, see Configure notification templates and Webhook templates and Manage notification templates.
Event payload structure
Each event delivers a JSON payload. The following sections describe the payload for each event type.
Service usage request created
{
"serviceId": "service-xxx",
"serviceName": {
"zh-CN": "Compute Nest Service",
"en-US": "Compute Nest Service"
},
"userId": "12550494"
}Service usage request approved or rejected
The approval event includes a status field and a comments field. When the request is rejected, comments contains the reason for rejection.
{
"serviceId": "service-xxx",
"serviceName": {
"zh-CN": "Compute Nest Service",
"en-US": "Compute Nest Service"
},
"userId": "12550494",
"status": "Approved",
"comments": "Approved"
}Field reference
| Field | Description | Example |
|---|---|---|
serviceId | Unique identifier of the service | service-xxx |
serviceName | Service name as a multilingual JSON object | {"zh-CN": "...", "en-US": "..."} |
userId | Alibaba Cloud account UID of the user who submitted the request | 12550494 |
status | Approval result. Possible values: Approved, Rejected | Rejected |
comments | Approval note. For rejected requests, this field contains the reason | Reason for rejection: xxx |
Verify the configuration
Test your setup before relying on it in production.
On the subscription policy page, click Debug Event Subscription.
Set Product to Compute Nest and select the event to test, such as
UserCreateServiceUsageRequest.The console generates sample JSON content automatically.
Click OK to send the test notification.
Verify delivery through your configured channels:
Check that the contact received the SMS or email.
Confirm that your Webhook endpoint received the POST request.
Check that the test message appeared in the MNS queue.
FAQ
Why am I not receiving event notifications?
Check the following:
The subscription policy is enabled.
The contact group contains valid contacts with correct phone numbers or email addresses.
The event filter conditions match the events you expect to receive.
The notification channel is configured correctly.
How do I filter notifications to a specific service?
In the Event Content field of the subscription policy, enter the service ID (for example, service-xxx). Only events from that service trigger notifications.
How long does it take to receive a notification after an event occurs?
Notifications typically arrive within 1 to 3 minutes.