Configure event subscriptions for service usage requests and approvals

Updated at:

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:

How it works

Two events are available for subscription:

EventTriggered whenAdditional fields in payload
UserCreateServiceUsageRequestA user submits a service usage request
Service usage request approvalAn admin approves or rejects a requeststatus, 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

  1. Log on to the CloudMonitor console.

  2. In the left navigation pane, choose Event Hub > Event Subscription.

  3. Click Create Subscription Policy.

  4. 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.

  5. 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.

  6. (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.

  1. In the notification area, click Create Notification Configuration.

  2. Enter a notification configuration name, and set Notification Settings to Directly Set Notification Group.

  3. Select an existing contact group or create one.

  4. Choose one or more notification channels:

    ChannelDescription
    SMS NotificationSends a text message to the contact's mobile phone number
    Email NotificationSends a message to the contact's email address
    Phone NotificationMakes a voice call to the contact
    DingTalk RobotSends a message to a DingTalk group
    WebhookSends an HTTP POST request to your endpoint
    Message QueuePushes a message to a Message Service (MNS) queue
  5. (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

FieldDescriptionExample
serviceIdUnique identifier of the serviceservice-xxx
serviceNameService name as a multilingual JSON object{"zh-CN": "...", "en-US": "..."}
userIdAlibaba Cloud account UID of the user who submitted the request12550494
statusApproval result. Possible values: Approved, RejectedRejected
commentsApproval note. For rejected requests, this field contains the reasonReason for rejection: xxx

Verify the configuration

Test your setup before relying on it in production.

  1. On the subscription policy page, click Debug Event Subscription.

  2. Set Product to Compute Nest and select the event to test, such as UserCreateServiceUsageRequest.

  3. The console generates sample JSON content automatically.

  4. Click OK to send the test notification.

  5. 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.

Related topics