Configuration
Table of contents
Description
Configuration represents the assembly of actions, conditions and subscriptions
Properties
Field | Type | Description |
---|---|---|
actions | Action[] (object[]) | Actions in the configuration |
conditions | Condition[] (object[]) | Conditions in a configuration |
subscriptions | Subscription[] (object[]) | Subscriptions in a configuration |
@Example:
import { State, Predicate } from '@sap_oss/alert-notification-client';
const configuration =
{
actions: [
{
name: 'to-my-email',
type: 'EMAIL',
description: 'send to my mail',
state: State.ENABLED,
properties: {
destination: '<your-email>@<domain>.com'
}
}
],
conditions: [
{
name: 'event-type-contains-HighCpu',
description: 'Match events which body contains HighCpu',
propertyKey: 'eventType',
predicate: Predicate.CONTAINS,
propertyValue: 'HighCpu'
}
],
subscriptions: [
{
name: 'event-with-eventType-HighCpu-to-mail',
state: State.ENABLED,
actions: ['to-my-email'],
conditions: ['event-type-contains-HighCpu'],
description: 'Subscription will act when an event with eventType - HighCpu is received and will send an email to me'
}
]
};