Subscription

Table of contents

  1. Description
  2. Properties
  3. Example

Description

Subscription is the aggregation of actions and conditions. When an event is received in Alert Notification service, it will only be processed if a subscription exists and the matching criteria of the conditions are fulfilled.

Properties

Field Type Description
id? string An identification string which will be generated on its creation
name string Unique name, used for its identification
state State (string) Identifies the subscription’s current state, that is, if it’s currently enabled or disabled
description? string Brief description of the action, e.g. explaining what it will be used for
snoozeTimestamp? number Unix timestamp format representing disablement of the subscription until the specified date and time
actions? string[] Action names that are executed on any matched event
conditions? string[] Condition names that are evaluated for any incoming event
labels? string[] Representing meaningful identifiers, which enable custom displaying & filtering capabilities

Example

import { State } from '@sap_oss/alert-notification-client';

const subscription = {
    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'
};