WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Automating the new VMware Cloud Notification Gateway (NGW) User Notification Preferences

Automating the new VMware Cloud Notification Gateway (NGW) User Notification Preferences

10.25.2021 by William Lam // 2 Comments

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.

More from my site

  • Publishing and consuming custom events with VMware Event Broker Appliance (VEBA)
  • VMware Cloud (VMC) Console Inventory with various vSphere "Linked Modes"
  • Quick demo videos of new VMware Cloud with Tanzu services
  • Decoding Services Roles/Permissions from a VMware Cloud Services Platform (CSP) Token
  • New SDDC Linking capability for VMware Cloud on AWS

Categories // Automation, PowerCLI, VMware Cloud, VMware Cloud on AWS Tags // Notification Gateway, VMware Cloud, VMware Cloud on AWS, VMware Site Recovery

Comments

  1. *protectedJohan Marais says

    10/26/2021 at 3:50 am

    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

    Reply
    • William Lam says

      10/27/2021 at 11:29 am

      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

      Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...