將 Azure Cache for Redis 作為事件方格來源 (機器翻譯)

本文提供 Azure Cache for Redis 事件的屬性和結構描述。 如需事件結構描述的簡介,請參閱 Azure Event Grid 事件結構描述

可用的事件類型

當用戶端呼叫 Azure Cache for Redis REST API 來匯出、匯入或調整時,就會觸發這些事件。 修補事件是由 Redis 更新觸發。

事件名稱 描述
Microsoft.Cache.ExportRDBCompleted 匯出快取資料時觸發。
Microsoft.Cache.ImportRDBCompleted 匯入快取資料時觸發。
Microsoft.Cache.PatchingCompleted 修補完成時觸發。
Microsoft.Cache.ScalingCompleted 調整完成時觸發。

事件範例

觸發事件時,事件方格服務會將該事件的相關資料傳送至訂閱端點。 本節包含每個 Azure Cache for Redis 事件的資料外觀範例。

Microsoft.Cache.PatchingCompleted 事件

[{
"id":"9b87886d-21a5-4af5-8e3e-10c4b8dac73b",
"eventType":"Microsoft.Cache.PatchingCompleted",
"topic":"/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Cache/Redis/{cache_name}",
"data":{
    "name":"PatchingCompleted",
    "timestamp":"2020-12-09T21:50:19.9995668+00:00",
    "status":"Succeeded"},
"subject":"PatchingCompleted",
"dataversion":"1.0",
"metadataVersion":"1",
"eventTime":"2020-12-09T21:50:19.9995668+00:00"}]

Microsoft.Cache.ImportRDBCompleted 事件

[{
"id":"9b87886d-21a5-4af5-8e3e-10c4b8dac73b",
"eventType":"Microsoft.Cache.ImportRDBCompleted",
"topic":"/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Cache/Redis/{cache_name}",
"data":{
    "name":"ImportRDBCompleted",
    "timestamp":"2020-12-09T21:50:19.9995668+00:00",
    "status":"Succeeded"},
"subject":"ImportRDBCompleted",
"dataversion":"1.0",
"metadataVersion":"1",
"eventTime":"2020-12-09T21:50:19.9995668+00:00"}]

Microsoft.Cache.ExportRDBCompleted 事件

[{
"id":"9b87886d-21a5-4af5-8e3e-10c4b8dac73b",
"eventType":"Microsoft.Cache.ExportRDBCompleted",
"topic":"/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Cache/Redis/{cache_name}",
"data":{
    "name":"ExportRDBCompleted",
    "timestamp":"2020-12-09T21:50:19.9995668+00:00",
    "status":"Succeeded"},
"subject":"ExportRDBCompleted",
"dataversion":"1.0",
"metadataVersion":"1",
"eventTime":"2020-12-09T21:50:19.9995668+00:00"}]

Microsoft.Cache.ScalingCompleted

[{
"id":"9b87886d-21a5-4af5-8e3e-10c4b8dac73b",
"eventType":"Microsoft.Cache.ScalingCompleted",
"topic":"/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Cache/Redis/{cache_name}",
"data":{
    "name":"ScalingCompleted",
    "timestamp":"2020-12-09T21:50:19.9995668+00:00",
    "status":"Succeeded"},
"subject":"ScalingCompleted",
"dataversion":"1.0",
"metadataVersion":"1",
"eventTime":"2020-12-09T21:50:19.9995668+00:00"}]

事件屬性

事件具有下列的最高層級資料:

屬性 類型​ 描述
topic string 事件來源的完整資源路徑。 此欄位無法寫入。 事件方格提供此值。
subject string 發行者定義事件主旨的路徑。
eventType string 此事件來源已註冊的事件類型之一。
eventTime string 事件產生的時間,以提供者的 UTC 時間為準。
id string 事件的唯一識別碼。
data object Azure Cache for Redis 事件資料。
dataVersion string 資料物件的結構描述版本。 發行者會定義結構描述版本。
metadataVersion string 事件中繼資料的結構描述版本。 「事件方格」會定義最上層屬性的結構描述。 事件方格提供此值。

資料物件具有下列屬性:

屬性 類型​ 描述
timestamp string 事件發生的時間。
name string 事件的名稱。
status string 事件的狀態。 失敗或成功。

快速入門

如果您想要嘗試 Azure Cache for Redis 事件,請參閱下列任何快速入門文章:

如果您想要使用此工具: 請參閱此文章:
Azure 入口網站 快速入門:使用 Azure 入口網站將 Azure Cache for Redis 事件路由傳送至 Web 端點
PowerShell 快速入門:使用 PowerShell 將 Azure Cache for Redis 事件路由傳送至 Web 端點
Azure CLI 快速入門:使用 Azure CLI 將 Azure Cache for Redis 事件路由傳送至 Web 端點

下一步