RealtimeAlertEvent
Service Cloud Voice Amazon Connect インスタンスからの Amazon CloudWatch アラームイベントを登録者に通知します。このオブジェクトは、API バージョン 54.0 以降で使用できます。
サポートされているコール
describeSObjects()
サポートされている登録者
| 登録者 | サポートされているかどうか |
|---|---|
| Apex トリガ | ![]() |
| フロー | ![]() |
| プロセス | ![]() |
| ストリーミング API (CometD) | ![]() |
ストリーミング API 登録チャネル
/event/RealtimeAlertEvent
特別なアクセスルール
このオブジェクトにアクセスするには、Amazon Connect を使用できる Service Cloud Voice が必要です。
項目
| 項目 | 詳細 |
|---|---|
| Description |
|
| EventDateTime |
|
| Name |
|
| Payload |
|
| Severity |
|
| Source |
|
使用方法
次の例は、RealtimeAlert イベントを処理する方法を示しています。これは、プラットフォームイベントメッセージが公開されたときに起動され、管理プロファイルでイベントの詳細を含む Chatter 投稿を作成する Apex トリガの例です。
1trigger RealtimeAlertEventTrigger on RealtimeAlertEvent (after insert) {
2 Id profileId = [select Id from User where User.Profile.Name = 'System Administrator' limit 1].Id;
3 for(RealtimeAlertEvent e : trigger.new) {
4 Feeditem Post = New Feeditem();
5 Post.ParentId= profileId;
6 Post.Body = 'Alert occurred in the service: ' + e.Source + '\n' +
7 'Name: ' + e.Description + '\n' +
8 'Severity: ' + e.EventDateTime + '\n' +
9 'Payload: ' + e.Payload + '\n' +
10 'EventDate: ' + e.EventDateTime + '\n' +
11 'Description: ' + e.Name + '\n';
12 insert Post;
13 }
14}例
このコード例は、次を含む Chatter 投稿として表示されます。
1Alert occurred in the service: aws cloudwatch alarm
2Name: alert description
3Severity: 2021-11-05 11:11:11
4Payload: payload
5EventDate: 2021-11-05 11:11:11
6Description: alert name