Manage service instance lifecycle events
In the CloudMonitor console, you can subscribe to system events for service instances, such as creation, renewal, and deletion. After you create a subscription, you can manage the lifecycle events of user-created service instances. This topic shows you how.
View service instance lifecycle events
Before you subscribe to system events, you can only view service instance lifecycle events on the Event Monitoring page.
-
Log on to the CloudMonitor console.
-
In the left-side navigation pane, choose .
-
On the Event Monitoring tab, set filter conditions to view events for service instances.
-
In the All Products field, enter ComputeNest.
-
In the Please select the event name field, select the desired event name. In this example, select UserServiceInstanceCreated.
-
Set the time range for your query.
You can select a predefined range, such as 1 hour, 6 hours, 1 day, 3 days, or 7 days, or you can specify a custom time range. You can query data from the last 90 days, with a maximum continuous query range of 3 days.
-
Click Search.
Filtered events appear in a list at the bottom of the page. The list includes columns such as Time, Product Name, Event Name, Level, region, resource, and Content. To view details for an event, click Details in the event's row.
-
-
In the event list, find the desired event and click Details in the Actions column. The Event Details dialog box appears, showing detailed information about the event.
The event details are displayed in JSON format. In addition to the business fields within the Content object, the JSON object includes top-level fields such as Name (the event name, for example,
UserServiceInstanceCreated), Product (the product name), Status, Level, Time (the timestamp), RegionId (the region ID), and GroupId.The
Contentfield contains the primary business data for the event.Parameter
Description
serviceId
The service ID.
serviceVersion
The service version.
serviceType
The service type. Valid values:
-
private: a privately deployed service.
-
managed: a fully managed service.
-
operation: a hosted O&M service.
-
poc: a trial service.
userId
The user ID.
serviceInstanceId
The service instance ID.
expiredTime
The expiration time of the service instance.
-
Subscribe to system events
To manage the lifecycle events of service instances, you need to subscribe to system events in CloudMonitor. For example, this section explains how to subscribe to the "Failed to deploy a service instance" system event.
-
Log on to the CloudMonitor console.
-
In the left-side navigation pane, choose .
-
On the Event Subscription page, click Create a subscription policy and configure the required settings.
This section describes only the required subscription settings. For more information about the parameters, see Manage event subscriptions (Recommended).
-
For Name, enter an easy-to-identify policy name, such as "Notification for failed service instance deployments".
-
Set Subscription Type to System Event. In the Subscription Scope section, select the desired Product and Event Name.
-
Configure a notification method. Ensure that you have configured a notification policy in advance.
In the Notification step, use the Custom Notification Methods table to set the Notification Template and alarm level (such as CRITICAL or WARNING) for each channel, such as phone, SMS messages, email, DingTalk, Lark, WeCom, and Slack. You can also configure notification channels in the Push and Integrations section.
-
You can also push event notifications to services such as Simple Message Queue (formerly MNS) queues, Function Compute, URL callbacks, and Simple Log Service (SLS).
In the Push and Integrations section, in the notification channel area, click + Add Channel to add a notification channel.
-
Click Submit. The subscription is created successfully.
After you subscribe to system events for a service instance, you will receive a notification when a matching event is triggered. You can then manage the service instance based on the event's content.