使用 IBM Cloud 分發清單管理通知

瞭解如何在 IBM Cloud 中設定和管理通知分發清單,以便使用電子郵件或 webhooks 接收整個帳戶的事件通知。

您可以使用 IBM Cloud 主控台管理通知分發清單。 您最多可以建立 10 個電子郵件地址清單,以接收通知。 被加入分發清單的電子郵件會收到任何影響帳戶事件的通知。 您必須在帳戶管理服務上擁有編輯或更高階的角色,才能將電子郵件地址新增至分發清單。 如需詳細資訊,請參閱 指派帳戶管理服務存取權限

帳戶擁有者新增至分發清單的電子郵件地址,會收到帳戶擁有者「通知」頁面上出現的任何事件、維護、公告或安全公告的通知。

除了新增電子郵件位址外,您也可以新增多達 10 個 webhooks 到一個分發清單。 帳戶管理員可以建立並使用 webhooks 來設定應用程式,以便在平台事件發生時接收異步通知。 註冊的 Webhooks 會以 HTTP POST 請求的形式將資訊傳送至指定的 URL,並附上 JSON 有效負載。 請求的 content-type 為 application/json

在主控台中將電子郵件地址加入通知分發清單

若要將電子郵件新增至通知分發清單,請完成下列步驟:

  1. 使用 IBM Cloud 主控台,移至管理 > 帳戶 > 通知分發清單

  2. 選取新增 > 電子郵件

  3. 輸入姓名和電子郵件地址。

    您可以新增最多 10 個電子郵件位址到發佈清單中。 電子郵件地址不需要對應 IBM Cloud 中的已知使用者,您可以新增任何類型的電子郵件地址。

  4. 按一下新增

取消訂閱分發清單

若要取消訂閱分發清單,請使用分發清單發送的任何電子郵件腳部的連結。

為通知分發清單啟用 Event Notifications

透過 IBM Cloud® Event Notifications,您可以選擇將通訊傳送至不同的目的地,包括電子郵件、簡訊或 Webhooks。Event Notifications 是通知分發清單的另一種選擇。 它提供了一種方式,讓您可以收到帳戶中發生的重要事件的通知,並管理您的通知規模。 如需詳細資訊,請參閱 Event Notifications 入門

當 IBM Cloud 平台上發生感興趣的事件並產生事件時,通知分發清單會與連接的 Event Notifications 實例通訊,將通知轉發至支援的目的地。 如需支援的 Event Notifications 目的地的詳細資訊,請參閱 事件目的地

通知的事件

下表列出了通知服務傳送至 Event Notifications 的事件類型:

由通知服務產生的事件
事件名稱 事件類型 說明
維護 com.ibm.cloud.notificationapi.maintenance 為了讓 IBM Cloud 平台和基礎架構保持最佳運作狀態所需的定期維護。
突發事件 com.ibm.cloud.notificationapi.incident 可能導致中斷或限制功能的意外影響事件。
安全公告 com.ibm.cloud.notificationapi.security_bulletins 關於安全漏洞及必要動作的公告。
公告 com.ibm.cloud.notificationapi.announcements 有關新基礎結構功能和服務的更新,請上 IBM Cloud。
資源 com.ibm.cloud.notificationapi.resource 資源活動的最新情況。
計費及用量 com.ibm.cloud.notificationapi.billing_and_usage 帳單和使用費率的更新。
通知服務產生的子類型事件
事件名稱 事件類型 說明
支出警示(帳單和使用量) com.ibm.cloud.notificationapi.billing_and_usage:spending_alerts 支出警示。

將 Event Notifications 範例加入通知分發清單

在您可以將任何 Event Notifications 範例新增至通知分發清單之前,請確定您已經擁有與分發清單在同一帳戶中的 Event Notifications 服務範例。 如果您沒有 Event Notifications 服務實例,請參閱 Event Notifications 入門。 若要將現有的 Event Notifications 服務實例新增至通知散佈清單,請完成下列步驟:

  1. 使用 IBM Cloud 主控台,移至管理 > 帳戶 > 通知分發清單
  2. 按一下 新增 > Event Notifications
  3. 從 Event Notifications 範例清單中選取 Event Notifications 服務範例。 如果您沒有可以連接到帳戶的 Event Notifications 服務實例,您可以在 IBM Cloud 目錄中建立一個。
  4. 按一下新增

您不能將 Event Notifications 服務實例新增至已設定的通知分發清單。

將測試通知傳送至 Event Notifications 範例

將 Event Notifications 實例新增至通知分發清單後,您可以測試該實例,以確保由通知服務產生的事件都被轉發至該實例。

完成下列步驟,將測試通知傳送至 Event Notifications 範例:

  1. 在 IBM Cloud 主控台中,移至管理 > 帳戶 > 通知分發清單
  2. 選取要傳送測試通知的 Event Notifications 範例,然後按一下動作圖示動作 > 測試
  3. 選取您要測試的通知事件類型,然後按一下傳送測試
    1. 若要重新傳送測試通知,請按一下重新傳送測試

通知有效負載詳細資訊

當 Event Notifications 範例新增至您帳戶的傳送清單,且該帳戶收到通知時,通知有效負載會傳送至該 Event Notifications 範例。 所有事件類型的 payload 物件屬性都相同。 請參閱以下的有效負載範例,其中包含傳送測試通知的維護事件的詳細資訊:

{
   "instanceId": "12345678-abcd-1234-efgh-1234567890ab",
   "id": "CHG1234567",
   "source": "crn:v1:bluemix:public:notificationapi::a/<scope>:12345678-abcd-1234-efgh-1234567890ab::",
   "ibmenseverity": "high_impact",
   "severity": "high_impact",
   "ibmensourceid": "crn:v1:bluemix:public:notificationapi::a/<scope>:12345678-abcd-1234-efgh-1234567890ab::",
   "type": "com.ibm.cloud.notificationapi.maintenance",
   "time": "2025-10-08T18:31:09.363Z",
   "ibmendefaultshort": "Maintenance - High Impact: this is a maintenance test notif",
   "ibmendefaultlong": "this is a maintenance test notif \n \nSource ID: CHG1234567 \nType: Maintenance \nSeverity: High Impact \nStart Time: 23 Oct 2025, 7:09 PM UTC \nEnd Time: 24 Oct 2025, 7:09 PM UTC \nUpdate Time: 21 Oct 2025, 2:52 AM UTC \n\nthis is the body text and sev = 1\n\nThis is a test email, please disregard\n\n\n",
   "ibmensmstext": "Maintenance - High Impact: this is a maintenance test notif \nSource ID: CHG2755299 \nCategory: Maintenance \nSeverity: High Impact \n",
   "ibmensubject": "Maintenance - High Impact: this is a maintenance test notif",
   "ibmenhtmlbody": "<div> this is a maintenance test notif</div></br><div><div><b>Source ID:</b> CHG2755299</div><div><b>Type:</b> Maintenance</div><div><b>Severity:</b> High Impact</div><div><b>Start Time:</b> 23 Oct 2025, 7:09 PM UTC</div><div><b>End Time:</b> 24 Oct 2025, 7:09 PM UTC</div><div><b>Update Time:</b> 21 Oct 2025, 2:52 AM UTC</div></br>this is the body text and sev = 1</br></div><div></br><b>This is a test email, please disregard</b></br><div>",
   "specversion": "1.0",
   "datacontenttype": "application/json",
   "data": {
       "sourceID": "CHG1234567",
       "category": "maintenance",
       "severity": 1,
       "crnMasks": [],
       "startTime": "1761246551",
       "endTime": "1761332951",
       "title": [
           {
               "language": "en",
               "text": "this is a maintenance test notif"
           }
       ],
       "body": [
           {
               "content-type": "text/html",
               "language": "en",
               "text": "this is the body text and sev = 1"
           }
       ]
   }
}

檢視下表,以取得更多關於通知的有效負載屬性的資訊:Event Notifications。

有關通知有效負載屬性的詳細資訊
內容 說明
instanceId source 屬性中 Event Notifications 的服務實體值。
id 通知 ID。
source 事件發生來源的識別碼。 在這種情況下,notification-api 會將事件觸發至特定帳戶的 Event Notifications 範例。 這由唯一的雲端資源名稱 (CRN) 表示,如下所示:
crn:<version>:<cname>:<ctype>:notificationapi:<location>:a/<scope>:<instanceId>::
ibmenseverity 事件的嚴重程度。 只有維護和事件事件可以有非空的嚴重性數值。

維護事件可以有非空值: high_impact, medium_impactlow_impact
事件事件可以有非空的嚴重性數值: sev1, sev2, sev3,sev4

severity ibmseverity 屬性相同。
type 建立的事件類型。
time 事件發生時的協調世界時間 (UTC) 時間戳記。
ibmendefaultshort 傳回通知的標題以及嚴重性等級。
ibmendefaultlong 返回由通知的所有屬性組成的單一字串。
ibmensmstext 返回由標題和任何這些屬性(如果存在)組成的單一字串:sourceID, component, region, category, severity
ibmensubject 傳回通知的標題以及嚴重性等級。
ibmenhtmlbody 通知的 HTML 正文。
specversion Event Notifications 支援的 CloudEvents 規格版本。
datacontenttype 資料內容的 MIME 類型。
data 包含通知事件元資料的通知物件。 每個事件類型都有相同的資料屬性。 這包括 sourceID, category, severity, crnMasks, startTime, endTime, title, 以及 body

sourceID: 一個特殊的識別碼,包含用來建立通知的系統前綴,以及唯一值。 它與在有效負載中找到的 source 屬性無關。
category : 發送通知的類型 (與事件名稱相同)。
severity : 代表嚴重等級的數字。 對於維護事件類型,值是 [1,2,3] 之一。 對於事件類型,值是 [1,2,3,4] 之一。 對於其他事件類型,其值為 "".
crnMasks : 代表受影響服務類型和區域清單 (非特定實例) 的 CRN 陣列。
startTime : 以 Unix 時間為單位的事件開始時間。 只有計費和使用事件類型的值為 "".
endTime : 以 Unix 時間為單位的事件結束時間。 只有計費和使用以及資源事件類型的值為 ""
title : 一系列標題及其相關語言。
body : 包含通知正文的陣列,每個可用語言有一個物件。

刪除 Event Notifications 範例

您可以透過完成下列步驟,刪除任何已新增至通知分發清單的 Event Notifications 範例:

  1. 選擇要從通知分發清單中刪除的 Event Notifications 服務實例,然後按一下動作圖示動作
  2. 按一下刪除

將 webhooks 加入配送清單

若要新增 webhooks 到分發清單,請完成下列步驟:

  1. 移至 IBM Cloud® 主控台中的管理 > 帳戶 > 通知分發清單

  2. 按一下新增,然後選取新增 webhook

  3. 輸入 webhook 的名稱識別符及端點 URL,當 Webhook 被觸發,事件的通知會傳送至該端點。 設定 URL,成為您自己的自訂端點。

    自訂標頭和安全標頭欄位也可以設定。 您可以按一下新增標頭新增安全標頭來指定。 如果您選擇為憑證加入安全標頭,它們會與私人資料一起加密傳輸。 這種類型的標頭可以刪除,但之後不能編輯。 您稍後可以輕鬆編輯和刪除自訂標題。

    如果您不想再接收通知,您可以按一下動作圖示 動作圖示 > 刪除 webhook 行中的 webhook,輕鬆地從散佈清單中刪除您的 webhook。

    您可以按一下主控台中的帳戶切換器,選擇您使用的 IBM Cloud 帳戶。 選取帳戶中的使用者會收到任何影響該帳戶事件的通知。

當您透過 webhook 接收通知時,一個有效負載會被傳送到您指定的 webhook 端點 ( URL ),並告知您所發生事件的所有詳細資訊。 請參閱下列範例:

{
  "account_id": "2dd2d2de4add4a098ebd0999be5cc555",
  "body": [
    {
      "language": "en",
      "text": "<p><br />SERVICES/COMPONENTS AFFECTED:<br />- Cloudant NoSQL DB<br />- Code Engine<br />- DNS Services<br />- App ID<br />- IBM Watson Machine Learning<br />- Continuous Delivery - Toolchain<br />- MQ in IBM Cloud<br />- Hyper Protect Crypto Services<br /><br />IMPACT:<br />- Users may experience connectivity issues when trying to connect to Cloudant services.<br /><br />STATUS:<br />- 2021-05-25 14:54 UTC - INVESTIGATING - We are aware of the issue and are currently investigating. More information will be provided as it becomes available.</p>"
    }
  ],
  "category": "Incident",
  "componentNames": "Cloudant",
  "continentNames": [
    "North America",
    "Europe",
    "Asia Pacific"
  ],
  "regionNames": [
    "Washington DC",
    "London",
    "Dallas",
    "Sydney",
    "Tokyo",
    "Frankfurt"
  ],
  "regions": [
    "us-east",
    "eu-gb",
    "us-south",
    "au-syd",
    "jp-tok",
    "eu-de"
  ],
  "severity": "Severity 1",
  "sourceID": "INC3918600",
  "startTime": 1621949594,
  "state": "Investigating",
  "title": [
    {
      "language": "en",
      "text": "INVESTIGATING: IBM Cloudant - selective services  are unavailable"
    }
  ],
  "updateTime": 1621954682
}

標頭

您收到的有效負載會附有您新增 webhook 時在使用者介面中設定的標頭,以及附有語意版本號碼的附加版本標頭。 此版本標頭可用於確定 webhook 有效負載的預期格式。

目前的版本標頭為 "IBM-Notifications-API-Version": "v2.0.0"

欄位值

以下說明提供有關在有效負載內傳送的欄位值的資訊:

body:此欄位描述平台上發生且與您有關的事件。 此欄位包含通知的詳細、人類可讀的說明,可長達數個段落。 它也可以包含 html 格式。 此欄位已設定為支援更多的語言,雖然目前只支援英文。

category:事件類型。 這可以是事件、維護、公告或安全公告。

componentNames:如果服務受到影響,此欄位代表該服務。 這也可以是一個全局值,例如 Component: IBM Cloud,而不只是特定的服務。 請參閱 IBM Cloud 目錄頁面上的服務。

regions:此欄位顯示事件的位置。

severity:此欄位指事件的嚴重性。 事件的嚴重程度可以是 1、2、3 或 4,維護的嚴重程度可以是高、中或低,公告的嚴重程度可以是大或小。 請參閱下列詳細的嚴重性等級說明:

* **Incidents**
  * `Severity 1`: Business-critical functionality is inoperable or critical interference failed. This severity usually applies to the production environment and the inability to access services is causing a critical impact on operations.
  * `Severity 2`: Core functionality is impacted. Service is operational but causing major impact on usage.
  * `Severity 3`: Partial or noncritical disruption to functionality with minimal or isolated impact.
  * `Severity 4`: A minor issue that requires action, but does not impact functionality or usage.
* **Maintenance**
  * `High impact`: Maintenance will, or is likely to cause service outages and disruptions.
  * `Medium impact`: Maintenance will, or is likely to cause measurable service degradation but not an actual outage.
  * `Low impact`: Maintenance will cause no service disruption during or after the maintenance window.
* **Announcements**
  * `Major`: Important incidents such as legal notices, service deprecation, or security patches.
  * `Minor`: Informative announcements such as product enhancements.

請求有效負載中的嚴重性屬性值可以是 0、1、2、3 或 4。 下表列出嚴重程度值及其對應的分類:

嚴重程度等級及其對應類別
嚴重性值 突發事件 維護 公告
0 嚴重性 4 次要
1 嚴重性 1 重大
2 嚴重性 2 次要
3 嚴重性 3 次要
4 嚴重性 4 次要

state:此欄位只用於維護和通知。 請參閱下列可能的值:

* Values for *Maintenance* states: Planned, In progress, Completed, Canceled, Failed
* Values for *Incident* states: New issue, Investigating, Resolved

title:標題欄位會告訴您通知的內容。 此欄位已設定為支援更多的語言,雖然目前只支援英文。

startTime, endTime: 您可以檢查事件開始和結束的時間。

startTimeendTime 欄位顯示事件的開始時間和結束時間( Unix Coordinated Universal Time 時間戳記)。

在 payload 中傳送的欄位可以是必填欄位,也可以是選填欄位。 可選欄位,例如 startTime,如果通知有這類資訊,就會傳送;如果通知沒有這類資訊,就不會傳送。 必填欄位,例如 category,在任何情況下都會傳送。 下表列出哪些欄位是必填欄位,哪些是選填欄位:

有效負載中的欄位
欄位 必填或選填
** account_id**: account_id
類別:notification.category 必要的
標題:notification.title Required
startTime:notification.startTime 選項
結束時間:notification.endTime 選項
更新時間:notification.updateTime 選項
身體:notification.body Required
狀態:notification.state 選項
** sourceID**:notification.sourceID
區域:notification.regions 選項
** continentNames**:notification.continentNames
** regionNames**:notification.regionNames
組件名稱:notification.componentNames 選項
** subCategory**:notification.subCategory
嚴重性:notification.severity 選項

將來可能會增加額外的欄位,而不需要進行重大的版本變更。 這表示任何處理通知的程式碼都應該準備忽略無法辨識的欄位。

傳送測試通知至 webhook

如果您已準備好前面的步驟,並已設定好 webhook,就可以輕鬆測試。 傳送測試通知到您的 webhook,並確保您的 webhook 整合正常運作,並能接收到通知。

完成下列步驟,將測試通知傳送至 webhook:

  1. 移至 IBM Cloud 主控台中的管理 > 帳戶 > 通知分發清單
  2. 選取您要傳送測試通知的 webhook,然後按一下 Actions 圖示 Actions
  3. 按一下測試 > 傳送測試
  4. 若要重新傳送測試通知,請按一下重新傳送測試

將 Slack webhooks 新增至分發清單

您可以將 Slack webhooks 加入您的分發清單,並透過它們接收整個帳號的 IBM Cloud 通知。

要建立 webhook,首先要在 Slack 中建立應用程式,並建立傳入 webhook,它提供唯一的 URL,您可以在此以 JSON 有效負載的形式傳送通知訊息文字。 您會在安裝應用程式的所選 Slack 頻道中收到通知。 如需詳細資訊,請參閱 使用 Incoming Webhooks 傳送訊息

若要在 IBM Cloud 主控台中新增 Slack webhook,請完成下列步驟:

  1. 移至 IBM Cloud 主控台中的管理 > 帳戶 > 通知分發清單
  2. 按一下新增,然後選取 Slack
  3. 輸入 webhook 的名稱和 Slack webhook URL。 通知會傳送到這個唯一的 URL。

將 Microsoft Teams webhooks 加入分發清單

將 Microsoft Teams webhooks 加入您的分發清單,也可讓您接收整個帳號的 IBM Cloud 通知。

要在 IBM Cloud 主控台中建立 webhook,首先要在 Microsoft Teams 中建立傳入的 webhook。 這允許外部應用程式在 Teams 頻道中分享內容,並提供獨特的 URL,您可以在其中以 JSON 付載的形式傳送通知訊息文字。 您會在所選擇的 Teams 頻道中收到通知,您在該頻道中加入了傳入的 webhook。 如需詳細資訊,請參閱 建立傳入 Webhook

若要在 IBM Cloud 主控台中新增 Microsoft Teams webhook,請完成下列步驟:

  1. 移至 IBM Cloud 主控台中的管理 > 帳戶 > 通知分發清單
  2. 按一下新增,然後選取 Microsoft Teams.
  3. 輸入 webhook 的名稱和 Microsoft Teams webhook URL。 通知會傳送到這個唯一的 URL。

設定 ServiceNow webhooks

與 Microsoft Teams 和 Slack webhook 整合不同,設定 ServiceNow webhook 需要在 webhook 目的地端進行設定。

首先,您需要在 ServiceNow 網站上建立 Scripted REST API。 設定 Scripted REST API 之後,您還需要建立 Scripted REST API Resource。 請求方法需要設定為 HTTP POST。 接著,您需要提供資源執行的代碼。

當您準備好程序,並為您的 Scripted REST API 取得 URL 後,您就可以開始在 IBM Cloud 通知分發清單網頁上使用它,並建立 webhooks。

若要瞭解完整的 ServiceNow Webhook 整合程序,請遵循「如何將 Webhook 整合至 ServiceNow」部落格文章中的指示。 本部落格將帶您詳細瞭解這些步驟。