Last week the VMware Cloud team released one of the highly requested feature which is the ability to control notification preferences for an individual user, which is provided as part of the VMware Cloud Notification Gateway (NGW) service. Users can now login to the VMware Cloud Console (VMC UI) and on left hand side, you should now see a new Notification Preferences tab which will allow you to specify which notifications you wish to receive via the Email channel.
As of writing this blog post, there is currently over 200+ notifications that can be configured which are broken up across the following four categories:
- Elastic DRS (7)
- Organization General (128)
- SDDC Maintenance (61)
- VMware Site Recovery Service (23)
Today, the notification preferences is configured on a per-use basis and by default, users are automatically subscribed to all notifications. The ability to customize is great but with over 200+ notifications to select or de-select from, this could be a difficult task, especially with a large number of users who may or may not understand each and ever single notification type. This is certainly an area the VMware Cloud team will be looking to enhance in the future to make it even easier to consume and customize.
In the mean time, to help with making this customization change easier within your organization, we can also take advantage of the new NGW Notification Preferences API. What better way to demonstrate this than incorporating this into my VMware Cloud Notification Gateway Community PowerShell Module, which is also available for consumption within the PowerShell Gallery.
Step 1 - Install the latest VMware Cloud Notification Gateway Community PowerShell Module (Requires 1.0.8 or newer)
Install-Module VMware.VMC.Notification
Step 2 - Connect to the VMC NGW Service providing a valid Refresh Token and the name of the Org:
Connect-VmcNotification -RefreshToken $RefreshToken -OrgName $OrgName
Step 3 - Use the Get-VmcNotificationPreference command to export the current user notification preferences, which will be outputted to a JSON file. By default, the filename will be named notification-pref-[VMC-USERNAME].json and will be located in the current directory. If you wish to save it to different location with a different name, simply add the -ExportFileName argument.
Get-VmcNotificationPreference
This command performs a GET operation against the following https://vmc.vmware.com/api/notification/loggedin/user/preferences/categories?include=notification_types endpoint and produces a JSON file that contains all current supported categories and their respective notification types. Below is one of the notification types for the Elastic DRS category and as you can see, it lists the notification type name (which is really the ID) and the current configured channels for notification.
{ "name": "HighStorageConsumption", "channels": { "EMAIL": "CHECKED", "VCENTER": "DISABLE", "VMC_UI": "DISABLE" } }
You will notice in the Notification Preference UI, you can only configure the Email channel but the underlying API will allow configuration for other channels including vCenter Server within your VMware Cloud SDDC as well as the VMC UI.
Note: If you need to map a specific notification type to friendly label that you see within Notification Preference UI, you can use Get-VmcNotificationType command, which also allows you to filter on a specific category by simply providing the -CategoryId argument.
The outputted JSON file can now be edited to quickly update the preferred notification preferences such as controlling enabling or disabling the email channel. For example, if you wish to disable a specific notification, change the value from "CHECKED" to "UNCHCEKED" and similarly the reverse if you wish to enable a specific notification. Once all changes have been made and saved, you can now use this to quickly update your notification preferences in the next step.
Step 4 - Use the Set-VmcNotificationPreference command along with JSON file from the previous step to now update your notification preferences as shown below:
Set-VmcNotificationPreference -ImportFileName /Users/lamw/Desktop/notification-pref-lamw.json
This command will take the JSON input file and perform a PATCH operation against the following https://vmc.vmware.com/api/notification/loggedin/user/preferences/categories endpoint to update the desired notification preferences.
While new VMware Cloud Notifications are constantly being added, this is an easy way to export the current supported notification preferences and then decide on which notifications you wish to receive, which can be based on end user persona or groups and then using the JSON file as a template for others to quickly update their preferences.
Johan Marais says
Hi William
As always thank you for the great share.
Do you know if there are any plans to make the Cloud Notification Gateway available as a standalone Fling/Appliance or even pre-build VEBA construct for on-prem deployments?
The centralised notification functionality for all VMware products and even third part would be a fantastic service to offer.
Johan
William Lam says
Hi Johan,
No plans, it is a Cloud Service. Totally agree on benefits of centralizing notification for even on-prem and other products. Is this something you're interested in chatting more about? If so, reach out via my Contact page and happy to have a discussion